diff options
-rw-r--r-- | source3/include/includes.h | 6 | ||||
-rw-r--r-- | source3/smbd/chgpasswd.c | 14 |
2 files changed, 14 insertions, 6 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 69692e5847..d72595b6b4 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -342,6 +342,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #ifndef QSORT_CAST #define QSORT_CAST (int (*)(const void *, const void *)) #endif /* QSORT_CAST */ +#define USE_GRANTPT #endif @@ -387,16 +388,18 @@ char *getwd(char *); #include <string.h> #include <signal.h> #include <dirent.h> +#include <termios.h> #define USE_WAITPID #define NETGROUP #ifndef SYSV #define SYSV -#endif +#endif /* SYSV */ #define SIGNAL_CAST (void (*)()) #define USE_STATVFS #define USE_WAITPID #define USE_SETSID #define USE_SYSV_IPC +#define USE_GRANTPT #ifndef QSORT_CAST #define QSORT_CAST (int (*)(const void *, const void *)) #endif /* QSORT_CAST */ @@ -458,6 +461,7 @@ extern struct passwd *getpwnam(); #define USE_SETSID #define USE_SYSV_IPC #define NO_SEMUN +#define USE_GRANTPT #endif diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 204a4480e9..894762b707 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -59,22 +59,24 @@ extern int DEBUGLEVEL; static int findpty(char **slave) { int master; +#if defined(USE_GRANTPT) #if defined(SVR4) || defined(SUNOS5) extern char *ptsname(); -#else /* defined(SVR4) || defined(SUNOS5) */ +#endif /* defined(SVR4) || defined(SUNOS5) */ +#else /* USE_GRANTPT */ static fstring line; void *dirp; char *dpname; -#endif /* defined(SVR4) || defined(SUNOS5) */ +#endif /* USE_GRANTPT */ -#if defined(SVR4) || defined(SUNOS5) +#if defined(USE_GRANTPT) if ((master = open("/dev/ptmx", O_RDWR)) >= 1) { grantpt(master); unlockpt(master); *slave = ptsname(master); return (master); } -#else /* defined(SVR4) || defined(SUNOS5) */ +#else /* USE_GRANTPT */ fstrcpy( line, "/dev/ptyXX" ); dirp = OpenDir(-1, "/dev", False); @@ -94,7 +96,7 @@ static int findpty(char **slave) } } CloseDir(dirp); -#endif /* defined(SVR4) || defined(SUNOS5) */ +#endif /* USE_GRANTPT */ return (-1); } @@ -136,10 +138,12 @@ static int dochild(int master,char *slavedev, char *name, char *passwordprogram, ioctl(slave, I_PUSH, "ptem"); ioctl(slave, I_PUSH, "ldterm"); #else /* defined(SVR4) || defined(SUNOS5) || defined(SCO) */ +#if defined(TIOCSCTTY) if (ioctl(slave,TIOCSCTTY,0) <0) { DEBUG(3,("Error in ioctl call for slave pty\n")); /* return(False); */ } +#endif /* defined(TIOCSCTTY) */ #endif /* defined(SVR4) || defined(SUNOS5) || defined(SCO) */ /* Close master. */ |