summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-22 01:31:59 +0000
committerJeremy Allison <jra@samba.org>1998-07-22 01:31:59 +0000
commit781c9e50820e3bc2b11e15bbff2f16b6ad74f26a (patch)
tree1e6a57a5f794c0e0f834d4b1d1b2a9d7ba464527 /source3/smbd
parent8668f6eac1abfcc040515490e1dfc8587bd4fde6 (diff)
downloadsamba-781c9e50820e3bc2b11e15bbff2f16b6ad74f26a.tar.gz
samba-781c9e50820e3bc2b11e15bbff2f16b6ad74f26a.tar.bz2
samba-781c9e50820e3bc2b11e15bbff2f16b6ad74f26a.zip
includes.h: Added feature type USE_GRANTPT for pty code.
chgpasswd.c: Updated to use USE_GRANTPT feature definition. Jeremy. (This used to be commit 953c5dbbae8c1370e5988619746b508f26cb0390)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/chgpasswd.c14
1 files changed, 9 insertions, 5 deletions
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. */