summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-12 04:52:11 +0000
committerJeremy Allison <jra@samba.org>2003-08-12 04:52:11 +0000
commitdf35fb074527d030a8758880b6c0f9960f4df205 (patch)
treeac8911dfb388f209205860e6f765b73f4ecddccb /source3/smbd
parent7bc6f49fe425072a20274581b734ec12638a27a9 (diff)
downloadsamba-df35fb074527d030a8758880b6c0f9960f4df205.tar.gz
samba-df35fb074527d030a8758880b6c0f9960f4df205.tar.bz2
samba-df35fb074527d030a8758880b6c0f9960f4df205.zip
Fix another error code return against Samba4 test suite... Don't allow
a path above root. Jeremy. (This used to be commit 9bc0e4fe04c4134add428c889d316bd5ee4fb6e9)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 869123a1fe..4ea1792885 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1218,6 +1218,10 @@ static NTSTATUS can_delete(char *fname,connection_struct *conn, int dirtype)
if (!CAN_WRITE(conn))
return NT_STATUS_MEDIA_WRITE_PROTECTED;
+ /* Can't delete the root. */
+ if (strequal(fname, "./..") || strequal(fname, "./../"))
+ return NT_STATUS_OBJECT_PATH_SYNTAX_BAD;
+
if (SMB_VFS_LSTAT(conn,fname,&sbuf) != 0)
return NT_STATUS_OBJECT_NAME_NOT_FOUND;