Allow "store dos attributes" to override the other "map XXX" parameters.
authorJeremy Allison <jra@samba.org>
Mon, 6 May 2013 21:10:15 +0000 (14:10 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 6 May 2013 21:37:20 +0000 (23:37 +0200)
Makes us consistent with what is described in the man pages.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/dosmode.c

index b5346261ced8ca2565c1de6d63dce44f0c8fc833..04d27c7a2eb4e6c268bf5758b6cbe1ae52966967 100644 (file)
@@ -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,