diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | session.c | 21 |
2 files changed, 26 insertions, 1 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20010317 | ||
2 | - Support usrinfo() on AIX. Based on patch from Gert Doering | ||
3 | <gert@greenie.muc.de> | ||
4 | |||
1 | 20010315 | 5 | 20010315 |
2 | - OpenBSD CVS Sync | 6 | - OpenBSD CVS Sync |
3 | - markus@cvs.openbsd.org 2001/03/14 08:57:14 | 7 | - markus@cvs.openbsd.org 2001/03/14 08:57:14 |
@@ -4559,4 +4563,4 @@ | |||
4559 | - Wrote replacements for strlcpy and mkdtemp | 4563 | - Wrote replacements for strlcpy and mkdtemp |
4560 | - Released 1.0pre1 | 4564 | - Released 1.0pre1 |
4561 | 4565 | ||
4562 | $Id: ChangeLog,v 1.960 2001/03/15 00:09:15 mouring Exp $ | 4566 | $Id: ChangeLog,v 1.961 2001/03/16 23:29:50 djm Exp $ |
@@ -89,6 +89,10 @@ RCSID("$OpenBSD: session.c,v 1.59 2001/03/04 01:46:30 djm Exp $"); | |||
89 | # define S_UNOFILE_HARD S_UNOFILE "_hard" | 89 | # define S_UNOFILE_HARD S_UNOFILE "_hard" |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | #ifdef _AIX | ||
93 | # include <uinfo.h> | ||
94 | #endif | ||
95 | |||
92 | /* types */ | 96 | /* types */ |
93 | 97 | ||
94 | #define TTYSZ 64 | 98 | #define TTYSZ 64 |
@@ -1136,6 +1140,23 @@ do_child(const char *command, struct passwd * pw, const char *term, | |||
1136 | } | 1140 | } |
1137 | #endif /* WITH_IRIX_AUDIT */ | 1141 | #endif /* WITH_IRIX_AUDIT */ |
1138 | 1142 | ||
1143 | #ifdef _AIX | ||
1144 | /* | ||
1145 | * AIX has a "usrinfo" area where logname and | ||
1146 | * other stuff is stored - a few applications | ||
1147 | * actually use this and die if it's not set | ||
1148 | */ | ||
1149 | cp = xmalloc(22 + strlen(ttyname) + | ||
1150 | 2 * strlen(pw->pw_name)); | ||
1151 | i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", | ||
1152 | pw->pw_name, 0, pw->pw_name, 0, ttyname, 0,0); | ||
1153 | if (usrinfo(SETUINFO, cp, i) == -1) | ||
1154 | fatal("Couldn't set usrinfo: %s", | ||
1155 | strerror(errno)); | ||
1156 | debug3("AIX/UsrInfo: set len %d", i); | ||
1157 | xfree(cp); | ||
1158 | #endif | ||
1159 | |||
1139 | /* Permanently switch to the desired uid. */ | 1160 | /* Permanently switch to the desired uid. */ |
1140 | permanently_set_uid(pw->pw_uid); | 1161 | permanently_set_uid(pw->pw_uid); |
1141 | # endif /* HAVE_LOGIN_CAP */ | 1162 | # endif /* HAVE_LOGIN_CAP */ |