From 2b788aa6ce41c5c0a6892cb412cf40a7cbc73f2a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Nov 2010 16:29:26 -0800 Subject: Move the uglyness of #ifdef REALPATH_TAKES_NULL into the vfs_default module, change the signature of VFS_REALPATH to always return a malloc'ed string. Needed to make some privileges work I plan on doing shortly easier to code. Jeremy. Autobuild-User: Jeremy Allison Autobuild-Date: Sat Nov 20 02:15:50 CET 2010 on sn-devel-104 --- source3/include/vfs.h | 7 ++++--- source3/include/vfs_macros.h | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 9ec4c3ec69..9121069a27 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -126,6 +126,8 @@ /* Leave at 27 - not yet released. Add translate_name VFS call to convert UNIX names to Windows supported names -- asrinivasan. */ /* Changed to version 28 - Add private_flags uint32_t to CREATE call. */ +/* Leave at 28 - not yet released. Change realpath to assume NULL and return a + malloc'ed path. JRA. */ #define SMB_VFS_INTERFACE_VERSION 28 @@ -257,7 +259,7 @@ struct vfs_fn_pointers { int (*vfs_readlink)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz); int (*link)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); int (*mknod)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); - char *(*realpath)(struct vfs_handle_struct *handle, const char *path, char *resolved_path); + char *(*realpath)(struct vfs_handle_struct *handle, const char *path); NTSTATUS (*notify_watch)(struct vfs_handle_struct *handle, struct sys_notify_context *ctx, struct notify_entry *e, @@ -619,8 +621,7 @@ int smb_vfs_call_link(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath); int smb_vfs_call_mknod(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev); -char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, - const char *path, char *resolved_path); +char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path); NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle, struct sys_notify_context *ctx, struct notify_entry *e, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 4472e3a52a..5b38e64cbf 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -289,10 +289,10 @@ #define SMB_VFS_NEXT_MKNOD(handle, path, mode, dev) \ smb_vfs_call_mknod((handle)->next, (path), (mode), (dev)) -#define SMB_VFS_REALPATH(conn, path, resolved_path) \ - smb_vfs_call_realpath((conn)->vfs_handles, (path), (resolved_path)) -#define SMB_VFS_NEXT_REALPATH(handle, path, resolved_path) \ - smb_vfs_call_realpath((handle)->next, (path), (resolved_path)) +#define SMB_VFS_REALPATH(conn, path) \ + smb_vfs_call_realpath((conn)->vfs_handles, (path)) +#define SMB_VFS_NEXT_REALPATH(handle, path) \ + smb_vfs_call_realpath((handle)->next, (path)) #define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \ smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (e), (callback), (private_data), (handle_p)) -- cgit