summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/reply.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 66bbce064f..e00d8d99a5 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -979,7 +979,6 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
{
pstring fname;
int outsize = 0;
- BOOL ok=False;
int mode;
time_t mtime;
SMB_STRUCT_STAT sbuf;
@@ -1022,15 +1021,14 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
else
mode &= ~aDIR;
- ok = (file_set_dosmode(conn,fname,mode,&sbuf,False) == 0);
- } else {
- ok = True;
+ if (file_set_dosmode(conn,fname,mode,&sbuf,False) != 0) {
+ END_PROFILE(SMBsetatr);
+ return set_bad_path_error(errno, False, outbuf,
+ ERRDOS, ERRnoaccess);
+ }
}
- if (ok)
- ok = set_filetime(conn,fname,mtime);
-
- if (!ok) {
+ if (!set_filetime(conn,fname,mtime)) {
END_PROFILE(SMBsetatr);
return set_bad_path_error(errno, False, outbuf,
ERRDOS, ERRnoaccess);