The branch, master has been updated via b542d1c build:wafsamba: fix a typo via 8a19314 vfs_ceph: add empty ACL callbacks via 628fa5b vfs_ceph: use 'file descriptor' version xattr functions when possible from 12309f8 ctdb: check for talloc_asprintf() failure
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit b542d1c83fd84d43e9441c28b80194964ec9bc73 Author: Michael Adam <ob...@samba.org> Date: Wed Apr 1 12:56:05 2015 +0200 build:wafsamba: fix a typo Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Ira Cooper <i...@samba.org> Autobuild-User(master): Michael Adam <ob...@samba.org> Autobuild-Date(master): Thu Apr 2 16:39:01 CEST 2015 on sn-devel-104 commit 8a1931413210db79fd671535ec4ba289dee7f710 Author: Yan, Zheng <z...@redhat.com> Date: Thu Apr 2 10:11:03 2015 +0800 vfs_ceph: add empty ACL callbacks If a vfs module has no ACL callbacks, smbd will use its default ACL callbacks. These default ACL callbacks operate on local filesytem, it's clearly wrong for ceph case. libcephfs does not support ACL yet, so this patch adds ACL callbacks that do nothing. Signed-off-by: Yan, Zheng <z...@redhat.com> Reviewed-by: Ira Cooper <i...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> commit 628fa5bc00d8ef7593398f3dfa2af6652013f12f Author: Yan, Zheng <z...@redhat.com> Date: Thu Apr 2 10:11:02 2015 +0800 vfs_ceph: use 'file descriptor' version xattr functions when possible libcephfs version 0.94 adds 'file descriptor' version xattr functions. This patch makes corresponding samba VFS callbacks use these new functions. Signed-off-by: Yan, Zheng <z...@redhat.com> Reviewed-by: Ira Cooper <i...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/wscript | 6 ++-- source3/modules/vfs_ceph.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 3180543..694147e 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -41,10 +41,10 @@ def set_options(opt): help=("comma separated list of libraries to not apply extension to [%s]" % extension_exception), action="store", dest='PRIVATE_EXTENSION_EXCEPTION', default=extension_exception) - builtin_defauilt = Options.options['BUILTIN_LIBRARIES_DEFAULT'] + builtin_default = Options.options['BUILTIN_LIBRARIES_DEFAULT'] gr.add_option('--builtin-libraries', - help=("command separated list of libraries to build directly into binaries [%s]" % builtin_defauilt), - action="store", dest='BUILTIN_LIBRARIES', default=builtin_defauilt) + help=("command separated list of libraries to build directly into binaries [%s]" % builtin_default), + action="store", dest='BUILTIN_LIBRARIES', default=builtin_default) gr.add_option('--minimum-library-version', help=("list of minimum system library versions (LIBNAME1:version,LIBNAME2:version)"), diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index b3e334e..409189b 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -40,6 +40,11 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS +#ifndef LIBCEPHFS_VERSION +#define LIBCEPHFS_VERSION(maj, min, extra) ((maj << 16) + (min << 8) + extra) +#define LIBCEPHFS_VERSION_CODE LIBCEPHFS_VERSION(0, 0, 0) +#endif + /* * Use %llu whenever we have a 64bit unsigned int, and cast to (long long unsigned) */ @@ -1071,7 +1076,11 @@ static ssize_t cephwrap_fgetxattr(struct vfs_handle_struct *handle, struct files { int ret; DEBUG(10, ("[CEPH] fgetxattr(%p, %p, %s, %p, %llu)\n", handle, fsp, name, value, llu(size))); +#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0) + ret = ceph_fgetxattr(handle->data, fsp->fh->fd, name, value, size); +#else ret = ceph_getxattr(handle->data, fsp->fsp_name->base_name, name, value, size); +#endif DEBUG(10, ("[CEPH] fgetxattr(...) = %d\n", ret)); if (ret < 0) { WRAP_RETURN(ret); @@ -1112,7 +1121,11 @@ static ssize_t cephwrap_flistxattr(struct vfs_handle_struct *handle, struct file { int ret; DEBUG(10, ("[CEPH] flistxattr(%p, %p, %s, %llu)\n", handle, fsp, list, llu(size))); +#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0) + ret = ceph_flistxattr(handle->data, fsp->fh->fd, list, size); +#else ret = ceph_listxattr(handle->data, fsp->fsp_name->base_name, list, size); +#endif DEBUG(10, ("[CEPH] flistxattr(...) = %d\n", ret)); if (ret < 0) { WRAP_RETURN(ret); @@ -1134,7 +1147,11 @@ static int cephwrap_fremovexattr(struct vfs_handle_struct *handle, struct files_ { int ret; DEBUG(10, ("[CEPH] fremovexattr(%p, %p, %s)\n", handle, fsp, name)); +#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0) + ret = ceph_fremovexattr(handle->data, fsp->fh->fd, name); +#else ret = ceph_removexattr(handle->data, fsp->fsp_name->base_name, name); +#endif DEBUG(10, ("[CEPH] fremovexattr(...) = %d\n", ret)); WRAP_RETURN(ret); } @@ -1152,7 +1169,12 @@ static int cephwrap_fsetxattr(struct vfs_handle_struct *handle, struct files_str { int ret; DEBUG(10, ("[CEPH] fsetxattr(%p, %p, %s, %p, %llu, %d)\n", handle, fsp, name, value, llu(size), flags)); +#if LIBCEPHFS_VERSION_CODE >= LIBCEPHFS_VERSION(0, 94, 0) + ret = ceph_fsetxattr(handle->data, fsp->fh->fd, + name, value, size, flags); +#else ret = ceph_setxattr(handle->data, fsp->fsp_name->base_name, name, value, size, flags); +#endif DEBUG(10, ("[CEPH] fsetxattr(...) = %d\n", ret)); WRAP_RETURN(ret); } @@ -1183,6 +1205,47 @@ static int cephwrap_set_offline(struct vfs_handle_struct *handle, return -1; } +static SMB_ACL_T cephwrap_sys_acl_get_file(struct vfs_handle_struct *handle, + const char *path_p, + SMB_ACL_TYPE_T type, + TALLOC_CTX *mem_ctx) +{ + errno = ENOTSUP; + return NULL; +} + +static SMB_ACL_T cephwrap_sys_acl_get_fd(struct vfs_handle_struct *handle, + struct files_struct *fsp, + TALLOC_CTX *mem_ctx) +{ + errno = ENOTSUP; + return NULL; +} + +static int cephwrap_sys_acl_set_file(struct vfs_handle_struct *handle, + const char *name, + SMB_ACL_TYPE_T acltype, + SMB_ACL_T theacl) +{ + errno = ENOTSUP; + return -1; +} + +static int cephwrap_sys_acl_set_fd(struct vfs_handle_struct *handle, + struct files_struct *fsp, + SMB_ACL_T theacl) +{ + errno = ENOTSUP; + return -1; +} + +static int cephwrap_sys_acl_delete_def_file(struct vfs_handle_struct *handle, + const char *path) +{ + errno = ENOTSUP; + return -1; +} + static struct vfs_fn_pointers ceph_fns = { /* Disk operations */ @@ -1255,6 +1318,13 @@ static struct vfs_fn_pointers ceph_fns = { .setxattr_fn = cephwrap_setxattr, .fsetxattr_fn = cephwrap_fsetxattr, + /* Posix ACL Operations */ + .sys_acl_get_file_fn = cephwrap_sys_acl_get_file, + .sys_acl_get_fd_fn = cephwrap_sys_acl_get_fd, + .sys_acl_set_file_fn = cephwrap_sys_acl_set_file, + .sys_acl_set_fd_fn = cephwrap_sys_acl_set_fd, + .sys_acl_delete_def_file_fn = cephwrap_sys_acl_delete_def_file, + /* aio operations */ .aio_force_fn = cephwrap_aio_force, -- Samba Shared Repository