From 314dc23ecfb5fc014f9c2ef70bd508eb837632b0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Sep 2010 12:26:13 -0700 Subject: Fix bug #7693 - smbd changing mode of files on rename When using "map archive", don't change the archive bit on renames or writes with UNIX extensions turned on. Jeremy. --- source3/smbd/fileio.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/smbd/fileio.c') diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index b4e8a1d5d4..aec6554436 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -312,14 +312,15 @@ ssize_t write_file(struct smb_request *req, fsp->modified = True; if (SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) == 0) { - int dosmode; trigger_write_time_update(fsp); - dosmode = dos_mode(fsp->conn, fsp->fsp_name); - if ((lp_store_dos_attributes(SNUM(fsp->conn)) || - MAP_ARCHIVE(fsp->conn)) && - !IS_DOS_ARCHIVE(dosmode)) { - file_set_dosmode(fsp->conn, fsp->fsp_name, + if (!fsp->posix_open && + (lp_store_dos_attributes(SNUM(fsp->conn)) || + MAP_ARCHIVE(fsp->conn))) { + int dosmode = dos_mode(fsp->conn, fsp->fsp_name); + if (!IS_DOS_ARCHIVE(dosmode)) { + file_set_dosmode(fsp->conn, fsp->fsp_name, dosmode | aARCH, NULL, false); + } } /* -- cgit