summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2008-02-06 09:10:50 +0300
committerAlexander Bokovoy <ab@samba.org>2008-02-06 09:10:50 +0300
commita4436154b8ce446e84e6c07bd9c69edfafe1b68c (patch)
treee70d3e771f99fa9d840bdb2fca4b1d5f41f2bb72 /source3/smbd
parent1ae0f2d02ea5909fbb8cfa7c0d78291048699b9c (diff)
downloadsamba-a4436154b8ce446e84e6c07bd9c69edfafe1b68c.tar.gz
samba-a4436154b8ce446e84e6c07bd9c69edfafe1b68c.tar.bz2
samba-a4436154b8ce446e84e6c07bd9c69edfafe1b68c.zip
Change the file time before we change the file mode.
This doesn't matter for most applications, but for offline files it matters as it allows you to set files offline from windows clients even with HSM systems that refuse to offline newly created files. Merge from Tridge's v3-0-ctdb tree. (This used to be commit 7da6c675440b0253ab37ee6097f769a2e45c7b7b)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index bced8ed984..baebff83de 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1110,6 +1110,12 @@ void reply_setatr(struct smb_request *req)
mode = SVAL(req->inbuf,smb_vwv0);
mtime = srv_make_unix_date3(req->inbuf+smb_vwv1);
+ if (!set_filetime(conn,fname,convert_time_t_to_timespec(mtime))) {
+ reply_unixerror(req, ERRDOS, ERRnoaccess);
+ END_PROFILE(SMBsetatr);
+ return;
+ }
+
if (mode != FILE_ATTRIBUTE_NORMAL) {
if (VALID_STAT_OF_DIR(sbuf))
mode |= aDIR;
@@ -1123,12 +1129,6 @@ void reply_setatr(struct smb_request *req)
}
}
- if (!set_filetime(conn,fname,convert_time_t_to_timespec(mtime))) {
- reply_unixerror(req, ERRDOS, ERRnoaccess);
- END_PROFILE(SMBsetatr);
- return;
- }
-
reply_outbuf(req, 0, 0);
DEBUG( 3, ( "setatr name=%s mode=%d\n", fname, mode ) );