diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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 */ |