Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/rexecd Also set LOGNAME in the environment.



details:   https://anonhg.NetBSD.org/src/rev/cf86b4ed8e2d
branches:  trunk
changeset: 566500:cf86b4ed8e2d
user:      kleink <kleink%NetBSD.org@localhost>
date:      Tue May 11 08:07:37 2004 +0000

description:
Also set LOGNAME in the environment.

diffstat:

 libexec/rexecd/rexecd.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r e57d1dd45d65 -r cf86b4ed8e2d libexec/rexecd/rexecd.c
--- a/libexec/rexecd/rexecd.c   Mon May 10 23:30:40 2004 +0000
+++ b/libexec/rexecd/rexecd.c   Tue May 11 08:07:37 2004 +0000
@@ -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 @@
 #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 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 @@
        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++;



Home | Main Index | Thread Index | Old Index