Skip to content

Commit

Permalink
Bugfix: VFS module for Samba 4.15 only logged basename (instead of fu…
Browse files Browse the repository at this point in the history
…ll path) for rename (mv), (sym)link, delete (unlink) and rmdir

Fixes #297
  • Loading branch information
gboudreau committed May 17, 2022
1 parent 43994bd commit 1e7e0c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Binary file modified samba-module/bin/4.15/greyhole-arm64.so
Binary file not shown.
Binary file modified samba-module/bin/4.15/greyhole-i386.so
Binary file not shown.
Binary file modified samba-module/bin/4.15/greyhole-x86_64.so
Binary file not shown.
18 changes: 12 additions & 6 deletions samba-module/vfs_greyhole-samba-4.15.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,12 @@ static int greyhole_renameat(vfs_handle_struct *handle, files_struct *srcfsp, co
result = SMB_VFS_NEXT_RENAMEAT(handle, srcfsp, oldname, dstfsp, newname);

if (result >= 0) {
gh_spoolf("rename\n%s\n%s\n%s\n\n",
gh_spoolf("rename\n%s\n%s/%s\n%s/%s\n\n",
lp_servicename(talloc_tos(), lp_sub, handle->conn->params->service),
oldname->base_name,
newname->base_name);
smb_fname_str(srcfsp->fsp_name),
oldname->base_name,
smb_fname_str(dstfsp->fsp_name),
newname->base_name);
}

return result;
Expand All @@ -455,9 +457,11 @@ static int greyhole_linkat(vfs_handle_struct *handle, files_struct *srcfsp, cons
result = SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldname, dstfsp, newname, flags);

if (result >= 0) {
gh_spoolf("link\n%s\n%s\n%s\n\n",
gh_spoolf("link\n%s\n%s/%s\n%s/%s\n\n",
lp_servicename(talloc_tos(), lp_sub, handle->conn->params->service),
smb_fname_str(srcfsp->fsp_name),
oldname->base_name,
smb_fname_str(dstfsp->fsp_name),
newname->base_name);
}

Expand All @@ -473,12 +477,14 @@ static int greyhole_unlinkat(vfs_handle_struct *handle, struct files_struct *dir

if (result >= 0) {
if (flags & AT_REMOVEDIR) {
gh_spoolf("rmdir\n%s\n%s\n\n",
gh_spoolf("rmdir\n%s\n%s/%s\n\n",
lp_servicename(talloc_tos(), lp_sub, handle->conn->params->service),
smb_fname_str(dirfsp->fsp_name),
smb_fname->base_name);
} else {
gh_spoolf("unlink\n%s\n%s\n\n",
gh_spoolf("unlink\n%s\n%s/%s\n\n",
lp_servicename(talloc_tos(), lp_sub, handle->conn->params->service),
smb_fname_str(dirfsp->fsp_name),
smb_fname->base_name);
}
}
Expand Down

0 comments on commit 1e7e0c2

Please sign in to comment.