diff options
-rw-r--r-- | source3/smbd/server.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 6fe89b8e95..28364d9c0c 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -334,20 +334,18 @@ int file_utime(int cnum, char *fname, struct utimbuf *times) return -1; /* Check if we have write access. */ - if (CAN_WRITE(cnum) && !lp_alternate_permissions(SNUM(cnum))) - { - if (((sb.st_mode & S_IWOTH) || - Connections[cnum].admin_user || - ((sb.st_mode & S_IWUSR) && current_user.uid==sb.st_uid) || - ((sb.st_mode & S_IWGRP) && - in_group(sb.st_gid,current_user.gid, - current_user.ngroups,current_user.igroups)))) - { - /* We are allowed to become root and change the filetime. */ - become_root(False); - ret = sys_utime(fname, times); - unbecome_root(False); - } + if (CAN_WRITE(cnum)) { + if (((sb.st_mode & S_IWOTH) || + Connections[cnum].admin_user || + ((sb.st_mode & S_IWUSR) && current_user.uid==sb.st_uid) || + ((sb.st_mode & S_IWGRP) && + in_group(sb.st_gid,current_user.gid, + current_user.ngroups,current_user.igroups)))) { + /* We are allowed to become root and change the filetime. */ + become_root(False); + ret = sys_utime(fname, times); + unbecome_root(False); + } } return ret; |