]> andersk Git - openssh.git/commitdiff
- Merge fixes from Debian patch from Phil Hands <phil@hands.com>
authordamien <damien>
Thu, 20 Apr 2000 13:12:58 +0000 (13:12 +0000)
committerdamien <damien>
Thu, 20 Apr 2000 13:12:58 +0000 (13:12 +0000)
  - Allow setting of PAM service name through CFLAGS (SSHD_PAM_SERVICE)
  - Use vhangup to clean up Linux ttys
  - Force posix getopt processing on GNU libc systems

ChangeLog
auth-pam.c
configure.in
pty.c
ssh-agent.c
ssh.h

index 168e583b4a07934501a0e982d0ea7c1ca1a82646..192ca2c7be64959a4a18e3c7349a03a0261d3166 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
   [session.c]
   - remove bogus chan_read_failed. this could cause data
     corruption (missing data) at end of a SSH2 session.
+ - Merge fixes from Debian patch from Phil Hands <phil@hands.com>
+  - Allow setting of PAM service name through CFLAGS (SSHD_PAM_SERVICE)
+  - Use vhangup to clean up Linux ttys
+  - Force posix getopt processing on GNU libc systems
 
 20000419
  - OpenBSD CVS updates
index 17e8d882f82b9503ab530f13cb60fda89f5032d9..d712009c059c0bd8a18efe44e1b0552d3835805e 100644 (file)
@@ -215,7 +215,8 @@ void start_pam(struct passwd *pw)
 
        debug("Starting up PAM with username \"%.200s\"", pw->pw_name);
 
-       pam_retval = pam_start("sshd", pw->pw_name, &conv, (pam_handle_t**)&pamh);
+       pam_retval = pam_start(SSHD_PAM_SERVICE, pw->pw_name, &conv, 
+               (pam_handle_t**)&pamh);
        if (pam_retval != PAM_SUCCESS)
                fatal("PAM initialisation failed: %.200s", PAM_STRERROR((pam_handle_t *)pamh, pam_retval));
 
index b676193d3dd575e6b3213af06014642f1a60c9d9..596c4e09fa9d34174247c1609da504cd260bdcc2 100644 (file)
@@ -110,7 +110,7 @@ fi
 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)
 
 # Checks for library functions.
-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)
+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)
 
 AC_CHECK_FUNC(login, 
        [AC_DEFINE(HAVE_LOGIN)],
diff --git a/pty.c b/pty.c
index bffac4e539cd8f9bbb216e36763e58931afc9341..acdbb806d5e1e7bb26848843e7dd785a4a985b62 100644 (file)
--- a/pty.c
+++ b/pty.c
@@ -201,6 +201,9 @@ void
 pty_make_controlling_tty(int *ttyfd, const char *ttyname)
 {
        int fd;
+#ifdef HAVE_VHANGUP
+       void *old;
+#endif /* HAVE_VHANGUP */
 
        /* First disconnect from the old controlling tty. */
 #ifdef TIOCNOTTY
@@ -232,12 +235,22 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
         */
        ioctl(*ttyfd, TIOCSCTTY, NULL);
 #endif /* TIOCSCTTY */
+#ifdef HAVE_VHANGUP
+       old = signal(SIGHUP, SIG_IGN);
+       vhangup();
+       signal(SIGHUP, old);
+#endif /* HAVE_VHANGUP */
        fd = open(ttyname, O_RDWR);
-       if (fd < 0)
+       if (fd < 0) {
                error("%.100s: %.100s", ttyname, strerror(errno));
-       else
+       } else {
+#ifdef HAVE_VHANGUP
+               close(*ttyfd);
+               *ttyfd = fd;
+#else /* HAVE_VHANGUP */
                close(fd);
-
+#endif /* HAVE_VHANGUP */
+       }
        /* Verify that we now have a controlling tty. */
        fd = open("/dev/tty", O_WRONLY);
        if (fd < 0)
index 5a265e6b82062a3e634ef6e42c8a95fc0a5ef8cb..c9a84a4a02d1c69f64453e490b9fa5715add80b9 100644 (file)
@@ -511,7 +511,11 @@ main(int ac, char **av)
                        __progname);
                exit(1);
        }
+#ifdef __GNU_LIBRARY__
+       while ((ch = getopt(ac, av, "+cks")) != -1) {
+#else /* __GNU_LIBRARY__ */
        while ((ch = getopt(ac, av, "cks")) != -1) {
+#endif /* __GNU_LIBRARY__ */
                switch (ch) {
                case 'c':
                        if (s_flag)
diff --git a/ssh.h b/ssh.h
index f79c119f06900a0c77c0199029dc3cb4357aa4c5..4d1b26dfc99076f9e62531628f415a03112ae060 100644 (file)
--- a/ssh.h
+++ b/ssh.h
  */
 #define SSH_SERVICE_NAME       "ssh"
 
+#if defined(USE_PAM) && !defined(SSHD_PAM_SERVICE)
+# define SSHD_PAM_SERVICE       "sshd"
+#endif
+
 #ifndef ETCDIR
 #define ETCDIR                 "/etc"
 #endif /* ETCDIR */
This page took 0.158078 seconds and 5 git commands to generate.