]> git.ipfire.org Git - thirdparty/samba.git/commit
vfs: Rewrite vfs_streams_depot
authorVolker Lendecke <vl@samba.org>
Fri, 3 Jan 2025 14:24:01 +0000 (15:24 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 5 Mar 2025 17:41:34 +0000 (17:41 +0000)
commitd7879ef848ababcfdb23f1cdfcce0044e438d2ba
tree5dd677f3bdae73930bfc8064ed777d092941130b
parentb1748dcc0add1e7455bb32490dcfb313dc82d491
vfs: Rewrite vfs_streams_depot

This started when I found vfs_streams_depot() is the last user of
recursive_rmdir() and ended as a pretty complete rewrite. Why? This
new version does not call the path-based NEXT_[L]STAT routines
anymore, it only uses FSTATAT. This is one tiny step towards getting
rid of the path-based calls we still have that implicitly depend on
the current working directory. In some distant future I want to get
rid of our chdir() calls and do everything relative to a O_PATH handle
that we opened on the share root when connecting to a share.

This patch removes a few lines, and I don't see a reasonable way to do
this in micro-steps. Structurally it should be simple though:
Everything works off streams_depot_rootdir_pathref(), which gives a
pathref fsp to the ".streams" directory, stream_dir_pathref() turns
this into a pathref of the actual per-file subdirectory.

We also have to remove the special handling of absolute paths in
vfs_shadow_copy2, streams_depot does not send absolute paths anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_streams_depot.c