Fix bug #9587 - archive flag is always set on directories.
authorJeremy Allison <jra@samba.org>
Thu, 24 Jan 2013 19:02:30 +0000 (11:02 -0800)
committerDavid Disseldorp <ddiss@samba.org>
Fri, 25 Jan 2013 11:01:41 +0000 (12:01 +0100)
Creating a directory to a Samba share sets the attributes to 'D' only
(correct) - only when creating a new file should the 'A' attribute
be set.

However, doing a rename of that directory sets the 'A' attribute in error.
This should only be done on a file rename. smbclient regression test to follow.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source3/smbd/reply.c

index 6e1cd27803e66541c5be57a579895086d29badcb..64c4fdbe5929b8a38e3fdb89ef60d46a4502d8f8 100644 (file)
@@ -6416,7 +6416,8 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                          "%s -> %s\n", smb_fname_str_dbg(fsp->fsp_name),
                          smb_fname_str_dbg(smb_fname_dst)));
 
-               if (!lp_posix_pathnames() &&
+               if (!fsp->is_directory &&
+                   !lp_posix_pathnames() &&
                    (lp_map_archive(SNUM(conn)) ||
                    lp_store_dos_attributes(SNUM(conn)))) {
                        /* We must set the archive bit on the newly