diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-06-05 15:16:09 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-06-05 15:16:09 +0000 |
commit | e38afbf38210b8cf30c5b13dc5ea96a6dda433f7 (patch) | |
tree | 06281d362a0c4d1cb96713613b2f541c0dea491e /source3/smbd | |
parent | 526cc39e432682afe57a1eb2607e1a3f261f4e8f (diff) | |
download | samba-e38afbf38210b8cf30c5b13dc5ea96a6dda433f7.tar.gz samba-e38afbf38210b8cf30c5b13dc5ea96a6dda433f7.tar.bz2 samba-e38afbf38210b8cf30c5b13dc5ea96a6dda433f7.zip |
- changed some debug levels in clientutil.c
- added dir_check_ftype() to clean up the file type checking a bit
- added check for libc version >= 5 for setfsuid() for Linux
- moved the AM_MASTER() and related macros to nameserv.h
- added proper defines for the various netbios announce types
- don't call the announce_backup() code, as I'm pretty sure its wrong
it sent ANN_GetBackupListReq packets as broadcasts, they are supposed
to be used only by clients to the master browser to find a list of
available backup servers to remote a netserverenum to, I don't think
nmbd should ever send one.
- fixed a bug in the browse list writing
- minor debug cleanups
- put in the code to discard our own broadcasts (it won't work for
multi-homed hosts though)
- changed ELECTION_VERSION to 1 so we can be beaten by a NT 3.51 server by
lowering the os level.
- only do sync_browse_lists() if we are the master browser, otherwise
we'll cause network overload
- don't call tell_become_backup() as it appears to be badly broken, it
should only be used when the machine being told has its MAINTAIN_LIST
to to auto. Not calling it does no great harm anyway
- fix a nasty bug where becomebackup was confused with reset browser!
- make setbuffer() not get caught by the auto protototypes
(This used to be commit cfbad9b08242962f41595273de08a7293fe432b1)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/dir.c | 20 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 10 |
2 files changed, 20 insertions, 10 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 214b28dad0..32f2eb5e7d 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -412,6 +412,16 @@ void *dptr_fetch_lanman2(char *params,int dptr_num) } /**************************************************************************** +check a filetype for being valid +****************************************************************************/ +BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype) +{ + if (((mode & ~dirtype) & (aHIDDEN | aSYSTEM | aDIR)) != 0) + return False; + return True; +} + +/**************************************************************************** get a directory entry ****************************************************************************/ BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend) @@ -474,11 +484,11 @@ BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mo *mode = dos_mode(cnum,pathreal,&sbuf); - if (((*mode & ~dirtype) & (aHIDDEN | aSYSTEM | aDIR)) != 0) - { - DEBUG(5,("[%s] attribs didn't match %x\n",filename,dirtype)); - continue; - } + if (!dir_check_ftype(cnum,*mode,&sbuf,dirtype)) { + DEBUG(5,("[%s] attribs didn't match %x\n",filename,dirtype)); + continue; + } + *size = sbuf.st_size; *date = sbuf.st_mtime; diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 36dd5eba3e..60e9ae2b29 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -325,11 +325,11 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l mode = dos_mode(cnum,pathreal,&sbuf); - if (((mode & ~dirtype) & (aHIDDEN | aSYSTEM | aDIR)) != 0) - { - DEBUG(5,("[%s] attribs didn't match %x\n",fname,dirtype)); - continue; - } + if (!dir_check_ftype(cnum,mode,&sbuf,dirtype)) { + DEBUG(5,("[%s] attribs didn't match %x\n",fname,dirtype)); + continue; + } + size = sbuf.st_size; mdate = sbuf.st_mtime; adate = sbuf.st_atime; |