The Samba-Bugzilla – Attachment 16472 Details for
Bug 14629
Symlink in directory listing are lacking file attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
backport for 4.14
backport-for-4.14.patch (text/plain), 6.02 KB, created by
Björn Jacke
on 2021-02-25 19:31:55 UTC
(
hide
)
Description:
backport for 4.14
Filename:
MIME Type:
Creator:
Björn Jacke
Created:
2021-02-25 19:31:55 UTC
Size:
6.02 KB
patch
obsolete
>From 986d490493be1b325eb317fd8502f351eb2385c7 Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 1 Feb 2021 14:44:03 +0100 >Subject: [PATCH 1/2] CI: verify a symlink has FILE_ATTRIBUTE_NORMAL set > >Not that it really makes sense to set FILE_ATTRIBUTE_NORMAL for symlinks in >POSIX client context, but that's what we had before 4.14. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14629 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 5572ae296e720a00ab438d7b50cfc458af631f69) >--- > selftest/knownfail.d/samba3.smbtorture_s3 | 4 ++++ > source3/torture/test_posix.c | 14 ++++++++++++++ > 2 files changed, 18 insertions(+) > create mode 100644 selftest/knownfail.d/samba3.smbtorture_s3 > >diff --git a/selftest/knownfail.d/samba3.smbtorture_s3 b/selftest/knownfail.d/samba3.smbtorture_s3 >new file mode 100644 >index 00000000000..2b9c93ab2c7 >--- /dev/null >+++ b/selftest/knownfail.d/samba3.smbtorture_s3 >@@ -0,0 +1,4 @@ >+^samba3.smbtorture_s3.plain.POSIX-LS-WILDCARD.smbtorture.* >+^samba3.smbtorture_s3.crypt.POSIX-LS-WILDCARD.smbtorture.* >+^samba3.smbtorture_s3.plain.POSIX-LS-SINGLE.smbtorture.* >+^samba3.smbtorture_s3.crypt.POSIX-LS-SINGLE.smbtorture.* >diff --git a/source3/torture/test_posix.c b/source3/torture/test_posix.c >index 415460cf86c..3ccb51d222b 100644 >--- a/source3/torture/test_posix.c >+++ b/source3/torture/test_posix.c >@@ -31,6 +31,7 @@ struct posix_test_entry { > const char *name; > const char *target; > const char *expected; >+ uint32_t attr; > uint64_t returned_size; > bool ok; > }; >@@ -44,6 +45,9 @@ static NTSTATUS posix_ls_fn(struct file_info *finfo, > > for (; state->name != NULL; state++) { > if (strequal(finfo->name, state->expected)) { >+ if (state->attr != finfo->attr) { >+ break; >+ } > state->ok = true; > state->returned_size = finfo->size; > break; >@@ -57,6 +61,7 @@ static void posix_test_entries_reset(struct posix_test_entry *state) > { > for (; state->name != NULL; state++) { > state->ok = false; >+ state->returned_size = 0; > } > } > >@@ -111,14 +116,17 @@ bool run_posix_ls_wildcard_test(int dummy) > .name = symlnk_dangling, > .target = symlnk_dst_dangling, > .expected = symlnk_dangling, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = symlnk_in_share, > .target = symlnk_dst_in_share, > .expected = symlnk_in_share, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = symlnk_outside_share, > .target = symlnk_dst_outside_share, > .expected = symlnk_outside_share, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = NULL, > } >@@ -275,14 +283,17 @@ bool run_posix_ls_single_test(int dummy) > .name = symlnk_dangling, > .target = symlnk_dst_dangling, > .expected = symlnk_dangling, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = symlnk_in_share, > .target = symlnk_dst_in_share, > .expected = symlnk_in_share, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = symlnk_outside_share, > .target = symlnk_dst_outside_share, > .expected = symlnk_outside_share, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = NULL, > } >@@ -457,14 +468,17 @@ bool run_posix_readlink_test(int dummy) > .name = symlnk_dangling, > .target = symlnk_dst_dangling, > .expected = symlnk_dangling, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = symlnk_in_share, > .target = symlnk_dst_in_share, > .expected = symlnk_in_share, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = symlnk_outside_share, > .target = symlnk_dst_outside_share, > .expected = symlnk_outside_share, >+ .attr = FILE_ATTRIBUTE_NORMAL, > }, { > .name = NULL, > } >-- >2.20.2 > >From 4da3ce05aeb32b2ae012fdc541e955bc7886532a Mon Sep 17 00:00:00 2001 >From: Ralph Boehme <slow@samba.org> >Date: Mon, 1 Feb 2021 12:37:10 +0100 >Subject: [PATCH 2/2] smbd: don't overwrite _mode if neither a msdfs symlink > nor get_dosmode is requested > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14629 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit d78964c40b5ca5ee0658c46d492b3dcd6f6b4b94) >--- > selftest/knownfail.d/samba3.smbtorture_s3 | 4 ---- > source3/smbd/trans2.c | 16 +++++++++------- > 2 files changed, 9 insertions(+), 11 deletions(-) > delete mode 100644 selftest/knownfail.d/samba3.smbtorture_s3 > >diff --git a/selftest/knownfail.d/samba3.smbtorture_s3 b/selftest/knownfail.d/samba3.smbtorture_s3 >deleted file mode 100644 >index 2b9c93ab2c7..00000000000 >--- a/selftest/knownfail.d/samba3.smbtorture_s3 >+++ /dev/null >@@ -1,4 +0,0 @@ >-^samba3.smbtorture_s3.plain.POSIX-LS-WILDCARD.smbtorture.* >-^samba3.smbtorture_s3.crypt.POSIX-LS-WILDCARD.smbtorture.* >-^samba3.smbtorture_s3.plain.POSIX-LS-SINGLE.smbtorture.* >-^samba3.smbtorture_s3.crypt.POSIX-LS-SINGLE.smbtorture.* >diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c >index f3a0d7da75f..7196b0fcc72 100644 >--- a/source3/smbd/trans2.c >+++ b/source3/smbd/trans2.c >@@ -1755,7 +1755,6 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx, > struct smbd_dirptr_lanman2_state *state = > (struct smbd_dirptr_lanman2_state *)private_data; > bool ms_dfs_link = false; >- uint32_t mode = 0; > > if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) { > if (SMB_VFS_LSTAT(state->conn, smb_fname) != 0) { >@@ -1765,6 +1764,7 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx, > strerror(errno))); > return false; > } >+ return true; > } else if (!VALID_STAT(smb_fname->st) && > SMB_VFS_STAT(state->conn, smb_fname) != 0) { > /* Needed to show the msdfs symlinks as >@@ -1779,16 +1779,18 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx, > strerror(errno))); > return false; > } >+ >+ *_mode = dos_mode_msdfs(state->conn, smb_fname); >+ return true; > } > >- if (ms_dfs_link) { >- mode = dos_mode_msdfs(state->conn, smb_fname); >- } else if (get_dosmode) { >- mode = fdos_mode(smb_fname->fsp); >- smb_fname->st = smb_fname->fsp->fsp_name->st; >+ if (!get_dosmode) { >+ return true; > } > >- *_mode = mode; >+ *_mode = fdos_mode(smb_fname->fsp); >+ smb_fname->st = smb_fname->fsp->fsp_name->st; >+ > return true; > } > >-- >2.20.2 >
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
Flags:
bjacke
:
review+
Actions:
View
Attachments on
bug 14629
: 16472