summaryrefslogtreecommitdiff
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
parentc7f4ccd52c758e60e8593ebfd98a25c484a49d02 (diff)
- Support usrinfo() on AIX. Based on patch from Gert Doering
<gert@greenie.muc.de>
-rw-r--r--ChangeLog6
-rw-r--r--session.c21
2 files changed, 26 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d61ae639..efbc64644 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120010317
2 - Support usrinfo() on AIX. Based on patch from Gert Doering
3 <gert@greenie.muc.de>
4
120010315 520010315
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 $
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 */