Simplify the dropbox patch
authorJeremy Allison <jra@samba.org>
Sat, 30 May 2009 09:30:16 +0000 (11:30 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 30 May 2009 09:30:23 +0000 (11:30 +0200)
source3/smbd/filename.c

index dcee5a76cfd6d9960911ee9dadc3a476764888b0..e3acfc8483fa24573dbd839e5f4e742b0cc5c994 100644 (file)
@@ -490,8 +490,14 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                                        goto fail;
                                }
 
-                               /* ENOENT is the only valid error here. */
-                               if ((errno != 0) && (errno != ENOENT)) {
+                               /*
+                                * ENOENT/EACCESS are the only valid errors
+                                * here. EACCESS needs handling here for
+                                * "dropboxes", i.e. directories where users
+                                * can only put stuff with permission -wx.
+                                */
+                               if ((errno != 0) && (errno != ENOENT)
+                                   && (errno != EACCES)) {
                                        /*
                                         * ENOTDIR and ELOOP both map to
                                         * NT_STATUS_OBJECT_PATH_NOT_FOUND
@@ -501,12 +507,11 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                                                        errno == ELOOP) {
                                                result =
                                                NT_STATUS_OBJECT_PATH_NOT_FOUND;
-                                               goto fail;
-                                       } else if (errno != EACCES) {
+                                       } else {
                                                result =
                                                map_nt_error_from_unix(errno);
-                                               goto fail;
                                        }
+                                       goto fail;
                                }
 
                                /*