1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-09 01:44:21 +03:00

Remove indentation around code wrapped by unneeded CAN_WRITE.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Jeremy Allison
2013-04-25 14:00:42 -07:00
committed by Volker Lendecke
parent 0d88b37fc6
commit a91aac4a5f

View File

@@ -705,6 +705,7 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
int ret = -1, lret = -1; int ret = -1, lret = -1;
uint32_t old_mode; uint32_t old_mode;
struct timespec new_create_timespec; struct timespec new_create_timespec;
files_struct *fsp = NULL;
if (!CAN_WRITE(conn)) { if (!CAN_WRITE(conn)) {
errno = EROFS; errno = EROFS;
@@ -855,29 +856,25 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
bits on a file. Just like file_ntimes below. bits on a file. Just like file_ntimes below.
*/ */
/* Check if we have write access. */ /*
if (CAN_WRITE(conn)) { * We need to open the file with write access whilst
/* * still in our current user context. This ensures we
* We need to open the file with write access whilst * are not violating security in doing the fchmod.
* still in our current user context. This ensures we */
* are not violating security in doing the fchmod. if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname,
*/ &fsp)))
files_struct *fsp; return -1;
if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, become_root();
&fsp))) ret = SMB_VFS_FCHMOD(fsp, unixmode);
return -1; unbecome_root();
become_root(); close_file(NULL, fsp, NORMAL_CLOSE);
ret = SMB_VFS_FCHMOD(fsp, unixmode); if (!newfile) {
unbecome_root(); notify_fname(conn, NOTIFY_ACTION_MODIFIED,
close_file(NULL, fsp, NORMAL_CLOSE); FILE_NOTIFY_CHANGE_ATTRIBUTES,
if (!newfile) { smb_fname->base_name);
notify_fname(conn, NOTIFY_ACTION_MODIFIED, }
FILE_NOTIFY_CHANGE_ATTRIBUTES, if (ret == 0) {
smb_fname->base_name); smb_fname->st.st_ex_mode = unixmode;
}
if (ret == 0) {
smb_fname->st.st_ex_mode = unixmode;
}
} }
return( ret ); return( ret );