summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-03-17 10:29:50 +1100
committerDamien Miller <djm@mindrot.org>2001-03-17 10:29:50 +1100
commit168a700cc6ac55ed7b0682f60c7fe7f4d73a0116 (patch)
tree3bc9ed03cde7bfa17c77450318250072ece71703 /session.c
parentc7f4ccd52c758e60e8593ebfd98a25c484a49d02 (diff)
- Support usrinfo() on AIX. Based on patch from Gert Doering
<gert@greenie.muc.de>
Diffstat (limited to 'session.c')
-rw-r--r--session.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/session.c b/session.c
index 4562b6d72..3c53f5cc1 100644
--- a/session.c
+++ b/session.c
@@ -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 */