The Samba-Bugzilla – Attachment 16013 Details for
Bug 14391
DFS links broken in 4.12
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for master
dfs-fix-master-fullfix (text/plain), 27.35 KB, created by
Jeremy Allison
on 2020-06-01 21:08:12 UTC
(
hide
)
Description:
git-am fix for master
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2020-06-01 21:08:12 UTC
Size:
27.35 KB
patch
obsolete
>From a48f90640bf3c67278896cff4ff1a41c37800060 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 1 Jun 2020 13:55:10 -0700 >Subject: [PATCH 01/13] s3: libsmb: Info level SMB2_FIND_ID_BOTH_DIRECTORY_INFO > encodes attibutes as a uint32, not a uint8. > >Fix the SMB2 parsing code. > >Cast to a uint16_t for now after pulling the information >as finfo->mode is currently only 16 bits. > >We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit. > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/cli_smb2_fnum.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c >index c1c755a97ea..46a4ae95977 100644 >--- a/source3/libsmb/cli_smb2_fnum.c >+++ b/source3/libsmb/cli_smb2_fnum.c >@@ -1199,7 +1199,8 @@ static NTSTATUS parse_finfo_id_both_directory_info(const uint8_t *dir_data, > finfo->ctime_ts = interpret_long_date((const char *)dir_data + 32); > finfo->size = IVAL2_TO_SMB_BIG_UINT(dir_data + 40, 0); > finfo->allocated_size = IVAL2_TO_SMB_BIG_UINT(dir_data + 48, 0); >- finfo->mode = CVAL(dir_data + 56, 0); >+ /* NB. We need to enlarge finfo->mode to be 32-bits. */ >+ finfo->mode = (uint16_t)IVAL(dir_data + 56, 0); > finfo->ino = IVAL2_TO_SMB_BIG_UINT(dir_data + 96, 0); > namelen = IVAL(dir_data + 60,0); > if (namelen > (dir_data_length - 104)) { >-- >2.20.1 > > >From f19095dc41019ea7708cabe3911319c482c81641 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 1 Jun 2020 11:36:03 -0700 >Subject: [PATCH 02/13] s3: libsmb: Info level > SMB_FIND_FILE_BOTH_DIRECTORY_INFO encodes attibutes as a uint32, not a uint8. > >Cast to a uint16_t for now after pulling the information >as finfo->mode is currently only 16 bits. > >We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/clilist.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c >index 3ed9e8292c2..d0f67ed25bd 100644 >--- a/source3/libsmb/clilist.c >+++ b/source3/libsmb/clilist.c >@@ -257,7 +257,8 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, > finfo->size = IVAL2_TO_SMB_BIG_UINT(p,0); > p += 8; > p += 8; /* alloc size */ >- finfo->mode = CVAL(p,0); >+ /* NB. We need to enlarge finfo->mode to be 32-bits. */ >+ finfo->mode = (uint16_t)IVAL(p,0); > p += 4; > namelen = IVAL(p,0); > p += 4; >-- >2.20.1 > > >From 0971134d83fdc94ff64d29b2b337f1754b8421ea Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 1 Jun 2020 12:01:13 -0700 >Subject: [PATCH 03/13] s3: libsmb: Info level SMB_FIND_INFO_STANDARD encodes > attibutes as a uint16, not a uint8. > >We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/clilist.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c >index d0f67ed25bd..e00cdc4921c 100644 >--- a/source3/libsmb/clilist.c >+++ b/source3/libsmb/clilist.c >@@ -152,7 +152,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, > finfo->mtime_ts = convert_time_t_to_timespec( > make_unix_date2(p+12, smb1cli_conn_server_time_zone(cli->conn))); > finfo->size = IVAL(p,16); >- finfo->mode = CVAL(p,24); >+ finfo->mode = SVAL(p,24); > len = CVAL(p, 26); > p += 27; > if (recv_flags2 & FLAGS2_UNICODE_STRINGS) { >-- >2.20.1 > > >From ee6d645a6501926090ea6e5409bdf140a00d20ff Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 1 Jun 2020 11:33:13 -0700 >Subject: [PATCH 04/13] s3: libsmb: Info level SMB_FIND_EA_SIZE encodes > attibutes as a uint16, not a uint8. > >We will need this to detect FILE_ATTRIBUTE_REPARSE_POINT in a later commit. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/clilist.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c >index e00cdc4921c..0c4e3db09f1 100644 >--- a/source3/libsmb/clilist.c >+++ b/source3/libsmb/clilist.c >@@ -211,7 +211,7 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, > finfo->mtime_ts = convert_time_t_to_timespec( > make_unix_date2(p+12, smb1cli_conn_server_time_zone(cli->conn))); > finfo->size = IVAL(p,16); >- finfo->mode = CVAL(p,24); >+ finfo->mode = SVAL(p,24); > len = CVAL(p, 30); > p += 31; > /* check for unisys! */ >-- >2.20.1 > > >From f1b9fd852b3d35406157196ba36deb5422d98de9 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 1 Jun 2020 12:08:17 -0700 >Subject: [PATCH 05/13] s3: torture: Add a MSDFS-ATTRIBUTE test. > >Framework to drive comes next. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/torture/torture.c | 79 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 79 insertions(+) > >diff --git a/source3/torture/torture.c b/source3/torture/torture.c >index 997e074c481..31e45405591 100644 >--- a/source3/torture/torture.c >+++ b/source3/torture/torture.c >@@ -11448,6 +11448,81 @@ static bool run_large_readx(int dummy) > return correct; > } > >+static NTSTATUS msdfs_attribute_list_fn(const char *mnt, >+ struct file_info *finfo, >+ const char *mask, >+ void *private_data) >+{ >+ uint16_t *p_mode = (uint16_t *)private_data; >+ >+ if (strequal(finfo->name, test_filename)) { >+ *p_mode = finfo->mode; >+ } >+ >+ return NT_STATUS_OK; >+} >+ >+static bool run_msdfs_attribute(int dummy) >+{ >+ static struct cli_state *cli; >+ bool correct = false; >+ uint16_t mode = 0; >+ NTSTATUS status; >+ >+ printf("Starting MSDFS-ATTRIBUTE test\n"); >+ >+ if (test_filename == NULL || test_filename[0] == '\0') { >+ printf("MSDFS-ATTRIBUTE test " >+ "needs -f filename-of-msdfs-link\n"); >+ return false; >+ } >+ >+ /* >+ * NB. We use torture_open_connection_flags() not >+ * torture_open_connection() as the latter forces >+ * SMB1. >+ */ >+ if (!torture_open_connection_flags(&cli, 0, 0)) { >+ return false; >+ } >+ >+ smbXcli_conn_set_sockopt(cli->conn, sockops); >+ >+ status = cli_list(cli, >+ "*", >+ FILE_ATTRIBUTE_DIRECTORY, >+ msdfs_attribute_list_fn, >+ &mode); >+ >+ if (!NT_STATUS_IS_OK(status)) { >+ printf("cli_list failed with %s\n", >+ nt_errstr(status)); >+ goto out; >+ } >+ if ((mode & FILE_ATTRIBUTE_REPARSE_POINT) == 0) { >+ printf("file %s should have " >+ "FILE_ATTRIBUTE_REPARSE_POINT set. attr = 0x%x\n", >+ test_filename, >+ (unsigned int)mode); >+ goto out; >+ } >+ >+ if ((mode & FILE_ATTRIBUTE_DIRECTORY) == 0) { >+ printf("file %s should have " >+ "FILE_ATTRIBUTE_DIRECTORY set. attr = 0x%x\n", >+ test_filename, >+ (unsigned int)mode); >+ goto out; >+ } >+ >+ correct = true; >+ >+ out: >+ >+ torture_close_connection(cli); >+ return correct; >+} >+ > static bool run_cli_echo(int dummy) > { > struct cli_state *cli; >@@ -14620,6 +14695,10 @@ static struct { > .name = "LARGE_READX", > .fn = run_large_readx, > }, >+ { >+ .name = "MSDFS-ATTRIBUTE", >+ .fn = run_msdfs_attribute, >+ }, > { > .name = "NTTRANS-CREATE", > .fn = run_nttrans_create, >-- >2.20.1 > > >From 91408902ee3134df4fb71195328124da4c80398f Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 1 Jun 2020 13:45:28 -0700 >Subject: [PATCH 06/13] s3: torture: Add test for getting attibutes on an MSDFS > link. > >Mark as knownfail for now. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > selftest/knownfail.d/msdfs-attr | 3 +++ > source3/selftest/tests.py | 27 +++++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) > create mode 100644 selftest/knownfail.d/msdfs-attr > >diff --git a/selftest/knownfail.d/msdfs-attr b/selftest/knownfail.d/msdfs-attr >new file mode 100644 >index 00000000000..a8a77ec2719 >--- /dev/null >+++ b/selftest/knownfail.d/msdfs-attr >@@ -0,0 +1,3 @@ >+samba3.smbtorture_s3.smb2.MSDFS-ATTRIBUTE >+samba3.smbtorture_s3.smb1.MSDFS-ATTRIBUTE >+ >diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py >index fb07610c3f0..cfca26359c3 100755 >--- a/source3/selftest/tests.py >+++ b/source3/selftest/tests.py >@@ -172,6 +172,33 @@ plantestsuite("samba3.smbtorture_s3.hidenewfiles(fileserver_smb1)", > "", > "-l $LOCAL_PATH"]) > >+# >+# MSDFS attribute tests. >+# >+plantestsuite("samba3.smbtorture_s3.smb2.MSDFS-ATTRIBUTE", >+ "fileserver", >+ [os.path.join(samba3srcdir, >+ "script/tests/test_smbtorture_s3.sh"), >+ 'MSDFS-ATTRIBUTE', >+ '//$SERVER_IP/msdfs-share', >+ '$USERNAME', >+ '$PASSWORD', >+ smbtorture3, >+ "-mSMB2", >+ "-f msdfs-src1"]) >+ >+plantestsuite("samba3.smbtorture_s3.smb1.MSDFS-ATTRIBUTE", >+ "fileserver_smb1", >+ [os.path.join(samba3srcdir, >+ "script/tests/test_smbtorture_s3.sh"), >+ 'MSDFS-ATTRIBUTE', >+ '//$SERVER_IP/msdfs-share', >+ '$USERNAME', >+ '$PASSWORD', >+ smbtorture3, >+ "-mNT1", >+ "-f msdfs-src1"]) >+ > shares = [ > "vfs_aio_pthread_async_dosmode_default1", > "vfs_aio_pthread_async_dosmode_default2", >-- >2.20.1 > > >From 895e7710f0617b4d90d82871aab5fd3dece44e05 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 16:32:12 -0700 >Subject: [PATCH 07/13] s3: VFS: Change the function signature for > SMB_VFS_READ_DFS_PATHAT() to take a non-const smb_filename. > >Otherwise there's no good way to return proper stat(2) information >for a DFS link without making assumptions it's a symlink store. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > examples/VFS/skel_opaque.c | 2 +- > examples/VFS/skel_transparent.c | 2 +- > source3/include/vfs.h | 9 ++++++--- > source3/modules/vfs_cap.c | 2 +- > source3/modules/vfs_catia.c | 2 +- > source3/modules/vfs_ceph.c | 2 +- > source3/modules/vfs_default.c | 2 +- > source3/modules/vfs_full_audit.c | 2 +- > source3/modules/vfs_glusterfs.c | 2 +- > source3/modules/vfs_not_implemented.c | 2 +- > source3/modules/vfs_shadow_copy2.c | 2 +- > source3/modules/vfs_time_audit.c | 2 +- > source3/smbd/vfs.c | 2 +- > 13 files changed, 18 insertions(+), 15 deletions(-) > >diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c >index 1a9b472634d..0a6ca4d9200 100644 >--- a/examples/VFS/skel_opaque.c >+++ b/examples/VFS/skel_opaque.c >@@ -115,7 +115,7 @@ static NTSTATUS skel_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS skel_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c >index fdb6d0d5f54..677af2217bf 100644 >--- a/examples/VFS/skel_transparent.c >+++ b/examples/VFS/skel_transparent.c >@@ -116,7 +116,7 @@ static NTSTATUS skel_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS skel_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/include/vfs.h b/source3/include/vfs.h >index ab4098636dc..d527f850628 100644 >--- a/source3/include/vfs.h >+++ b/source3/include/vfs.h >@@ -324,6 +324,9 @@ > * Version 43 - Add dirfsp args to SMB_VFS_CREATE_FILE() > * Version 43 - Add SMB_VFS_OPENAT() > * Version 43 - Remove SMB_VFS_OPEN() >+ * Version 43 - SMB_VFS_READ_DFS_PATHAT() should take a non-const name. >+ There's no easy way to return stat info for a DFS link >+ otherwise. > */ > > #define SMB_VFS_INTERFACE_VERSION 43 >@@ -741,7 +744,7 @@ struct vfs_fn_pointers { > NTSTATUS (*read_dfs_pathat_fn)(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count); > >@@ -1255,7 +1258,7 @@ NTSTATUS smb_vfs_call_create_dfs_pathat(struct vfs_handle_struct *handle, > NTSTATUS smb_vfs_call_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count); > DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle, >@@ -1705,7 +1708,7 @@ NTSTATUS vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct *handle, > NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count); > NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle, >diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c >index 17ebb786822..cf1c1f3d22c 100644 >--- a/source3/modules/vfs_cap.c >+++ b/source3/modules/vfs_cap.c >@@ -1042,7 +1042,7 @@ static NTSTATUS cap_create_dfs_pathat(vfs_handle_struct *handle, > static NTSTATUS cap_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c >index 6fc14de076b..0ce2f7925a3 100644 >--- a/source3/modules/vfs_catia.c >+++ b/source3/modules/vfs_catia.c >@@ -2417,7 +2417,7 @@ static NTSTATUS catia_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS catia_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c >index 767a2ad8609..7bc6ba50cd6 100644 >--- a/source3/modules/vfs_ceph.c >+++ b/source3/modules/vfs_ceph.c >@@ -1340,7 +1340,7 @@ static NTSTATUS cephwrap_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS cephwrap_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c >index 5047582ce46..f00255914f3 100644 >--- a/source3/modules/vfs_default.c >+++ b/source3/modules/vfs_default.c >@@ -420,7 +420,7 @@ static NTSTATUS vfswrap_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS vfswrap_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c >index 3e10a8c4127..9d89bfd396a 100644 >--- a/source3/modules/vfs_full_audit.c >+++ b/source3/modules/vfs_full_audit.c >@@ -921,7 +921,7 @@ static NTSTATUS smb_full_audit_create_dfs_pathat(struct vfs_handle_struct *handl > static NTSTATUS smb_full_audit_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c >index 843cf5be78f..658e4635eef 100644 >--- a/source3/modules/vfs_glusterfs.c >+++ b/source3/modules/vfs_glusterfs.c >@@ -1941,7 +1941,7 @@ static NTSTATUS vfs_gluster_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS vfs_gluster_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c >index ca12406ac07..529ad579f49 100644 >--- a/source3/modules/vfs_not_implemented.c >+++ b/source3/modules/vfs_not_implemented.c >@@ -109,7 +109,7 @@ NTSTATUS vfs_not_implemented_create_dfs_pathat(struct vfs_handle_struct *handle, > NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c >index 4eb8257f1fc..45fb5b97ce3 100644 >--- a/source3/modules/vfs_shadow_copy2.c >+++ b/source3/modules/vfs_shadow_copy2.c >@@ -2394,7 +2394,7 @@ static NTSTATUS shadow_copy2_create_dfs_pathat(struct vfs_handle_struct *handle, > static NTSTATUS shadow_copy2_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c >index ff4952c45e7..f70ff73fec1 100644 >--- a/source3/modules/vfs_time_audit.c >+++ b/source3/modules/vfs_time_audit.c >@@ -352,7 +352,7 @@ static NTSTATUS smb_time_audit_create_dfs_pathat(struct vfs_handle_struct *handl > static NTSTATUS smb_time_audit_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c >index 849ee6f6523..85b23d35ba6 100644 >--- a/source3/smbd/vfs.c >+++ b/source3/smbd/vfs.c >@@ -1677,7 +1677,7 @@ NTSTATUS smb_vfs_call_create_dfs_pathat(struct vfs_handle_struct *handle, > NTSTATUS smb_vfs_call_read_dfs_pathat(struct vfs_handle_struct *handle, > TALLOC_CTX *mem_ctx, > struct files_struct *dirfsp, >- const struct smb_filename *smb_fname, >+ struct smb_filename *smb_fname, > struct referral **ppreflist, > size_t *preferral_count) > { >-- >2.20.1 > > >From 66755249f04a6db6926ac66aa7ba31d9ca8229f0 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 16:36:55 -0700 >Subject: [PATCH 08/13] s3: VFS: cap. Ensure read_dfs_pathat() returns stat > info. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/modules/vfs_cap.c | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c >index cf1c1f3d22c..93f0454c608 100644 >--- a/source3/modules/vfs_cap.c >+++ b/source3/modules/vfs_cap.c >@@ -1070,6 +1070,12 @@ static NTSTATUS cap_read_dfs_pathat(struct vfs_handle_struct *handle, > cap_smb_fname, > ppreflist, > preferral_count); >+ >+ if (NT_STATUS_IS_OK(status)) { >+ /* Return any stat(2) info. */ >+ smb_fname->st = cap_smb_fname->st; >+ } >+ > TALLOC_FREE(cappath); > TALLOC_FREE(cap_smb_fname); > return status; >-- >2.20.1 > > >From 4b6a4a5916140c8d35000350808de0df8eb1dfe7 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 16:38:53 -0700 >Subject: [PATCH 09/13] s3: VFS: catia. Ensure read_dfs_pathat() returns stat > info. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/modules/vfs_catia.c | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c >index 0ce2f7925a3..85ef5cfb0d4 100644 >--- a/source3/modules/vfs_catia.c >+++ b/source3/modules/vfs_catia.c >@@ -2451,6 +2451,11 @@ static NTSTATUS catia_read_dfs_pathat(struct vfs_handle_struct *handle, > mapped_smb_fname, > ppreflist, > preferral_count); >+ if (NT_STATUS_IS_OK(status)) { >+ /* Return any stat(2) info. */ >+ smb_fname->st = mapped_smb_fname->st; >+ } >+ > TALLOC_FREE(mapped_name); > TALLOC_FREE(mapped_smb_fname); > return status; >-- >2.20.1 > > >From 54d58a13e6cd9225c17df83b0e966f4d4a199ed9 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 17:35:06 -0700 >Subject: [PATCH 10/13] s3: VFS: ceph. Ensure read_dfs_pathat() returns stat > info. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/modules/vfs_ceph.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c >index 7bc6ba50cd6..0378d633782 100644 >--- a/source3/modules/vfs_ceph.c >+++ b/source3/modules/vfs_ceph.c >@@ -1354,9 +1354,16 @@ static NTSTATUS cephwrap_read_dfs_pathat(struct vfs_handle_struct *handle, > #else > char link_target_buf[7]; > #endif >+ struct ceph_statx stx; >+ int ret; > > SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); > >+ if (is_named_stream(smb_fname)) { >+ status = NT_STATUS_OBJECT_NAME_NOT_FOUND; >+ goto err; >+ } >+ > if (ppreflist == NULL && preferral_count == NULL) { > /* > * We're only checking if this is a DFS >@@ -1372,6 +1379,16 @@ static NTSTATUS cephwrap_read_dfs_pathat(struct vfs_handle_struct *handle, > } > } > >+ ret = ceph_statx(handle->data, >+ smb_fname->base_name, >+ &stx, >+ SAMBA_STATX_ATTR_MASK, >+ AT_SYMLINK_NOFOLLOW); >+ if (ret < 0) { >+ status = map_nt_error_from_unix(-ret); >+ goto err; >+ } >+ > referral_len = ceph_readlink(handle->data, > smb_fname->base_name, > link_target, >@@ -1404,6 +1421,7 @@ static NTSTATUS cephwrap_read_dfs_pathat(struct vfs_handle_struct *handle, > > if (ppreflist == NULL && preferral_count == NULL) { > /* Early return for checking if this is a DFS link. */ >+ init_stat_ex_from_ceph_statx(&smb_fname->st, &stx); > return NT_STATUS_OK; > } > >@@ -1414,6 +1432,7 @@ static NTSTATUS cephwrap_read_dfs_pathat(struct vfs_handle_struct *handle, > preferral_count); > > if (ok) { >+ init_stat_ex_from_ceph_statx(&smb_fname->st, &stx); > status = NT_STATUS_OK; > } else { > status = NT_STATUS_NO_MEMORY; >-- >2.20.1 > > >From ba9d0af8f3cc628061cad48ca0b52c5dbd3f3dab Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 17:49:17 -0700 >Subject: [PATCH 11/13] s3: VFS: gluster. Ensure read_dfs_pathat() returns stat > info. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/modules/vfs_glusterfs.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c >index 658e4635eef..ff5382af9fb 100644 >--- a/source3/modules/vfs_glusterfs.c >+++ b/source3/modules/vfs_glusterfs.c >@@ -1955,9 +1955,16 @@ static NTSTATUS vfs_gluster_read_dfs_pathat(struct vfs_handle_struct *handle, > #else > char link_target_buf[7]; > #endif >+ struct stat st; >+ int ret; > > SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); > >+ if (is_named_stream(smb_fname)) { >+ status = NT_STATUS_OBJECT_NAME_NOT_FOUND; >+ goto err; >+ } >+ > if (ppreflist == NULL && preferral_count == NULL) { > /* > * We're only checking if this is a DFS >@@ -1973,6 +1980,12 @@ static NTSTATUS vfs_gluster_read_dfs_pathat(struct vfs_handle_struct *handle, > } > } > >+ ret = glfs_lstat(handle->data, smb_fname->base_name, &st); >+ if (ret < 0) { >+ status = map_nt_error_from_unix(errno); >+ goto err; >+ } >+ > referral_len = glfs_readlink(handle->data, > smb_fname->base_name, > link_target, >@@ -2003,6 +2016,7 @@ static NTSTATUS vfs_gluster_read_dfs_pathat(struct vfs_handle_struct *handle, > > if (ppreflist == NULL && preferral_count == NULL) { > /* Early return for checking if this is a DFS link. */ >+ smb_stat_ex_from_stat(&smb_fname->st, &st); > return NT_STATUS_OK; > } > >@@ -2013,6 +2027,7 @@ static NTSTATUS vfs_gluster_read_dfs_pathat(struct vfs_handle_struct *handle, > preferral_count); > > if (ok) { >+ smb_stat_ex_from_stat(&smb_fname->st, &st); > status = NT_STATUS_OK; > } else { > status = NT_STATUS_NO_MEMORY; >-- >2.20.1 > > >From fbdf523721acc5be2e2813f7e6d095ad62630177 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 17:52:51 -0700 >Subject: [PATCH 12/13] s3: VFS: shadow_copy2. Ensure read_dfs_pathat() returns > stat info. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/modules/vfs_shadow_copy2.c | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c >index 45fb5b97ce3..6a1e560988e 100644 >--- a/source3/modules/vfs_shadow_copy2.c >+++ b/source3/modules/vfs_shadow_copy2.c >@@ -2441,6 +2441,11 @@ static NTSTATUS shadow_copy2_read_dfs_pathat(struct vfs_handle_struct *handle, > ppreflist, > preferral_count); > >+ if (NT_STATUS_IS_OK(status)) { >+ /* Return any stat(2) info. */ >+ smb_fname->st = conv->st; >+ } >+ > TALLOC_FREE(conv); > return status; > } >-- >2.20.1 > > >From b66af08fb669a708f581f5cff650e7a3d3cb4ba6 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 29 May 2020 17:56:58 -0700 >Subject: [PATCH 13/13] s3: VFS: default. Ensure read_dfs_pathat() returns stat > info. > >Remove the knownfail.d/msdfs-attr file. > >Everything now passes. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14391 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > selftest/knownfail.d/msdfs-attr | 3 --- > source3/modules/vfs_default.c | 14 ++++++++++++++ > 2 files changed, 14 insertions(+), 3 deletions(-) > delete mode 100644 selftest/knownfail.d/msdfs-attr > >diff --git a/selftest/knownfail.d/msdfs-attr b/selftest/knownfail.d/msdfs-attr >deleted file mode 100644 >index a8a77ec2719..00000000000 >--- a/selftest/knownfail.d/msdfs-attr >+++ /dev/null >@@ -1,3 +0,0 @@ >-samba3.smbtorture_s3.smb2.MSDFS-ATTRIBUTE >-samba3.smbtorture_s3.smb1.MSDFS-ATTRIBUTE >- >diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c >index f00255914f3..a4910b4882d 100644 >--- a/source3/modules/vfs_default.c >+++ b/source3/modules/vfs_default.c >@@ -434,9 +434,15 @@ static NTSTATUS vfswrap_read_dfs_pathat(struct vfs_handle_struct *handle, > #else > char link_target_buf[7]; > #endif >+ int ret; > > SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp); > >+ if (is_named_stream(smb_fname)) { >+ status = NT_STATUS_OBJECT_NAME_NOT_FOUND; >+ goto err; >+ } >+ > if (ppreflist == NULL && preferral_count == NULL) { > /* > * We're only checking if this is a DFS >@@ -485,6 +491,14 @@ static NTSTATUS vfswrap_read_dfs_pathat(struct vfs_handle_struct *handle, > goto err; > } > >+ ret = sys_lstat(smb_fname->base_name, >+ &smb_fname->st, >+ lp_fake_directory_create_times(SNUM(handle->conn))); >+ if (ret < 0) { >+ status = map_nt_error_from_unix(errno); >+ goto err; >+ } >+ > if (ppreflist == NULL && preferral_count == NULL) { > /* Early return for checking if this is a DFS link. */ > return NT_STATUS_OK; >-- >2.20.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14391
:
16010
|
16013
|
16014
|
16017