Behaviour mismatch between "store dos attributes" and "map archive" from man smb.conf(5)
Jeremy Allison
jra at samba.org
Thu May 14 04:49:32 UTC 2020
On Thu, May 14, 2020 at 01:36:12AM +0200, Michael Adam wrote:
> Two questions remain:
>
> - Should we implement the behavior stated in the manpage?
> (I think yes!)
Attached is the naieve patch to do that (change us
to manpage behavior). I'm willing to bet it breaks
a bunch of tests (and possibly user expectations)
though...
-------------- next part --------------
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 9bb8d1c1941..782d9206dbb 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -170,14 +170,16 @@ mode_t unix_mode(connection_struct *conn, int dosmode,
result |= lp_force_directory_mode(SNUM(conn));
}
} else {
- if (lp_map_archive(SNUM(conn)) && IS_DOS_ARCHIVE(dosmode))
- result |= S_IXUSR;
+ if (!lp_store_dos_attributes(SNUM(conn))) {
+ if (lp_map_archive(SNUM(conn)) && IS_DOS_ARCHIVE(dosmode))
+ result |= S_IXUSR;
- if (lp_map_system(SNUM(conn)) && IS_DOS_SYSTEM(dosmode))
- result |= S_IXGRP;
+ if (lp_map_system(SNUM(conn)) && IS_DOS_SYSTEM(dosmode))
+ result |= S_IXGRP;
- if (lp_map_hidden(SNUM(conn)) && IS_DOS_HIDDEN(dosmode))
- result |= S_IXOTH;
+ if (lp_map_hidden(SNUM(conn)) && IS_DOS_HIDDEN(dosmode))
+ result |= S_IXOTH;
+ }
if (dir_mode) {
/* Inherit 666 component of parent directory mode */
More information about the samba-technical
mailing list