Simplify the dropbox patch
authorJeremy Allison <jra@samba.org>
Sat, 30 May 2009 09:30:16 +0000 (11:30 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 10 Jun 2009 14:17:57 +0000 (16:17 +0200)
(cherry picked from commit f9ea09b61a46136fc55314e2e1cd2e9cfb362802)

source/smbd/filename.c

index 7ff497f5cca5beadf69c426647c711f98ff7b5cc..5ea5cb2af52e4443f415b53b109f6334db257b11 100644 (file)
@@ -497,8 +497,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
@@ -508,12 +514,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;
                                }
 
                                /*