Make new parameter addition clearer.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
}
} else if (ro_opts == MAP_READONLY_PERMISSIONS) {
/* Check actual permissions for read-only. */
}
} else if (ro_opts == MAP_READONLY_PERMISSIONS) {
/* Check actual permissions for read-only. */
- if (!can_write_to_file(conn, smb_fname)) {
+ if (!can_write_to_file(conn,
+ smb_fname))
+ {
result |= FILE_ATTRIBUTE_READONLY;
}
} /* Else never set the readonly bit. */
result |= FILE_ATTRIBUTE_READONLY;
}
} /* Else never set the readonly bit. */
}
if (!set_dosmode_ok && lp_dos_filemode(SNUM(conn))) {
}
if (!set_dosmode_ok && lp_dos_filemode(SNUM(conn))) {
- set_dosmode_ok = can_write_to_file(conn, smb_fname);
+ set_dosmode_ok = can_write_to_file(conn,
+ smb_fname);
bits on a file. Just like file_ntimes below.
*/
bits on a file. Just like file_ntimes below.
*/
- if (!can_write_to_file(conn, smb_fname)) {
+ if (!can_write_to_file(conn,
+ smb_fname))
+ {
errno = EACCES;
return -1;
}
errno = EACCES;
return -1;
}
*/
/* Check if we have write access. */
*/
/* Check if we have write access. */
- if (can_write_to_file(conn, smb_fname)) {
+ if (can_write_to_file(conn,
+ smb_fname))
+ {
/* We are allowed to become root and change the filetime. */
become_root();
ret = SMB_VFS_NTIMES(conn, smb_fname, ft);
/* We are allowed to become root and change the filetime. */
become_root();
ret = SMB_VFS_NTIMES(conn, smb_fname, ft);
****************************************************************************/
bool can_write_to_file(connection_struct *conn,
****************************************************************************/
bool can_write_to_file(connection_struct *conn,
- const struct smb_filename *smb_fname)
+ const struct smb_filename *smb_fname)
{
return NT_STATUS_IS_OK(smbd_check_access_rights(conn,
smb_fname,
{
return NT_STATUS_IS_OK(smbd_check_access_rights(conn,
smb_fname,
p += 25;
if (fsp->fsp_flags.is_directory ||
fsp->fsp_flags.can_write ||
p += 25;
if (fsp->fsp_flags.is_directory ||
fsp->fsp_flags.can_write ||
- can_write_to_file(conn, smb_fname)) {
+ can_write_to_file(conn,
+ smb_fname))
+ {
perms = FILE_GENERIC_ALL;
} else {
perms = FILE_GENERIC_READ|FILE_EXECUTE;
perms = FILE_GENERIC_ALL;
} else {
perms = FILE_GENERIC_READ|FILE_EXECUTE;
p += 25;
if (fsp->fsp_flags.is_directory ||
fsp->fsp_flags.can_write ||
p += 25;
if (fsp->fsp_flags.is_directory ||
fsp->fsp_flags.can_write ||
- can_write_to_file(conn, smb_fname)) {
+ can_write_to_file(conn,
+ smb_fname))
+ {
perms = FILE_GENERIC_ALL;
} else {
perms = FILE_GENERIC_READ|FILE_EXECUTE;
perms = FILE_GENERIC_ALL;
} else {
perms = FILE_GENERIC_READ|FILE_EXECUTE;
/* user has writeable permission */
if (lp_dos_filemode(SNUM(conn)) &&
/* user has writeable permission */
if (lp_dos_filemode(SNUM(conn)) &&
- can_write_to_file(conn, smb_fname)) {
+ can_write_to_file(conn,
+ smb_fname))
+ {
struct files_struct *dirfsp,
const struct smb_filename *smb_fname);
bool can_write_to_file(connection_struct *conn,
struct files_struct *dirfsp,
const struct smb_filename *smb_fname);
bool can_write_to_file(connection_struct *conn,
- const struct smb_filename *smb_fname);
+ const struct smb_filename *smb_fname);
bool directory_has_default_acl(connection_struct *conn,
struct files_struct *dirfsp,
struct smb_filename *smb_fname);
bool directory_has_default_acl(connection_struct *conn,
struct files_struct *dirfsp,
struct smb_filename *smb_fname);