smbd: Focus smb_file_link_information on correct posix'ness
authorVolker Lendecke <vl@samba.org>
Mon, 18 Mar 2019 11:40:06 +0000 (12:40 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 19 Mar 2019 18:46:28 +0000 (18:46 +0000)
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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 19 18:46:28 UTC 2019 on sn-devel-144

source3/smbd/trans2.c

index a5750a3..dd5973b 100644 (file)
@@ -6875,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,
@@ -6884,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,