The branch, master has been updated
       via  7e77f1fea6c smbd: Focus smb_file_link_information on correct 
posix'ness
       via  74ca95f804a smbd: Enhance debugging for setting hard links
      from  b2c2c4c3e6c talloc: Fix alignment issues for casting pointers

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


- Log -----------------------------------------------------------------
commit 7e77f1fea6c922b76a6961e477a4d72815f08886
Author: Volker Lendecke <[email protected]>
Date:   Mon Mar 18 12:40:06 2019 +0100

    smbd: Focus smb_file_link_information on correct posix'ness
    
    In the SMB1 unix extensions, posix'ness is a property of the SMB
    request, because it's tied to the connection. In the upcoming SMB3
    extensions, this will become a property of the file name, it's being
    set at SMB2_CREATE time. To correctly transfer posix'ness of the
    filename to the destination name, we can't look at the
    req->posix_pathnames here, the SMB2_SETINFO call has not set
    that. This is still correct for SMB1, as the per-connection posix'ness
    has spilled into the filename there too.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Tue Mar 19 18:46:28 UTC 2019 on sn-devel-144

commit 74ca95f804a1dd385d33deaf07d47659aaa049f5
Author: Volker Lendecke <[email protected]>
Date:   Mon Mar 18 12:24:25 2019 +0100

    smbd: Enhance debugging for setting hard links
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

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

Summary of changes:
 source3/smbd/trans2.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 108bd570922..dd5973b089b 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -6128,6 +6128,7 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
                struct smb_filename *smb_fname_new)
 {
        NTSTATUS status = NT_STATUS_OK;
+       bool ok;
 
        /* source must already exist. */
        if (!VALID_STAT(smb_fname_old->st)) {
@@ -6159,8 +6160,14 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
        }
 
        /* Setting a hardlink to/from a stream isn't currently supported. */
-       if (is_ntfs_stream_smb_fname(smb_fname_old) ||
-           is_ntfs_stream_smb_fname(smb_fname_new)) {
+       ok = is_ntfs_stream_smb_fname(smb_fname_old);
+       if (ok) {
+               DBG_DEBUG("Old name has streams\n");
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+       ok = is_ntfs_stream_smb_fname(smb_fname_new);
+       if (ok) {
+               DBG_DEBUG("New name has streams\n");
                return NT_STATUS_INVALID_PARAMETER;
        }
 
@@ -6868,7 +6875,7 @@ static NTSTATUS 
smb_file_link_information(connection_struct *conn,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       if (req->posix_pathnames) {
+       if (smb_fname_src->flags & SMB_FILENAME_POSIX_PATH) {
                srvstr_get_path_posix(ctx,
                                pdata,
                                req->flags2,
@@ -6877,6 +6884,7 @@ static NTSTATUS 
smb_file_link_information(connection_struct *conn,
                                len,
                                STR_TERMINATE,
                                &status);
+               ucf_flags |= UCF_POSIX_PATHNAMES;
        } else {
                srvstr_get_path(ctx,
                                pdata,


-- 
Samba Shared Repository

Reply via email to