diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | auth-pam.c | 5 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | pty.c | 21 | ||||
-rw-r--r-- | ssh-agent.c | 4 | ||||
-rw-r--r-- | ssh.h | 6 |
6 files changed, 34 insertions, 8 deletions
@@ -7,6 +7,10 @@ | |||
7 | [session.c] | 7 | [session.c] |
8 | - remove bogus chan_read_failed. this could cause data | 8 | - remove bogus chan_read_failed. this could cause data |
9 | corruption (missing data) at end of a SSH2 session. | 9 | corruption (missing data) at end of a SSH2 session. |
10 | - Merge fixes from Debian patch from Phil Hands <phil@hands.com> | ||
11 | - Allow setting of PAM service name through CFLAGS (SSHD_PAM_SERVICE) | ||
12 | - Use vhangup to clean up Linux ttys | ||
13 | - Force posix getopt processing on GNU libc systems | ||
10 | 14 | ||
11 | 20000419 | 15 | 20000419 |
12 | - OpenBSD CVS updates | 16 | - OpenBSD CVS updates |
diff --git a/auth-pam.c b/auth-pam.c index f6458949e..e1e24854f 100644 --- a/auth-pam.c +++ b/auth-pam.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include "xmalloc.h" | 13 | #include "xmalloc.h" |
14 | #include "servconf.h" | 14 | #include "servconf.h" |
15 | 15 | ||
16 | RCSID("$Id: auth-pam.c,v 1.2 2000/01/26 23:55:38 damien Exp $"); | 16 | RCSID("$Id: auth-pam.c,v 1.3 2000/04/20 13:12:58 damien Exp $"); |
17 | 17 | ||
18 | /* Callbacks */ | 18 | /* Callbacks */ |
19 | static int pamconv(int num_msg, const struct pam_message **msg, | 19 | static int pamconv(int num_msg, const struct pam_message **msg, |
@@ -215,7 +215,8 @@ void start_pam(struct passwd *pw) | |||
215 | 215 | ||
216 | debug("Starting up PAM with username \"%.200s\"", pw->pw_name); | 216 | debug("Starting up PAM with username \"%.200s\"", pw->pw_name); |
217 | 217 | ||
218 | pam_retval = pam_start("sshd", pw->pw_name, &conv, (pam_handle_t**)&pamh); | 218 | pam_retval = pam_start(SSHD_PAM_SERVICE, pw->pw_name, &conv, |
219 | (pam_handle_t**)&pamh); | ||
219 | if (pam_retval != PAM_SUCCESS) | 220 | if (pam_retval != PAM_SUCCESS) |
220 | fatal("PAM initialisation failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval)); | 221 | fatal("PAM initialisation failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval)); |
221 | 222 | ||
diff --git a/configure.in b/configure.in index b676193d3..596c4e09f 100644 --- a/configure.in +++ b/configure.in | |||
@@ -110,7 +110,7 @@ fi | |||
110 | AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) | 110 | AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) |
111 | 111 | ||
112 | # Checks for library functions. | 112 | # Checks for library functions. |
113 | AC_CHECK_FUNCS(arc4random bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty) | 113 | AC_CHECK_FUNCS(arc4random bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf vhangup _getpty) |
114 | 114 | ||
115 | AC_CHECK_FUNC(login, | 115 | AC_CHECK_FUNC(login, |
116 | [AC_DEFINE(HAVE_LOGIN)], | 116 | [AC_DEFINE(HAVE_LOGIN)], |
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: pty.c,v 1.18 2000/04/16 01:18:44 damien Exp $"); | 17 | RCSID("$Id: pty.c,v 1.19 2000/04/20 13:12:59 damien Exp $"); |
18 | 18 | ||
19 | #ifdef HAVE_UTIL_H | 19 | #ifdef HAVE_UTIL_H |
20 | # include <util.h> | 20 | # include <util.h> |
@@ -201,6 +201,9 @@ void | |||
201 | pty_make_controlling_tty(int *ttyfd, const char *ttyname) | 201 | pty_make_controlling_tty(int *ttyfd, const char *ttyname) |
202 | { | 202 | { |
203 | int fd; | 203 | int fd; |
204 | #ifdef HAVE_VHANGUP | ||
205 | void *old; | ||
206 | #endif /* HAVE_VHANGUP */ | ||
204 | 207 | ||
205 | /* First disconnect from the old controlling tty. */ | 208 | /* First disconnect from the old controlling tty. */ |
206 | #ifdef TIOCNOTTY | 209 | #ifdef TIOCNOTTY |
@@ -232,12 +235,22 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) | |||
232 | */ | 235 | */ |
233 | ioctl(*ttyfd, TIOCSCTTY, NULL); | 236 | ioctl(*ttyfd, TIOCSCTTY, NULL); |
234 | #endif /* TIOCSCTTY */ | 237 | #endif /* TIOCSCTTY */ |
238 | #ifdef HAVE_VHANGUP | ||
239 | old = signal(SIGHUP, SIG_IGN); | ||
240 | vhangup(); | ||
241 | signal(SIGHUP, old); | ||
242 | #endif /* HAVE_VHANGUP */ | ||
235 | fd = open(ttyname, O_RDWR); | 243 | fd = open(ttyname, O_RDWR); |
236 | if (fd < 0) | 244 | if (fd < 0) { |
237 | error("%.100s: %.100s", ttyname, strerror(errno)); | 245 | error("%.100s: %.100s", ttyname, strerror(errno)); |
238 | else | 246 | } else { |
247 | #ifdef HAVE_VHANGUP | ||
248 | close(*ttyfd); | ||
249 | *ttyfd = fd; | ||
250 | #else /* HAVE_VHANGUP */ | ||
239 | close(fd); | 251 | close(fd); |
240 | 252 | #endif /* HAVE_VHANGUP */ | |
253 | } | ||
241 | /* Verify that we now have a controlling tty. */ | 254 | /* Verify that we now have a controlling tty. */ |
242 | fd = open("/dev/tty", O_WRONLY); | 255 | fd = open("/dev/tty", O_WRONLY); |
243 | if (fd < 0) | 256 | if (fd < 0) |
diff --git a/ssh-agent.c b/ssh-agent.c index 5a265e6b8..c9a84a4a0 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -511,7 +511,11 @@ main(int ac, char **av) | |||
511 | __progname); | 511 | __progname); |
512 | exit(1); | 512 | exit(1); |
513 | } | 513 | } |
514 | #ifdef __GNU_LIBRARY__ | ||
515 | while ((ch = getopt(ac, av, "+cks")) != -1) { | ||
516 | #else /* __GNU_LIBRARY__ */ | ||
514 | while ((ch = getopt(ac, av, "cks")) != -1) { | 517 | while ((ch = getopt(ac, av, "cks")) != -1) { |
518 | #endif /* __GNU_LIBRARY__ */ | ||
515 | switch (ch) { | 519 | switch (ch) { |
516 | case 'c': | 520 | case 'c': |
517 | if (s_flag) | 521 | if (s_flag) |
@@ -13,7 +13,7 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* RCSID("$Id: ssh.h,v 1.33 2000/04/19 21:42:22 damien Exp $"); */ | 16 | /* RCSID("$Id: ssh.h,v 1.34 2000/04/20 13:12:59 damien Exp $"); */ |
17 | 17 | ||
18 | #ifndef SSH_H | 18 | #ifndef SSH_H |
19 | #define SSH_H | 19 | #define SSH_H |
@@ -71,6 +71,10 @@ | |||
71 | */ | 71 | */ |
72 | #define SSH_SERVICE_NAME "ssh" | 72 | #define SSH_SERVICE_NAME "ssh" |
73 | 73 | ||
74 | #if defined(USE_PAM) && !defined(SSHD_PAM_SERVICE) | ||
75 | # define SSHD_PAM_SERVICE "sshd" | ||
76 | #endif | ||
77 | |||
74 | #ifndef ETCDIR | 78 | #ifndef ETCDIR |
75 | #define ETCDIR "/etc" | 79 | #define ETCDIR "/etc" |
76 | #endif /* ETCDIR */ | 80 | #endif /* ETCDIR */ |