check for EPERM or EACCESS in file_utime()
authorAndrew Tridgell <tridge@samba.org>
Tue, 21 Oct 1997 13:03:46 +0000 (13:03 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 21 Oct 1997 13:03:46 +0000 (13:03 +0000)
(This used to be commit afd7592ffd74fbc77f4b177b007291df95f418ef)

source3/smbd/server.c

index 28364d9c0c91b37bc27ace55390cc147423f0a7e..5f925df68721f05b5d4a3c0a0aee8ec114c3e9bd 100644 (file)
@@ -318,10 +318,15 @@ int file_utime(int cnum, char *fname, struct utimbuf *times)
   struct stat sb;
   int ret = -1;
 
+  errno = 0;
+
   if(sys_utime(fname, times) == 0)
     return 0;
 
-  if((errno != EPERM) || !lp_dos_filetimes(SNUM(cnum)))
+  if((errno != EPERM) && (errno != EACCESS))
+    return -1;
+
+  if(!lp_dos_filetimes(SNUM(cnum)))
     return -1;
 
   /* We have permission (given by the Samba admin) to