diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-08-20 20:32:23 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-08-20 20:32:23 +0000 |
commit | 28b3c6db8a81b41b448a4f3cd98e9cd2c4b5fb2e (patch) | |
tree | 9134988ead2cde309e27f02b5f931b159b61e123 /source/lib/util.c | |
parent | de38a0b34fcd65fa3024300f978aa30eb86d854f (diff) | |
download | samba-28b3c6db8a81b41b448a4f3cd98e9cd2c4b5fb2e.tar.gz |
Changes to allow Samba to return the same error code as Windows NT.
Takes care of the cases where a Windows program is parsing a pathname
component by component and expects 2 different errors.
ERRbadpath - if a component in the path doesn't exist.
ERRbaddirectory - if a component in the path exists but is not a directory.
Extra error code added to smb.h to support this.
Code based on suggestions from "Christian Groessler" <chris@fast-ag.de>.
Jeremy (jallison@whistle.com)
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index ca17fbdcb46..a048c8b3a75 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -755,12 +755,17 @@ time_t file_modtime(char *fname) BOOL directory_exist(char *dname,struct stat *st) { struct stat st2; + BOOL ret; + if (!st) st = &st2; if (sys_stat(dname,st) != 0) return(False); - return(S_ISDIR(st->st_mode)); + ret = S_ISDIR(st->st_mode); + if(!ret) + errno = ENOTDIR; + return ret; } /******************************************************************* |