mirror of
https://github.com/samba-team/samba.git
synced 2024-12-31 17:18:04 +03:00
4a7e483c51
This will fail with Failed to open file \@GMT-2015.10.31-19.40.30\subdir\hardlink. NT_STATUS_ACCESS_DENIED The open is failing in openat_pathref_fsp(): [2021/07/06 04:58:17.677104, 10, pid=95070, effective(1000, 1000), real(1000, 0)] ../../source3/smbd/files.c:541(openat_pathref_fsp) openat_pathref_fsp: file [subdir/hardlink {@GMT-2015.10.31-19.40.30}] - dev/ino mismatch. Old (dev=64770, ino=3826943444). New (dev=64770, ino=1746568660). [2021/07/06 04:58:17.677114, 10, pid=95070, effective(1000, 1000), real(1000, 0)] ../../source3/smbd/files.c:568(openat_pathref_fsp) openat_pathref_fsp: Opening pathref for [subdir/hardlink {@GMT-2015.10.31-19.40.30}] failed: NT_STATUS_ACCESS_DENIED The reason is subtle: shadow_copy2 calculates inode numbers of snapshot files based on the path of the file. The result of that when doing a path based stat() from filename_convert() was [2021/07/06 04:58:17.676159, 10, pid=95070, effective(1000, 1000), real(1000, 0)] ../../source3/smbd/filename.c:1945(filename_convert_internal) filename_convert_internal: XXX smb_fname [subdir/hardlink {@GMT-2015.10.31-19.40.30}] (dev=64770, ino=3826943444). which is the "Old" inode shown above. Later in the open code called from openat_pathref_fsp() -> fd_openat() -> non_widelink_open() since 4.14 we call SMB_VFS_FSTAT() where fsp->fsp_name will be set to the new relative *basename* of the file: [2021/07/06 04:58:17.676917, 10, pid=95070, effective(1000, 1000), real(1000, 0), class=vfs] ../../source3/modules/vfs_default.c:1302(vfswrap_fstat) vfswrap_fstat: XXX fsp [hardlink {@GMT-2015.10.31-19.40.30}] (dev=64770, ino=3826943444) So for stat() the hash function in called with the full path relative to the share root: subdir/hardlink while for fstat() the hash function will used hardlink BUG: https://bugzilla.samba.org/show_bug.cgi?id=14756 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> |
||
---|---|---|
.. | ||
tests | ||
count_80_col.pl | ||
creategroup | ||
fix_bool.pl | ||
format_indent.sh | ||
makeunicodecasemap.awk | ||
mknissmbpasswd.sh | ||
mknissmbpwdtbl.sh | ||
mksmbpasswd.sh | ||
mksyms.awk | ||
mksyms.sh | ||
scancvslog.pl | ||
smbaddshare | ||
smbchangeshare | ||
smbdeleteshare | ||
smbtar | ||
strip_trail_ws.pl | ||
updatesmbpasswd.sh | ||
wscript_build |