summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-07-21 09:56:45 -0700
committerKarolin Seeger <kseeger@samba.org>2017-08-14 10:21:42 +0200
commit527d1aaac89653a1a9453901e5ec224359aa1c9f (patch)
treeb3f3a4f402e40b66391f5c3da42a398363715174 /source3/libsmb
parent53643ac0eb2391ddebab11916f010d28039eb4ba (diff)
downloadsamba-527d1aaac89653a1a9453901e5ec224359aa1c9f.tar.gz
s3: libsmbclient: Fix cli_setpathinfo_basic() to treat mode == -1 as no change.
This is only called from SMBC_setatr(), so bring it into line with the specification for that function. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12913 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 812006fa8f26004609901b0ddef1c3ed05eff35e)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clirap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index dd2c30e2258..f897df63053 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -732,8 +732,17 @@ NTSTATUS cli_setpathinfo_basic(struct cli_state *cli, const char *fname,
put_long_date(p, change_time);
p += 8;
- /* Add attributes */
- SIVAL(p, 0, mode);
+ if (mode == (uint16_t)-1 || mode == FILE_ATTRIBUTE_NORMAL) {
+ /* No change. */
+ mode = 0;
+ } else if (mode == 0) {
+ /* Clear all existing attributes. */
+ mode = FILE_ATTRIBUTE_NORMAL;
+ }
+
+ /* Add attributes */
+ SIVAL(p, 0, mode);
+
p += 4;
/* Add padding */