37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
diff -up netkit-rsh-0.17/rshd/rshd.c.pam_env netkit-rsh-0.17/rshd/rshd.c
|
|
--- netkit-rsh-0.17/rshd/rshd.c.pam_env 2009-03-30 13:20:36.730136943 +0200
|
|
+++ netkit-rsh-0.17/rshd/rshd.c 2009-03-30 13:26:17.202136832 +0200
|
|
@@ -107,6 +107,9 @@ char remotehost[50] = "REMOTEHOST=";
|
|
char *envinit[] =
|
|
{homedir, shell, path, username, remoteuser, remotehost, 0};
|
|
extern char **environ;
|
|
+#ifdef USE_PAM
|
|
+static char** env;
|
|
+#endif
|
|
|
|
static void error(const char *fmt, ...);
|
|
static void doit(struct sockaddr_storage *fromp, socklen_t fromlen);
|
|
@@ -371,6 +374,9 @@ doit(struct sockaddr_storage *fromp, soc
|
|
const char *hostname;
|
|
u_short port;
|
|
int pv[2], pid, ifd;
|
|
+#ifdef USE_PAM
|
|
+ int i;
|
|
+#endif
|
|
|
|
signal(SIGINT, SIG_DFL);
|
|
signal(SIGQUIT, SIG_DFL);
|
|
@@ -518,6 +524,12 @@ doit(struct sockaddr_storage *fromp, soc
|
|
shellname = strrchr(theshell, '/');
|
|
if (shellname) shellname++;
|
|
else shellname = theshell;
|
|
+#ifdef USE_PAM
|
|
+ env = pam_getenvlist(pamh);
|
|
+ if (NULL != env)
|
|
+ for(i = 0; env[i]; i++)
|
|
+ putenv(env[i]);
|
|
+#endif
|
|
|
|
endpwent();
|
|
if (paranoid) {
|