From df35fb074527d030a8758880b6c0f9960f4df205 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 Aug 2003 04:52:11 +0000 Subject: Fix another error code return against Samba4 test suite... Don't allow a path above root. Jeremy. (This used to be commit 9bc0e4fe04c4134add428c889d316bd5ee4fb6e9) --- source3/smbd/reply.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit