From owner-freebsd-current Tue Sep 7 13:11: 1 1999 Delivered-To: freebsd-current@freebsd.org Received: from lamb.sas.com (lamb.sas.com [192.35.83.8]) by hub.freebsd.org (Postfix) with ESMTP id 78A6A15636 for ; Tue, 7 Sep 1999 13:10:55 -0700 (PDT) (envelope-from jwd@unx.sas.com) Received: from mozart (mozart.unx.sas.com [192.58.184.8]) by lamb.sas.com (8.9.3/8.9.1) with SMTP id QAA07197 for ; Tue, 7 Sep 1999 16:09:53 -0400 (EDT) Received: from bb01f39.unx.sas.com by mozart (5.65c/SAS/Domains/5-6-90) id AA05439; Tue, 7 Sep 1999 16:09:23 -0400 Received: (from jwd@localhost) by bb01f39.unx.sas.com (8.9.1/8.9.1) id QAA58806 for freebsd-current@freebsd.org; Tue, 7 Sep 1999 16:09:23 -0400 (EDT) (envelope-from jwd) From: "John W. DeBoskey" Message-Id: <199909072009.QAA58806@bb01f39.unx.sas.com> Subject: rshd patch for REMOTEUSER & REMOTEHOST To: freebsd-current@freebsd.org Date: Tue, 7 Sep 1999 16:09:23 -0400 (EDT) X-Mailer: ELM [version 2.4ME+ PL43 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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