s3:smbd: preserve file type mode bits in file_set_dosmode()
authorMichael Adam <obnox@samba.org>
Tue, 19 Feb 2013 12:27:10 +0000 (13:27 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 19 Feb 2013 14:45:31 +0000 (15:45 +0100)
When translating between dos modes and unix modes, these bits were dropped from
the stat->st_ex_mode field.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 15:45:31 CET 2013 on sn-devel-104

source3/smbd/dosmode.c

index a98ac073f43be2616ce1d2ce80e6c06a9d28ed9d..1949006c1939b0b1b9a5679e019bf028d13699a8 100644 (file)
@@ -777,6 +777,9 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
 
        unixmode = unix_mode(conn, dosmode, smb_fname, parent_dir);
 
+       /* preserve the file type bits */
+       mask |= S_IFMT;
+
        /* preserve the s bits */
        mask |= (S_ISUID | S_ISGID);