Date: Tue, 7 Sep 1999 16:09:23 -0400 (EDT) From: "John W. DeBoskey" <jwd@unx.sas.com> To: freebsd-current@freebsd.org Subject: rshd patch for REMOTEUSER & REMOTEHOST Message-ID: <199909072009.QAA58806@bb01f39.unx.sas.com>
next in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909072009.QAA58806>