diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-02-23 05:18:09 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-02-23 05:18:09 +0000 |
commit | df42b0a7bcdaae96035ecb1d434a66735358fd95 (patch) | |
tree | a7d6b0e651b294a385b7524484beb54828bdf018 /source3/smbd | |
parent | f71717efd03611459b90b6939f53410ebbacc303 (diff) | |
download | samba-df42b0a7bcdaae96035ecb1d434a66735358fd95.tar.gz samba-df42b0a7bcdaae96035ecb1d434a66735358fd95.tar.bz2 samba-df42b0a7bcdaae96035ecb1d434a66735358fd95.zip |
Makefile: Added cleandir target.
chgpasswd.c: Added patch from Roland Haag <haag@think.de> to allow
password changes to be done more than once.
loadparm.c: Added entries for the "directory mode/directory mask parameters".
Changed default file mode to 644.
proto.h: Added sys_gethostbyname.
server.c: Added directory mode changes.
system.c: Added sys_gethostbyname.
trans2.c: Added NT_FILE_ATTRIBUTE_NORMAL patch from Roger Orr
<rorr@csfp.csfb.com>
trans2.h: Defined NT_FILE_ATTRIBUTE_NORMAL for above patch.
util.c: Changes calls to gethostbyname to sys_gethostbyname.
jra@cygnus.com
(This used to be commit d8d8a7ee00971fca7a8d079bfb547af107df35a4)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/chgpasswd.c | 8 | ||||
-rw-r--r-- | source3/smbd/server.c | 20 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 9 |
3 files changed, 23 insertions, 14 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 54b49edf13..883ad5214a 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -41,7 +41,7 @@ static int findpty(char **slave) #ifdef SVR4 extern char *ptsname(); #else - static char line[12] = "/dev/ptyXX"; + static char line[12]; void *dirp; char *dpname; #endif @@ -54,13 +54,17 @@ static int findpty(char **slave) return (master); } #else + strcpy( line, "/dev/ptyXX" ); + dirp = OpenDir("/dev"); if (!dirp) return(-1); while ((dpname = ReadDirName(dirp)) != NULL) { 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]; line[9] = dpname[4]; if ((master = open(line, O_RDWR)) >= 0) { + DEBUG(3,("pty: opened %s\n", line ) ); line[5] = 't'; *slave = line; CloseDir(dirp); @@ -280,7 +284,7 @@ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence) kill(pid, SIGKILL); /* be sure to end this process */ return(False); } - if ((wpid = waitpid(pid, &wstat, 0)) < 0) { + if ((wpid = sys_waitpid(pid, &wstat, 0)) < 0) { DEBUG(3,("The process is no longer waiting!\n\n")); return(False); } diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 4f3ee0fd0b..09c8fccb5c 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -130,19 +130,21 @@ mode_t unix_mode(int cnum,int dosmode) if ( !IS_DOS_READONLY(dosmode) ) result |= (S_IWUSR | S_IWGRP | S_IWOTH); - if (IS_DOS_DIR(dosmode)) + if (IS_DOS_DIR(dosmode)) { result |= (S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH | S_IWUSR); - - if (MAP_ARCHIVE(cnum) && IS_DOS_ARCHIVE(dosmode)) - result |= S_IXUSR; + result &= (lp_dir_mode(SNUM(cnum)) | 0700); + } else { + if (MAP_ARCHIVE(cnum) && IS_DOS_ARCHIVE(dosmode)) + result |= S_IXUSR; - if (MAP_SYSTEM(cnum) && IS_DOS_SYSTEM(dosmode)) - result |= S_IXGRP; + if (MAP_SYSTEM(cnum) && IS_DOS_SYSTEM(dosmode)) + result |= S_IXGRP; - if (MAP_HIDDEN(cnum) && IS_DOS_HIDDEN(dosmode)) - result |= S_IXOTH; + if (MAP_HIDDEN(cnum) && IS_DOS_HIDDEN(dosmode)) + result |= S_IXOTH; - result &= CREATE_MODE(cnum); + result &= CREATE_MODE(cnum); + } return(result); } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index d489978ab8..ab2fe88536 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -276,6 +276,7 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l strequal(Connections[cnum].dirpath,".") || strequal(Connections[cnum].dirpath,"/")); BOOL was_8_3; + int nt_extmode; /* Used for NT connections instead of mode */ *fname = 0; *out_of_space = False; @@ -357,6 +358,8 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l name_map_mangle(fname,False,SNUM(cnum)); + nt_extmode = mode ? mode : NT_FILE_ATTRIBUTE_NORMAL; + switch (info_level) { case 1: @@ -440,7 +443,7 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l put_long_date(p,mdate); p += 8; SIVAL(p,0,size); p += 8; SIVAL(p,0,size); p += 8; - SIVAL(p,0,mode); p += 4; + SIVAL(p,0,nt_extmode); p += 4; SIVAL(p,0,strlen(fname)); p += 4; SIVAL(p,0,0); p += 4; if (!was_8_3) { @@ -468,7 +471,7 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l put_long_date(p,mdate); p += 8; SIVAL(p,0,size); p += 8; SIVAL(p,0,size); p += 8; - SIVAL(p,0,mode); p += 4; + SIVAL(p,0,nt_extmode); p += 4; SIVAL(p,0,strlen(fname)); p += 4; strcpy(p,fname); p = pdata + len; @@ -486,7 +489,7 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l put_long_date(p,mdate); p += 8; SIVAL(p,0,size); p += 8; SIVAL(p,0,size); p += 8; - SIVAL(p,0,mode); p += 4; + SIVAL(p,0,nt_extmode); p += 4; SIVAL(p,0,strlen(fname)); p += 4; SIVAL(p,0,0); p += 4; strcpy(p,fname); |