1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/source3/script
Volker Lendecke 8d00b0e664 smbd: Simplify openat_pathref_fsp_case_insensitive()
This is more lines of code, but it's still a simplification. With this
patch we don't call the full openat_pathref_fsp() anymore when looking
up the last component in filename_convert_dirfsp(), instead we do the
direct SMB_VFS_OPENAT(). We don't need the whole complexity of
non_widelink_open() for this case, we do know that we have a real
non-cwd dirfsp.

The other big change that is not obvious just from looking at the
patch: This removes the special case for looking up posix
symlinks. Before this patch, filename_convert_dirfsp() returned a
proper smb_filename but without an attached fsp when a smb1 posix
client hits a symlink. This caused all sorts of special case code
everywhere. For example smbd_do_qfilepathinfo() needs to cover both
cases just for the smb1 posix symlink case. This special-case handling
can go now. We can do the path lookup in the smb1-only qpathinfo code
and call into the common code with a proper fsp.

When hitting a symlink and with O_PATH available, we'll get the
symlink opened with an O_PATH fd. Without O_PATH we obviously can't do
that, there we get fd=-1 and an indication that we don't have the
procfd fallback around.

Why all this?

I want to present FIFOs (and eventually symlinks) as reparse points as
the very next step. Without this patch, there is no real unified way
to get the file attributes from disk. Now we can use the proper logic
of fdos_mode() everywhere and not rely on special cases for fsp==NULL.

This patch also changes some error codes for smb1 posix extensions. I
chose to just change the test instead of going after each and every
change. As long as we do get an error, I'm willing to accept that we
slightly change error path behaviour for this deprecated code.

And, I tried to split this up into smaller patches but I failed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2023-11-07 12:46:37 +00:00
..
tests smbd: Simplify openat_pathref_fsp_case_insensitive() 2023-11-07 12:46:37 +00:00
count_80_col.pl
creategroup s3:script: Reformat shell scripts 2022-03-03 01:53:16 +00:00
fix_bool.pl
format_indent.sh s3:script: Fix code spelling 2023-07-19 09:58:37 +00:00
makeunicodecasemap.awk
mknissmbpasswd.sh s3:script: Reformat shell scripts 2022-03-03 01:53:16 +00:00
mknissmbpwdtbl.sh s3:script: Reformat shell scripts 2022-03-03 01:53:16 +00:00
mksmbpasswd.sh
mksyms.awk
mksyms.sh s3:script: Fix shellcheck errors in mksyms.sh 2022-08-22 14:20:36 +00:00
samba-log-parser s3:script: Replace --merge by --merge-by-timestamp in samba-log-parser 2023-07-20 19:14:05 +00:00
scancvslog.pl
smbaddshare Remove some bashisms from the test scripts 2018-02-19 07:36:23 +01:00
smbchangeshare Remove some bashisms from the test scripts 2018-02-19 07:36:23 +01:00
smbdeleteshare Remove some bashisms from the test scripts 2018-02-19 07:36:23 +01:00
smbtar s3:script: Reformat shell scripts 2022-03-03 01:53:16 +00:00
strip_trail_ws.pl
updatesmbpasswd.sh
wscript_build s3:script: Add samba-log-parser 2023-06-07 14:12:33 +00:00