]> andersk Git - gssapi-openssh.git/blame - openssh/openbsd-compat/port-aix.c
Import of OpenSSH 3.4p1
[gssapi-openssh.git] / openssh / openbsd-compat / port-aix.c
CommitLineData
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 */
13void
14aix_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
This page took 0.085623 seconds and 5 git commands to generate.