From 6aa63bd761241c8b80808651fc570b2d941ee135 Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Wed, 2 Jun 1999 04:11:50 +0000 Subject: Fixing core dump bug with unix password sync, caused by a NULL connection_struct in a call to OpenDir. JF, you fixed a similar bug in printing/nt_printing.c, I think your fix is incorrect as global configuration files should not go through a VFS. (This used to be commit 0e0c310a3ea102c61e74b604bcc793a82554a828) --- source3/smbd/chgpasswd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index c22f268684..734f72c08d 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -60,7 +60,8 @@ static int findpty(char **slave) int master; #ifndef HAVE_GRANTPT static fstring line; - void *dirp; + DIR *dirp; + struct dirent *dentry; char *dpname; #endif /* !HAVE_GRANTPT */ @@ -82,10 +83,11 @@ static int findpty(char **slave) #else /* HAVE_GRANTPT */ fstrcpy( line, "/dev/ptyXX" ); - dirp = OpenDir(NULL, "/dev", False); + dirp = opendir("/dev"); if (!dirp) return(-1); - while ((dpname = ReadDirName(dirp)) != NULL) { + while ((dentry = readdir(dirp)) != NULL) { + dpname = dentry->d_name; if (strncmp(dpname, "pty", 3) == 0 && strlen(dpname) == 5) { DEBUG(3,("pty: try to open %s, line was %s\n", dpname, line ) ); line[8] = dpname[3]; @@ -94,12 +96,12 @@ static int findpty(char **slave) DEBUG(3,("pty: opened %s\n", line ) ); line[5] = 't'; *slave = line; - CloseDir(dirp); + closedir(dirp); return (master); } } } - CloseDir(dirp); + closedir(dirp); #endif /* HAVE_GRANTPT */ return (-1); } -- cgit