****************************************************************************/
bool can_delete_file_in_directory(connection_struct *conn,
- struct smb_filename *smb_fname)
+ const struct smb_filename *smb_fname)
{
TALLOC_CTX *ctx = talloc_tos();
char *dname = NULL;
/* sticky bit means delete only by owner of file or by root or
* by owner of directory. */
if (smb_fname_parent->st.st_ex_mode & S_ISVTX) {
- if(SMB_VFS_STAT(conn, smb_fname) != 0) {
- if (errno == ENOENT) {
- /* If the file doesn't already exist then
- * yes we'll be able to delete it. */
- ret = true;
- goto out;
- }
- DEBUG(10,("can_delete_file_in_directory: can't "
- "stat file %s (%s)",
- smb_fname_str_dbg(smb_fname),
- strerror(errno) ));
- ret = false;
+ if (!VALID_STAT(smb_fname->st)) {
+ /* If the file doesn't already exist then
+ * yes we'll be able to delete it. */
+ ret = true;
goto out;
}
****************************************************************************/
static bool parent_override_delete(connection_struct *conn,
- struct smb_filename *smb_fname,
+ const struct smb_filename *smb_fname,
uint32_t access_mask,
uint32_t rejected_mask)
{
****************************************************************************/
NTSTATUS smbd_check_access_rights(struct connection_struct *conn,
- struct smb_filename *smb_fname,
+ const struct smb_filename *smb_fname,
uint32_t access_mask)
{
/* Check if we have rights to open. */
const struct smb_filename *smb_fname,
uint32_t access_mask);
bool can_delete_file_in_directory(connection_struct *conn,
- struct smb_filename *smb_fname);
+ const struct smb_filename *smb_fname);
bool can_access_file_data(connection_struct *conn,
const struct smb_filename *smb_fname,
uint32 access_mask);
/* The following definitions come from smbd/open.c */
NTSTATUS smbd_check_access_rights(struct connection_struct *conn,
- struct smb_filename *smb_fname,
+ const struct smb_filename *smb_fname,
uint32_t access_mask);
NTSTATUS fd_close(files_struct *fsp);
void change_file_owner_to_parent(connection_struct *conn,