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:16 +0000 (11:30 +0200)
source3/smbd/filename.c

index bcd8560ad9f40574ee1b186dea6167947f1f6ce7..059dca29c8dfc3abfac337b953fd182c80401558 100644 (file)
@@ -513,8 +513,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
@@ -524,12 +530,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;
                                }
 
                                /*