diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-05 22:32:43 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-05 22:32:43 +0000 |
commit | 443865396b9f7b98123cb81104fa0604ec4ca202 (patch) | |
tree | afca921d4dc328040ee21f31a3a2d04e9be8d07e /source3/smbd/filename.c | |
parent | 21c4e30fccbf7207ccad28fb188839e0635290ba (diff) | |
download | samba-443865396b9f7b98123cb81104fa0604ec4ca202.tar.gz samba-443865396b9f7b98123cb81104fa0604ec4ca202.tar.bz2 samba-443865396b9f7b98123cb81104fa0604ec4ca202.zip |
Several mb tidyups - getting ready to address the XXX_sub function.
Jeremy.
(This used to be commit 13edba472a0a5eb56586458a2432d53f495d0129)
Diffstat (limited to 'source3/smbd/filename.c')
-rw-r--r-- | source3/smbd/filename.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 8300674d61..805af9c494 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -2,7 +2,7 @@ Unix SMB/CIFS implementation. filename handling routines Copyright (C) Andrew Tridgell 1992-1998 - Copyright (C) Jeremy Allison 1999-200 + Copyright (C) Jeremy Allison 1999-2004 Copyright (C) Ying Chen 2000 This program is free software; you can redistribute it and/or modify @@ -392,9 +392,10 @@ BOOL check_name(pstring name,connection_struct *conn) errno = 0; if (IS_VETO_PATH(conn, name)) { - if(strcmp(name, ".") && strcmp(name, "..")) { + /* Is it not dot or dot dot. */ + if (!((name[0] == '.') && (!name[1] || (name[1] == '.' && !name[2])))) { DEBUG(5,("file path name %s vetoed\n",name)); - return(0); + return False; } } @@ -412,7 +413,7 @@ BOOL check_name(pstring name,connection_struct *conn) if ( (SMB_VFS_LSTAT(conn,name,&statbuf) != -1) && (S_ISLNK(statbuf.st_mode)) ) { DEBUG(3,("check_name: denied: file path name %s is a symlink\n",name)); - ret=0; + ret = False; } } #endif @@ -464,8 +465,11 @@ static BOOL scan_directory(const char *path, char *name, size_t maxlength, /* now scan for matching names */ while ((dname = ReadDirName(cur_dir))) { - if (*dname == '.' && (strequal(dname,".") || strequal(dname,".."))) + + /* Is it dot or dot dot. */ + if ((dname[0] == '.') && (!dname[1] || (dname[1] == '.' && !dname[2]))) { continue; + } /* * At this point dname is the unmangled name. |