From d25ba3f5a6266c2787ab2cc6b17e0d3cde2e33a9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 6 May 2013 14:10:15 -0700 Subject: Allow "store dos attributes" to override the other "map XXX" parameters. Makes us consistent with what is described in the man pages. Signed-off-by: Jeremy Allison Reviewed-by: Andrew Bartlett --- source3/smbd/dosmode.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index b5346261ce..04d27c7a2e 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -354,10 +354,6 @@ static bool set_ea_dos_attribute(connection_struct *conn, enum ndr_err_code ndr_err; DATA_BLOB blob; - if (!lp_store_dos_attributes(SNUM(conn))) { - return False; - } - ZERO_STRUCT(dosattrib); ZERO_STRUCT(blob); @@ -773,7 +769,14 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, } #endif /* Store the DOS attributes in an EA by preference. */ - if (set_ea_dos_attribute(conn, smb_fname, dosmode)) { + if (lp_store_dos_attributes(SNUM(conn))) { + /* + * Don't fall back to using UNIX modes. Finally + * follow the smb.conf manpage. + */ + if (!set_ea_dos_attribute(conn, smb_fname, dosmode)) { + return -1; + } if (!newfile) { notify_fname(conn, NOTIFY_ACTION_MODIFIED, FILE_NOTIFY_CHANGE_ATTRIBUTES, -- cgit