The Samba-Bugzilla – Attachment 13433 Details for
Bug 12899
smbclient "setmode" no longer works to clear attribute bits due to dialect upgrade
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fixes for 4.6.next, 4.5.next.
4.6,4.5-12899.patch (text/plain), 2.21 KB, created by
Jeremy Allison
on 2017-07-26 17:28:15 UTC
(
hide
)
Description:
git-am fixes for 4.6.next, 4.5.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2017-07-26 17:28:15 UTC
Size:
2.21 KB
patch
obsolete
>From 8d87c90cc36275f11d488c6bc9d4cdf3c01b817a Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 17 Jul 2017 10:37:15 -0700 >Subject: [PATCH 1/2] s3: libsmb: Reverse sense of 'clear all attributes', > ignore attribute change in SMB2 to match SMB1. > >SMB1 uses attr == 0 to clear all attributes >on a file (end up with FILE_ATTRIBUTE_NORMAL), >and attr == FILE_ATTRIBUTE_NORMAL to mean ignore >request attribute change. > >SMB2 uses exactly the reverse. Unfortunately as the >cli_setatr() ABI is exposed inside libsmbclient, >we must make the SMB2 cli_smb2_setatr() call >export the same ABI as the SMB1 cli_setatr() >which calls it. This means reversing the sense >of the requested attr argument if it's zero >or FILE_ATTRIBUTE_NORMAL. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> >(cherry picked from commit f1cc79a46d56bda99c392d491d88479cd6427a32) >--- > source3/libsmb/cli_smb2_fnum.c | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > >diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c >index 954f3fe3a7f..6967555797a 100644 >--- a/source3/libsmb/cli_smb2_fnum.c >+++ b/source3/libsmb/cli_smb2_fnum.c >@@ -1698,6 +1698,29 @@ NTSTATUS cli_smb2_setatr(struct cli_state *cli, > inbuf.length = sizeof(inbuf_store); > data_blob_clear(&inbuf); > >+ /* >+ * SMB1 uses attr == 0 to clear all attributes >+ * on a file (end up with FILE_ATTRIBUTE_NORMAL), >+ * and attr == FILE_ATTRIBUTE_NORMAL to mean ignore >+ * request attribute change. >+ * >+ * SMB2 uses exactly the reverse. Unfortunately as the >+ * cli_setatr() ABI is exposed inside libsmbclient, >+ * we must make the SMB2 cli_smb2_setatr() call >+ * export the same ABI as the SMB1 cli_setatr() >+ * which calls it. This means reversing the sense >+ * of the requested attr argument if it's zero >+ * or FILE_ATTRIBUTE_NORMAL. >+ * >+ * See BUG: https://bugzilla.samba.org/show_bug.cgi?id=12899 >+ */ >+ >+ if (attr == 0) { >+ attr = FILE_ATTRIBUTE_NORMAL; >+ } else if (attr == FILE_ATTRIBUTE_NORMAL) { >+ attr = 0; >+ } >+ > SSVAL(inbuf.data, 32, attr); > if (mtime != 0) { > put_long_date((char *)inbuf.data + 16,mtime); >-- >2.13.2.932.g7449e964c-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:
slow
:
review+
Actions:
View
Attachments on
bug 12899
:
13376
|
13377
|
13387
|
13398
| 13433