]>
Commit | Line | Data |
---|---|---|
e9a17296 | 1 | #include "includes.h" |
2 | ||
3 | #ifdef _AIX | |
4 | ||
e9a17296 | 5 | #include <uinfo.h> |
6 | #include <../xmalloc.h> | |
7 | ||
e9a17296 | 8 | /* |
9 | * AIX has a "usrinfo" area where logname and | |
10 | * other stuff is stored - a few applications | |
11 | * actually use this and die if it's not set | |
12 | */ | |
13 | void | |
14 | aix_usrinfo(struct passwd *pw, char *tty, int ttyfd) | |
15 | { | |
16 | u_int i; | |
17 | char *cp=NULL; | |
18 | ||
19 | if (ttyfd == -1) | |
20 | tty[0] = '\0'; | |
21 | cp = xmalloc(22 + strlen(tty) + 2 * strlen(pw->pw_name)); | |
22 | i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", pw->pw_name, 0, | |
23 | pw->pw_name, 0, tty, 0, 0); | |
24 | if (usrinfo(SETUINFO, cp, i) == -1) | |
25 | fatal("Couldn't set usrinfo: %s", strerror(errno)); | |
26 | debug3("AIX/UsrInfo: set len %d", i); | |
27 | xfree(cp); | |
28 | } | |
29 | ||
30 | #endif /* _AIX */ | |
31 |