The Samba-Bugzilla – Attachment 13431 Details for
Bug 12937
smbcacls can fail against a directory on Windows using SMB2.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.7.0, 4.6.next
0001-s3-utils-smbcacls-failed-to-detect-DIRECTORIES-using.patch (text/plain), 2.48 KB, created by
Jeremy Allison
on 2017-07-25 23:12:27 UTC
(
hide
)
Description:
git-am fix for 4.7.0, 4.6.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2017-07-25 23:12:27 UTC
Size:
2.48 KB
patch
obsolete
>From 1c0ba6c851261c253bfe7718aca64620af7e9206 Mon Sep 17 00:00:00 2001 >From: Noel Power <noel.power@suse.com> >Date: Thu, 20 Jul 2017 13:01:50 +0100 >Subject: [PATCH] s3/utils: smbcacls failed to detect DIRECTORIES using SMB2 > (windows only) > >uint16_t get_fileinfo(...) returns file attributes, this function >called > > cli_qfileinfo_basic(cli, fnum, &mode, NULL, NULL, NULL, > NULL, NULL, NULL); > >which was failing with NT_STATUS_ACCESS_DENIED errors when fnum above >was obtained via (when using protocol > SMB). Note: This only seems to be >an issue when run against a windows server, with smbd SMB1 & SMB2 work fine. > > status = cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ, > 0, FILE_SHARE_READ|FILE_SHARE_WRITE, > FILE_OPEN, 0x0, 0x0, &fnum, NULL); > >The failing cli_qfileinfo_basic call above is unnecessary as we can already >obtain the required information from the cli_ntcreate call > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12937 > >Signed-off-by: Noel Power <noel.power@suse.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >Reviewed-by: David Disseldorp <ddiss@samba.org> >(cherry picked from commit c57dcafb150823b00fd873046e65a966a8488fa8) >--- > source3/utils/smbcacls.c | 14 +++----------- > 1 file changed, 3 insertions(+), 11 deletions(-) > >diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c >index 86b4591d365..6bf32e51dda 100644 >--- a/source3/utils/smbcacls.c >+++ b/source3/utils/smbcacls.c >@@ -229,30 +229,22 @@ get fileinfo for filename > static uint16_t get_fileinfo(struct cli_state *cli, const char *filename) > { > uint16_t fnum = (uint16_t)-1; >- uint16_t mode = 0; > NTSTATUS status; >+ struct smb_create_returns cr = {0}; > > /* The desired access below is the only one I could find that works > with NT4, W2KP and Samba */ > > status = cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ, > 0, FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OPEN, 0x0, 0x0, &fnum, NULL); >+ FILE_OPEN, 0x0, 0x0, &fnum, &cr); > if (!NT_STATUS_IS_OK(status)) { > printf("Failed to open %s: %s\n", filename, nt_errstr(status)); > return 0; > } > >- status = cli_qfileinfo_basic(cli, fnum, &mode, NULL, NULL, NULL, >- NULL, NULL, NULL); >- if (!NT_STATUS_IS_OK(status)) { >- printf("Failed to file info %s: %s\n", filename, >- nt_errstr(status)); >- } >- > cli_close(cli, fnum); >- >- return mode; >+ return cr.file_attributes; > } > > /***************************************************** >-- >2.14.0.rc0.400.g1c36432dff-goog >
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:
ddiss
:
review+
Actions:
View
Attachments on
bug 12937
: 13431