Hi,

   We've been using the following patch which adds the REMOTEUSER
and REMOTEHOST variables to the environment 'ala Irix.

   Comments and feedback are welcome.  I followed the existing
code style, though I don't really agree with statically allocating
the variable space.

   This patch is against 4.0-current as of today. Would someone
consider committing this?

Thanks!
John


Index: rshd.c
===================================================================
RCS file: /mirror/ncvs/src/libexec/rshd/rshd.c,v
retrieving revision 1.26
diff -u -r1.26 rshd.c
--- rshd.c      1999/08/28 00:10:00     1.26
+++ rshd.c      1999/09/07 20:04:26
@@ -199,8 +199,11 @@
 char   homedir[64] = "HOME=";
 char   shell[64] = "SHELL=";
 char   path[100] = "PATH=";
+char   remoteuser[28] = "REMOTEUSER=";
+char   remotehname[40] = "REMOTEHOST=";
+
 char   *envinit[] =
-           {homedir, shell, path, username, 0};
+           {homedir, shell, path, username, remoteuser, remotehname, 0};
 char   **environ;
 
 void
@@ -676,6 +679,8 @@
        strcat(path, _PATH_DEFPATH);
        strncat(shell, pwd->pw_shell, sizeof(shell)-7);
        strncat(username, pwd->pw_name, sizeof(username)-6);
+       strncat(remoteuser, remuser, sizeof(remoteuser)-12);
+       strncat(remotehname, fromhost, sizeof(remotehname)-12);
        cp = strrchr(pwd->pw_shell, '/');
        if (cp)
                cp++;


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to