mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
r23906: Fix POSIX unlink bug found by Steve. If we
used lstat during the open (which we always do for POSIX) then use lstat for the unlink. Jeremy. (This used to be commit 4aad77c27cc277e3d937f674ee620729411e3eaf)
This commit is contained in:
parent
f798837c23
commit
b3d471d367
@ -154,6 +154,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
|
||||
struct share_mode_lock *lck;
|
||||
SMB_STRUCT_STAT sbuf;
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
int ret;
|
||||
struct file_id id;
|
||||
|
||||
/*
|
||||
@ -247,8 +248,14 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
|
||||
|
||||
/* We can only delete the file if the name we have is still valid and
|
||||
hasn't been renamed. */
|
||||
|
||||
if(SMB_VFS_STAT(conn,fsp->fsp_name,&sbuf) != 0) {
|
||||
|
||||
if (fsp->posix_open) {
|
||||
ret = SMB_VFS_LSTAT(conn,fsp->fsp_name,&sbuf);
|
||||
} else {
|
||||
ret = SMB_VFS_STAT(conn,fsp->fsp_name,&sbuf);
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
DEBUG(5,("close_remove_share_mode: file %s. Delete on close "
|
||||
"was set and stat failed with error %s\n",
|
||||
fsp->fsp_name, strerror(errno) ));
|
||||
|
Loading…
x
Reference in New Issue
Block a user