diff options
author | Jeremy Allison <jra@samba.org> | 2017-05-23 10:40:47 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2017-06-18 02:49:24 +0200 |
commit | 0037815453fa6141d3c0325c3ab197326324ab53 (patch) | |
tree | ae4e2c3ce95ad38c9eec5dbaf492c04aee636a34 /source3/modules/vfs_cap.c | |
parent | 730de8e091879a53493a0c96b542603cd52174a2 (diff) | |
download | samba-0037815453fa6141d3c0325c3ab197326324ab53.tar.gz |
s3: VFS: Change SMB_VFS_DISK_FREE to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Diffstat (limited to 'source3/modules/vfs_cap.c')
-rw-r--r-- | source3/modules/vfs_cap.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index eba58961926..cf3bb94498c 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -29,16 +29,31 @@ static char *capencode(TALLOC_CTX *ctx, const char *from); static char *capdecode(TALLOC_CTX *ctx, const char *from); -static uint64_t cap_disk_free(vfs_handle_struct *handle, const char *path, - uint64_t *bsize, uint64_t *dfree, uint64_t *dsize) +static uint64_t cap_disk_free(vfs_handle_struct *handle, + const struct smb_filename *smb_fname, + uint64_t *bsize, + uint64_t *dfree, + uint64_t *dsize) { - char *cappath = capencode(talloc_tos(), path); + char *capname = capencode(talloc_tos(), smb_fname->base_name); + struct smb_filename *cap_smb_fname = NULL; - if (!cappath) { + if (!capname) { + errno = ENOMEM; + return (uint64_t)-1; + } + cap_smb_fname = synthetic_smb_fname(talloc_tos(), + capname, + NULL, + NULL, + smb_fname->flags); + if (cap_smb_fname == NULL) { + TALLOC_FREE(capname); errno = ENOMEM; return (uint64_t)-1; } - return SMB_VFS_NEXT_DISK_FREE(handle, cappath, bsize, dfree, dsize); + return SMB_VFS_NEXT_DISK_FREE(handle, cap_smb_fname, + bsize, dfree, dsize); } static int cap_get_quota(vfs_handle_struct *handle, const char *path, |