Not yet used. Currently always conn->cwd_fsp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
return True;
}
- return can_write_to_file(conn, smb_fname);
+ return can_write_to_file(conn, dirfsp, smb_fname);
}
/*******************************************************************
} else if (ro_opts == MAP_READONLY_PERMISSIONS) {
/* Check actual permissions for read-only. */
if (!can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname))
{
result |= FILE_ATTRIBUTE_READONLY;
if (!set_dosmode_ok && lp_dos_filemode(SNUM(conn))) {
set_dosmode_ok = can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname);
}
*/
if (!can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname))
{
errno = EACCES;
/* Check if we have write access. */
if (can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname))
{
/* We are allowed to become root and change the filetime. */
****************************************************************************/
bool can_write_to_file(connection_struct *conn,
+ struct files_struct *dirfsp,
const struct smb_filename *smb_fname)
{
+ SMB_ASSERT(dirfsp == conn->cwd_fsp);
return NT_STATUS_IS_OK(smbd_check_access_rights(conn,
smb_fname,
false,
if (fsp->fsp_flags.is_directory ||
fsp->fsp_flags.can_write ||
can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname))
{
perms = FILE_GENERIC_ALL;
if (fsp->fsp_flags.is_directory ||
fsp->fsp_flags.can_write ||
can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname))
{
perms = FILE_GENERIC_ALL;
/* user has writeable permission */
if (lp_dos_filemode(SNUM(conn)) &&
can_write_to_file(conn,
+ conn->cwd_fsp,
smb_fname))
{
return true;
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 directory_has_default_acl(connection_struct *conn,
struct files_struct *dirfsp,