From: Jeremy Allison Date: Sat, 30 May 2009 09:30:16 +0000 (+0200) Subject: Simplify the dropbox patch X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ea09b61a46136fc55314e2e1cd2e9cfb362802;p=thirdparty%2Fsamba.git Simplify the dropbox patch --- diff --git a/source/smbd/filename.c b/source/smbd/filename.c index 7ff497f5cca..5ea5cb2af52 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -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; } /*