mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3: VFS: streams_depot. Allow unlinkat to cope with dangling symlinks.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14879 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
942123b959
commit
295d7d026b
@ -823,6 +823,16 @@ static int streams_depot_unlink_internal(vfs_handle_struct *handle,
|
||||
ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);
|
||||
} else {
|
||||
ret = SMB_VFS_NEXT_STAT(handle, full_fname);
|
||||
if (ret == -1 && (errno == ENOENT || errno == ELOOP)) {
|
||||
if (VALID_STAT(smb_fname->st) &&
|
||||
S_ISLNK(smb_fname->st.st_ex_mode)) {
|
||||
/*
|
||||
* Original name was a link - Could be
|
||||
* trying to remove a dangling symlink.
|
||||
*/
|
||||
ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ret == -1) {
|
||||
TALLOC_FREE(full_fname);
|
||||
|
Loading…
Reference in New Issue
Block a user