summaryrefslogtreecommitdiff
path: root/libexec/rexecd
diff options
context:
space:
mode:
authorkleink <kleink@NetBSD.org>2004-05-11 08:07:37 +0000
committerkleink <kleink@NetBSD.org>2004-05-11 08:07:37 +0000
commitab12386beb4dab0d7c7381d13ceeaf2028fc6fa6 (patch)
tree2c9390bfc3b17b40f27601c6ab650466f6d2dcf7 /libexec/rexecd
parent9b4a373ddfd0eef00b8302da1f7c3384613c0da6 (diff)
Also set LOGNAME in the environment.
Diffstat (limited to 'libexec/rexecd')
-rw-r--r--libexec/rexecd/rexecd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c
index d63f6ec5d1b..f980ca9c255 100644
--- a/libexec/rexecd/rexecd.c
+++ b/libexec/rexecd/rexecd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rexecd.c,v 1.17 2003/08/07 09:46:46 agc Exp $ */
+/* $NetBSD: rexecd.c,v 1.18 2004/05/11 08:07:37 kleink Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "from: @(#)rexecd.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: rexecd.c,v 1.17 2003/08/07 09:46:46 agc Exp $");
+__RCSID("$NetBSD: rexecd.c,v 1.18 2004/05/11 08:07:37 kleink Exp $");
#endif
#endif /* not lint */
@@ -68,10 +68,11 @@ void doit __P((int, struct sockaddr *));
void getstr __P((char *, int, char *));
char username[32 + 1] = "USER=";
+char logname[32 + 3 + 1] = "LOGNAME=";
char homedir[PATH_MAX + 1] = "HOME=";
char shell[PATH_MAX + 1] = "SHELL=";
char path[sizeof(_PATH_DEFPATH) + sizeof("PATH=")] = "PATH=";
-char *envinit[] = { homedir, shell, path, username, 0 };
+char *envinit[] = { homedir, shell, path, username, logname, 0 };
char **environ;
int dolog;
@@ -274,6 +275,7 @@ doit(f, fromp)
strlcat(homedir, pwd->pw_dir, sizeof(homedir));
strlcat(shell, pwd->pw_shell, sizeof(shell));
strlcat(username, pwd->pw_name, sizeof(username));
+ strlcat(logname, pwd->pw_name, sizeof(logname));
cp = strrchr(pwd->pw_shell, '/');
if (cp)
cp++;