Fix bug #5121 (unix passwd sync not working on a streams based
authorJeremy Allison <jra@samba.org>
Mon, 17 Dec 2007 18:44:09 +0000 (10:44 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 17 Dec 2007 18:44:09 +0000 (10:44 -0800)
system).
Jeremy.

source/lib/replace/libreplace.m4
source/lib/replace/system/network.h
source/smbd/chgpasswd.c

index c10a4b23817c8e2c2474a62eaa9254eaa1025f00..7a5283a4d60c1ba773437572f1844ca3ef869644 100644 (file)
@@ -100,6 +100,7 @@ AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
 AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
 AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
 AC_CHECK_HEADERS(sys/mount.h mntent.h)
+AC_CHECK_HEADERS(stropts.h)
 
 dnl we need to check that net/if.h really can be used, to cope with hpux
 dnl where including it always fails
index d3ae2bf398ff1427e7ddcd38a98ffd565ffc028c..9087c02da18f58f5f398c6e90a0bd204dd4b188e 100644 (file)
 #include <sys/ioctl.h>
 #endif
 
+#ifdef HAVE_STROPTS_H
+#include <stropts.h>
+#endif
+
 #ifdef REPLACE_INET_NTOA
 /* define is in "replace.h" */
 char *rep_inet_ntoa(struct in_addr ip);
index 5ccf3ed9dace5ae7872741e67eddd091a8264775..e478122e9b701a518419e8a60705f42e1098c1f3 100644 (file)
@@ -159,19 +159,19 @@ static int dochild(int master, const char *slavedev, const struct passwd *pass,
                DEBUG(3, ("More weirdness, could not open %s\n", slavedev));
                return (False);
        }
-#if defined(I_PUSH) && defined(I_FIND)
+#if defined(TIOCSCTTY)
+       if (ioctl(slave, TIOCSCTTY, 0) < 0)
+       {
+               DEBUG(3, ("Error in ioctl call for slave pty\n"));
+               /* return(False); */
+       }
+#elif defined(I_PUSH) && defined(I_FIND)
        if (ioctl(slave, I_FIND, "ptem") == 0) {
                ioctl(slave, I_PUSH, "ptem");
        }
        if (ioctl(slave, I_FIND, "ldterm") == 0) {
                ioctl(slave, I_PUSH, "ldterm");
        }
-#elif defined(TIOCSCTTY)
-       if (ioctl(slave, TIOCSCTTY, 0) < 0)
-       {
-               DEBUG(3, ("Error in ioctl call for slave pty\n"));
-               /* return(False); */
-       }
 #endif
 
        /* Close master. */