The Samba-Bugzilla – Attachment 16570 Details for
Bug 14654
dos attributes not available for unreadable files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
backport for 4.14
0001-dosmode-retry-reading-dos-attributes-as-root-for-unr.patch (text/plain), 1.61 KB, created by
Björn Jacke
on 2021-03-25 09:37:43 UTC
(
hide
)
Description:
backport for 4.14
Filename:
MIME Type:
Creator:
Björn Jacke
Created:
2021-03-25 09:37:43 UTC
Size:
1.61 KB
patch
obsolete
>From 4288319770bc1bde28b1e9ac4bb287e29853378d Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= <bj@sernet.de> >Date: Thu, 4 Mar 2021 19:37:37 +0100 >Subject: [PATCH] dosmode: retry reading dos attributes as root for unreadable > files > >if there are files that the user can't access, he is still allowed to read the >dos attributes information, so we need to try reading them as root also. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14654 > >Signed-off-by: Bjoern Jacke <bjacke@samba.org> >Reviewed-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >(cherry picked from commit 4288319770bc1bde28b1e9ac4bb287e29853378d) >--- > source3/smbd/dosmode.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c >index 15676e008510..aaa0924cb9db 100644 >--- a/source3/smbd/dosmode.c >+++ b/source3/smbd/dosmode.c >@@ -382,6 +382,19 @@ NTSTATUS fget_ea_dos_attribute(struct files_struct *fsp, > SAMBA_XATTR_DOS_ATTRIB, > attrstr, > sizeof(attrstr)); >+ if (sizeret == -1 && ( errno == EPERM || errno == EACCES )) { >+ /* we may also retrieve dos attribs for unreadable files, this >+ is why we'll retry as root. We don't use root in the first >+ run because in cases like NFS, root might have even less >+ rights than the real user >+ */ >+ become_root(); >+ sizeret = SMB_VFS_FGETXATTR(fsp->base_fsp ? fsp->base_fsp : fsp, >+ SAMBA_XATTR_DOS_ATTRIB, >+ attrstr, >+ sizeof(attrstr)); >+ unbecome_root(); >+ } > if (sizeret == -1) { > DBG_INFO("Cannot get attribute " > "from EA on file %s: Error = %s\n", >-- >2.25.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
Flags:
bjacke
:
review+
slow
:
review+
Actions:
View
Attachments on
bug 14654
: 16570