summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/openbsd-compat/port-aix.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-06-27 22:31:32 +0000
committerdes <des@FreeBSD.org>2002-06-27 22:31:32 +0000
commitbb02848f18878bddada7a9f55b110116f63c2f3c (patch)
treed93e4bc5fc0a9a5e99878bd93a4d51c873c1a43e /crypto/openssh/openbsd-compat/port-aix.c
parent610201f50fdb0594e9885594b69e4ee69c71dd08 (diff)
downloadFreeBSD-src-bb02848f18878bddada7a9f55b110116f63c2f3c.zip
FreeBSD-src-bb02848f18878bddada7a9f55b110116f63c2f3c.tar.gz
Vendor import of OpenSSH 3.3p1.
Diffstat (limited to 'crypto/openssh/openbsd-compat/port-aix.c')
-rw-r--r--crypto/openssh/openbsd-compat/port-aix.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/crypto/openssh/openbsd-compat/port-aix.c b/crypto/openssh/openbsd-compat/port-aix.c
new file mode 100644
index 0000000..ca0a88e
--- /dev/null
+++ b/crypto/openssh/openbsd-compat/port-aix.c
@@ -0,0 +1,31 @@
+#include "includes.h"
+
+#ifdef _AIX
+
+#include <uinfo.h>
+#include <../xmalloc.h>
+
+/*
+ * 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
+ */
+void
+aix_usrinfo(struct passwd *pw, char *tty, int ttyfd)
+{
+ u_int i;
+ char *cp=NULL;
+
+ if (ttyfd == -1)
+ tty[0] = '\0';
+ cp = xmalloc(22 + strlen(tty) + 2 * strlen(pw->pw_name));
+ i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", pw->pw_name, 0,
+ pw->pw_name, 0, tty, 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 /* _AIX */
+
OpenPOWER on IntegriCloud