The branch, master has been updated
       via  f98d10a smbd: Always use UCF_PREP_CREATEFILE for filename_convert 
calls to resolve a path for open.
       via  874318a smbd: change flag name from UCF_CREATING_FILE to 
UCF_PREP_CREATEFILE
       via  5b49fe2 smbd: Fix regression for the dropbox case.
      from  967f9bd s3-winbindd: Fix DEBUG statement in winbind_msg_offline().

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f98d10af2a05f0261611f4cabdfe274cd9fe91c0
Author: Jeremy Allison <[email protected]>
Date:   Tue Dec 3 10:21:16 2013 -0800

    smbd: Always use UCF_PREP_CREATEFILE for filename_convert calls to resolve 
a path for open.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Mon Dec  9 21:02:21 CET 2013 on sn-devel-104

commit 874318a97868e08837a1febb1be8e8a167b5ae0f
Author: Jeremy Allison <[email protected]>
Date:   Tue Dec 3 10:19:09 2013 -0800

    smbd: change flag name from UCF_CREATING_FILE to UCF_PREP_CREATEFILE
    
    In preparation to using it for all open calls.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>

commit 5b49fe24c906cbae12beff7a1b45de6809258cab
Author: Volker Lendecke <[email protected]>
Date:   Tue Dec 3 13:20:17 2013 +0100

    smbd: Fix regression for the dropbox case.
    
    We need to allow to save a file to a directory with perm -wx.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/filename.c    |   10 +++++-----
 source3/smbd/nttrans.c     |    6 ++----
 source3/smbd/reply.c       |   12 +++++-------
 source3/smbd/smb2_create.c |    3 +--
 source3/smbd/smbd.h        |    2 +-
 5 files changed, 14 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 68321ee..eaec5b6 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -722,7 +722,10 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                                 */
 
                                if (errno == EACCES) {
-                                       if (ucf_flags & UCF_CREATING_FILE) {
+                                       if ((ucf_flags & UCF_PREP_CREATEFILE) 
== 0) {
+                                               status = 
NT_STATUS_ACCESS_DENIED;
+                                               goto fail;
+                                       } else {
                                                /*
                                                 * This is the dropbox
                                                 * behaviour. A dropbox is a
@@ -734,11 +737,8 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                                                 * nevertheless want to allow
                                                 * users creating a file.
                                                 */
-                                               status = 
NT_STATUS_OBJECT_PATH_NOT_FOUND;
-                                       } else {
-                                               status = 
NT_STATUS_ACCESS_DENIED;
+                                               errno = 0;
                                        }
-                                       goto fail;
                                }
 
                                if ((errno != 0) && (errno != ENOENT)) {
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index e901ff2..bca4cd8 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -538,8 +538,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
                                conn,
                                req->flags2 & FLAGS2_DFS_PATHNAMES,
                                fname,
-                               (create_disposition == FILE_CREATE)
-                                 ? UCF_CREATING_FILE : 0,
+                               UCF_PREP_CREATEFILE,
                                NULL,
                                &smb_fname);
 
@@ -1067,8 +1066,7 @@ static void call_nt_transact_create(connection_struct 
*conn,
                                conn,
                                req->flags2 & FLAGS2_DFS_PATHNAMES,
                                fname,
-                               (create_disposition == FILE_CREATE)
-                                 ? UCF_CREATING_FILE : 0,
+                               UCF_PREP_CREATEFILE,
                                NULL,
                                &smb_fname);
 
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index ce1a127..72dadf6 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1917,8 +1917,7 @@ void reply_open(struct smb_request *req)
                                conn,
                                req->flags2 & FLAGS2_DFS_PATHNAMES,
                                fname,
-                               (create_disposition == FILE_CREATE)
-                                 ? UCF_CREATING_FILE : 0,
+                               UCF_PREP_CREATEFILE,
                                NULL,
                                &smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
@@ -2086,8 +2085,7 @@ void reply_open_and_X(struct smb_request *req)
                                conn,
                                req->flags2 & FLAGS2_DFS_PATHNAMES,
                                fname,
-                               (create_disposition == FILE_CREATE)
-                                 ? UCF_CREATING_FILE : 0,
+                               UCF_PREP_CREATEFILE,
                                NULL,
                                &smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
@@ -2320,7 +2318,7 @@ void reply_mknew(struct smb_request *req)
                                conn,
                                req->flags2 & FLAGS2_DFS_PATHNAMES,
                                fname,
-                               UCF_CREATING_FILE,
+                               UCF_PREP_CREATEFILE,
                                NULL,
                                &smb_fname);
        if (!NT_STATUS_IS_OK(status)) {
@@ -2461,7 +2459,7 @@ void reply_ctemp(struct smb_request *req)
                status = filename_convert(ctx, conn,
                                req->flags2 & FLAGS2_DFS_PATHNAMES,
                                fname,
-                               UCF_CREATING_FILE,
+                               UCF_PREP_CREATEFILE,
                                NULL,
                                &smb_fname);
                if (!NT_STATUS_IS_OK(status)) {
@@ -5820,7 +5818,7 @@ void reply_mkdir(struct smb_request *req)
        status = filename_convert(ctx, conn,
                                 req->flags2 & FLAGS2_DFS_PATHNAMES,
                                 directory,
-                                UCF_CREATING_FILE,
+                                UCF_PREP_CREATEFILE,
                                 NULL,
                                 &smb_dname);
        if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 38eba4f..f2fec08 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -891,8 +891,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX 
*mem_ctx,
                                                  smb1req->conn,
                                                  smb1req->flags2 & 
FLAGS2_DFS_PATHNAMES,
                                                  fname,
-                                                 (in_create_disposition == 
FILE_CREATE) ?
-                                                 UCF_CREATING_FILE : 0,
+                                                 UCF_PREP_CREATEFILE,
                                                  NULL, /* 
ppath_contains_wcards */
                                                  &smb_fname);
                        if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/smbd/smbd.h b/source3/smbd/smbd.h
index e769157..5cf88bf 100644
--- a/source3/smbd/smbd.h
+++ b/source3/smbd/smbd.h
@@ -73,6 +73,6 @@ struct trans_state {
 #define UCF_COND_ALLOW_WCARD_LCOMP     0x00000004
 #define UCF_POSIX_PATHNAMES            0x00000008
 #define UCF_UNIX_NAME_LOOKUP           0x00000010
-#define UCF_CREATING_FILE              0x00000020
+#define UCF_PREP_CREATEFILE            0x00000020
 
 #endif /* _SMBD_SMBD_H */


-- 
Samba Shared Repository

Reply via email to