diff options
author | Damien Miller <djm@mindrot.org> | 1999-10-29 09:57:31 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-10-29 09:57:31 +1000 |
commit | 9438816a5c561fe74a61773aee386cd1deb05ad2 (patch) | |
tree | 090d9895f43a5e550f3c0351391846b65f23112a | |
parent | 792c5113f1ba364680d294806ac0972b3deaceec (diff) |
Integrated PAM environment patch from Nalin Dahyabhai <nalin@thermo.stat.ncsu.edu>
Integrated make install patch from Niels Kristian Bech Jensen <nkbj@image.dk>
-rw-r--r-- | Makefile.in | 24 | ||||
-rw-r--r-- | sshd.c | 24 |
2 files changed, 39 insertions, 9 deletions
diff --git a/Makefile.in b/Makefile.in index 16bb16da9..436bc2ea1 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@ | |||
3 | bindir=@bindir@ | 3 | bindir=@bindir@ |
4 | sbindir=@sbindir@ | 4 | sbindir=@sbindir@ |
5 | libdir=@libdir@ | 5 | libdir=@libdir@ |
6 | mandir=@mandir@ | ||
6 | 7 | ||
7 | CC=@CC@ | 8 | CC=@CC@ |
8 | OPT_FLAGS=-g | 9 | OPT_FLAGS=-g |
@@ -58,14 +59,21 @@ clean: | |||
58 | install: | 59 | install: |
59 | install -d $(bindir) | 60 | install -d $(bindir) |
60 | install -d $(sbindir) | 61 | install -d $(sbindir) |
61 | install -d $(libdir) | 62 | install -d $(mandir) |
62 | install -c bin/ssh $(bindir)/ssh | 63 | install -d $(mandir)/man1 |
63 | install -c bin/scp $(bindir)/scp | 64 | install -d $(mandir)/man8 |
64 | install -c bin/ssh-add $(bindir)/ssh-add | 65 | install -s -c bin/ssh $(bindir)/ssh |
65 | install -c bin/ssh-agent $(bindir)/ssh-agent | 66 | install -s -c bin/scp $(bindir)/scp |
66 | install -c bin/ssh-keygen $(bindir)/ssh-keygen | 67 | install -s -c bin/ssh-add $(bindir)/ssh-add |
67 | install -c bin/sshd $(sbindir)/sshd | 68 | install -s -c bin/ssh-agent $(bindir)/ssh-agent |
68 | install -c bin/libssh.a $(libdir)/libssh.a | 69 | install -s -c bin/ssh-keygen $(bindir)/ssh-keygen |
70 | install -s -c bin/sshd $(sbindir)/sshd | ||
71 | install -m644 -c ssh.1 $(mandir)/man1/ssh.1 | ||
72 | install -m644 -c scp.1 $(mandir)/man1/scp.1 | ||
73 | install -m644 -c ssh-add.1 $(mandir)/man1/ssh-add.1 | ||
74 | install -m644 -c ssh-agent.1 $(mandir)/man1/ssh-agent.1 | ||
75 | install -m644 -c ssh-keygen.1 $(mandir)/man1/ssh-keygen.1 | ||
76 | install -m644 -c sshd.8 $(mandir)/man8/sshd.8 | ||
69 | 77 | ||
70 | distclean: clean | 78 | distclean: clean |
71 | rm -f Makefile config.h *~ | 79 | rm -f Makefile config.h *~ |
@@ -18,7 +18,7 @@ agent connections. | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "includes.h" | 20 | #include "includes.h" |
21 | RCSID("$Id: sshd.c,v 1.5 1999/10/28 23:18:29 damien Exp $"); | 21 | RCSID("$Id: sshd.c,v 1.6 1999/10/28 23:57:31 damien Exp $"); |
22 | 22 | ||
23 | #include "xmalloc.h" | 23 | #include "xmalloc.h" |
24 | #include "rsa.h" | 24 | #include "rsa.h" |
@@ -2328,6 +2328,28 @@ void do_child(const char *command, struct passwd *pw, const char *term, | |||
2328 | child_set_env(&env, &envsize, "KRBTKFILE", ticket); | 2328 | child_set_env(&env, &envsize, "KRBTKFILE", ticket); |
2329 | #endif /* KRB4 */ | 2329 | #endif /* KRB4 */ |
2330 | 2330 | ||
2331 | #ifdef HAVE_LIBPAM | ||
2332 | /* Pull in any environment variables that may have been set by PAM. */ | ||
2333 | { | ||
2334 | char *equal_sign, var_name[256], var_val[256]; | ||
2335 | long this_var; | ||
2336 | char **pam_env = pam_getenvlist(pamh); | ||
2337 | for(this_var = 0; pam_env && pam_env[this_var]; this_var++) | ||
2338 | { | ||
2339 | if(strlen(pam_env[this_var]) < sizeof(var_name)) | ||
2340 | if((equal_sign = strstr(pam_env[this_var], "=")) != NULL) | ||
2341 | { | ||
2342 | memset(var_name, 0, sizeof(var_name)); | ||
2343 | memset(var_val, 0, sizeof(var_val)); | ||
2344 | strncpy(var_name, pam_env[this_var], | ||
2345 | equal_sign - pam_env[this_var]); | ||
2346 | strcpy(var_val, equal_sign + 1); | ||
2347 | child_set_env(&env, &envsize, var_name, var_val); | ||
2348 | } | ||
2349 | } | ||
2350 | } | ||
2351 | #endif /* HAVE_LIBPAM */ | ||
2352 | |||
2331 | /* Set XAUTHORITY to always be a local file. */ | 2353 | /* Set XAUTHORITY to always be a local file. */ |
2332 | if (xauthfile) | 2354 | if (xauthfile) |
2333 | child_set_env(&env, &envsize, "XAUTHORITY", xauthfile); | 2355 | child_set_env(&env, &envsize, "XAUTHORITY", xauthfile); |