Integrated PAM environment patch from Nalin Dahyabhai <nalin@thermo.stat.ncsu.edu>

Integrated make install patch from Niels Kristian Bech Jensen <nkbj@image.dk>
This commit is contained in:
Damien Miller 1999-10-29 09:57:31 +10:00
parent 792c5113f1
commit 9438816a5c
2 changed files with 39 additions and 9 deletions

View File

@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libdir=@libdir@
mandir=@mandir@
CC=@CC@
OPT_FLAGS=-g
@ -58,14 +59,21 @@ clean:
install:
install -d $(bindir)
install -d $(sbindir)
install -d $(libdir)
install -c bin/ssh $(bindir)/ssh
install -c bin/scp $(bindir)/scp
install -c bin/ssh-add $(bindir)/ssh-add
install -c bin/ssh-agent $(bindir)/ssh-agent
install -c bin/ssh-keygen $(bindir)/ssh-keygen
install -c bin/sshd $(sbindir)/sshd
install -c bin/libssh.a $(libdir)/libssh.a
install -d $(mandir)
install -d $(mandir)/man1
install -d $(mandir)/man8
install -s -c bin/ssh $(bindir)/ssh
install -s -c bin/scp $(bindir)/scp
install -s -c bin/ssh-add $(bindir)/ssh-add
install -s -c bin/ssh-agent $(bindir)/ssh-agent
install -s -c bin/ssh-keygen $(bindir)/ssh-keygen
install -s -c bin/sshd $(sbindir)/sshd
install -m644 -c ssh.1 $(mandir)/man1/ssh.1
install -m644 -c scp.1 $(mandir)/man1/scp.1
install -m644 -c ssh-add.1 $(mandir)/man1/ssh-add.1
install -m644 -c ssh-agent.1 $(mandir)/man1/ssh-agent.1
install -m644 -c ssh-keygen.1 $(mandir)/man1/ssh-keygen.1
install -m644 -c sshd.8 $(mandir)/man8/sshd.8
distclean: clean
rm -f Makefile config.h *~

24
sshd.c
View File

@ -18,7 +18,7 @@ agent connections.
*/
#include "includes.h"
RCSID("$Id: sshd.c,v 1.5 1999/10/28 23:18:29 damien Exp $");
RCSID("$Id: sshd.c,v 1.6 1999/10/28 23:57:31 damien Exp $");
#include "xmalloc.h"
#include "rsa.h"
@ -2328,6 +2328,28 @@ void do_child(const char *command, struct passwd *pw, const char *term,
child_set_env(&env, &envsize, "KRBTKFILE", ticket);
#endif /* KRB4 */
#ifdef HAVE_LIBPAM
/* Pull in any environment variables that may have been set by PAM. */
{
char *equal_sign, var_name[256], var_val[256];
long this_var;
char **pam_env = pam_getenvlist(pamh);
for(this_var = 0; pam_env && pam_env[this_var]; this_var++)
{
if(strlen(pam_env[this_var]) < sizeof(var_name))
if((equal_sign = strstr(pam_env[this_var], "=")) != NULL)
{
memset(var_name, 0, sizeof(var_name));
memset(var_val, 0, sizeof(var_val));
strncpy(var_name, pam_env[this_var],
equal_sign - pam_env[this_var]);
strcpy(var_val, equal_sign + 1);
child_set_env(&env, &envsize, var_name, var_val);
}
}
}
#endif /* HAVE_LIBPAM */
/* Set XAUTHORITY to always be a local file. */
if (xauthfile)
child_set_env(&env, &envsize, "XAUTHORITY", xauthfile);