r20618: Fix a bug in bad_path handling that also exists in 3.0.23: For reply_unlink
authorVolker Lendecke <vlendec@samba.org>
Mon, 8 Jan 2007 21:08:31 +0000 (21:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:16:59 +0000 (12:16 -0500)
under Linux we returned NT_STATUS_NOT_A_DIRECTORY. This is because in the
bad_path==True condition lstat(2) returns ENOTDIR and not ENOENT.

Not sure if we want to necessarily replicate the INVALID_PARAMETER here, but
this is what W2k3 does.

Jeremy, I tried to call you, but you were not around. So I'll leave it up to
you to merge this.

Volker
(This used to be commit b1edc3d053104204b966eed67d070ad5da40f17b)

source3/smbd/reply.c

index cc181223f22c415633a3455e8f83bbafa139cb1d..b3ee18befe752f287e0ede4309242d18ccbd837f 100644 (file)
@@ -1995,6 +1995,11 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
        *directory = *mask = 0;
        
        rc = unix_convert(name,conn,0,&bad_path,&sbuf);
+       if (bad_path) {
+               return has_wild
+                       ? NT_STATUS_INVALID_PARAMETER
+                       : NT_STATUS_OBJECT_PATH_NOT_FOUND;
+       }
 
        /*
         * Feel my pain, this code needs rewriting *very* badly! -- vl