- Support usrinfo() on AIX. Based on patch from Gert Doering

<gert@greenie.muc.de>
This commit is contained in:
Damien Miller 2001-03-17 10:29:50 +11:00
parent c7f4ccd52c
commit 168a700cc6
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,7 @@
20010317
- Support usrinfo() on AIX. Based on patch from Gert Doering
<gert@greenie.muc.de>
20010315 20010315
- OpenBSD CVS Sync - OpenBSD CVS Sync
- markus@cvs.openbsd.org 2001/03/14 08:57:14 - markus@cvs.openbsd.org 2001/03/14 08:57:14
@ -4559,4 +4563,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.960 2001/03/15 00:09:15 mouring Exp $ $Id: ChangeLog,v 1.961 2001/03/16 23:29:50 djm Exp $

View File

@ -89,6 +89,10 @@ RCSID("$OpenBSD: session.c,v 1.59 2001/03/04 01:46:30 djm Exp $");
# define S_UNOFILE_HARD S_UNOFILE "_hard" # define S_UNOFILE_HARD S_UNOFILE "_hard"
#endif #endif
#ifdef _AIX
# include <uinfo.h>
#endif
/* types */ /* types */
#define TTYSZ 64 #define TTYSZ 64
@ -1136,6 +1140,23 @@ do_child(const char *command, struct passwd * pw, const char *term,
} }
#endif /* WITH_IRIX_AUDIT */ #endif /* WITH_IRIX_AUDIT */
#ifdef _AIX
/*
* AIX has a "usrinfo" area where logname and
* other stuff is stored - a few applications
* actually use this and die if it's not set
*/
cp = xmalloc(22 + strlen(ttyname) +
2 * strlen(pw->pw_name));
i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c",
pw->pw_name, 0, pw->pw_name, 0, ttyname, 0,0);
if (usrinfo(SETUINFO, cp, i) == -1)
fatal("Couldn't set usrinfo: %s",
strerror(errno));
debug3("AIX/UsrInfo: set len %d", i);
xfree(cp);
#endif
/* Permanently switch to the desired uid. */ /* Permanently switch to the desired uid. */
permanently_set_uid(pw->pw_uid); permanently_set_uid(pw->pw_uid);
# endif /* HAVE_LOGIN_CAP */ # endif /* HAVE_LOGIN_CAP */