diff options
author | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2008-01-23 20:44:54 -0500 |
---|---|---|
committer | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2008-01-23 20:44:54 -0500 |
commit | e0021b586d0c882fcc5ce0566dbbbd76f163d170 (patch) | |
tree | 1a729d5d9c5506f6547d5318f0459570a31bfc78 /source3 | |
parent | d221d53f3a523ac014e9f33b67f0b7d777dfb171 (diff) | |
download | samba-e0021b586d0c882fcc5ce0566dbbbd76f163d170.tar.gz samba-e0021b586d0c882fcc5ce0566dbbbd76f163d170.tar.bz2 samba-e0021b586d0c882fcc5ce0566dbbbd76f163d170.zip |
Allow clearing all settable DOS mode bits. A mode value of zero is ignored by
Windows. If the requested mode is zero, we instead send the appropriate one
of 0x80 (NORMAL) or 0x10 (DIRECTORY).
Thanks Jeremy!
Derrell
(This used to be commit 54abf7d0e595e9cbeea115a40d4f7b995252a150)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/libsmbclient.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index fbcb7f64e2..2eb580a52d 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -4689,7 +4689,15 @@ dos_attr_parse(SMBCCTX *context, frame = talloc_stackframe(); while (next_token_talloc(frame, &p, &tok, "\t,\r\n")) { if (StrnCaseCmp(tok, "MODE:", 5) == 0) { - dad->mode = strtol(tok+5, NULL, 16); + long request = strtol(tok+5, NULL, 16); + if (request == 0) { + dad->mode = (request | + (IS_DOS_DIR(dad->mode) + ? FILE_ATTRIBUTE_DIRECTORY + : FILE_ATTRIBUTE_NORMAL)); + } else { + dad->mode = request; + } continue; } |