From 9297b975f58a6c8a8609e05d0bed7b4846a2be32 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Jul 2009 12:09:40 -0700 Subject: Fix the build breakage by #including modules/vfs_acl_common.c into acl_tdb and acl_xattr. Duplicates the code size, but keeps the code in common so I don't have to do bug fixes in two places (which is what I really cared about). Jeremy. --- source3/modules/vfs_acl_common.c | 35 ++++++++++++++++++++--------------- source3/modules/vfs_acl_tdb.c | 8 +++++--- source3/modules/vfs_acl_xattr.c | 9 ++++++--- 3 files changed, 31 insertions(+), 21 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index d8ff8c648e..5fdd2b4725 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -1,5 +1,6 @@ /* * Store Windows ACLs in data store - common functions. + * #included into modules/vfs_acl_xattr.c and modules/vfs_acl_tdb.c * * Copyright (C) Volker Lendecke, 2008 * Copyright (C) Jeremy Allison, 2009 @@ -18,21 +19,25 @@ * along with this program; if not, see . */ -/* NOTE: This is an experimental module, not yet finished. JRA. */ - -#include "includes.h" -#include "librpc/gen_ndr/xattr.h" -#include "librpc/gen_ndr/ndr_xattr.h" -#include "../lib/crypto/crypto.h" - -#undef DBGC_CLASS -#define DBGC_CLASS DBGC_VFS - static NTSTATUS create_acl_blob(const struct security_descriptor *psd, DATA_BLOB *pblob, uint16_t hash_type, uint8_t hash[XATTR_SD_HASH_SIZE]); +static NTSTATUS get_acl_blob(TALLOC_CTX *ctx, + vfs_handle_struct *handle, + files_struct *fsp, + const char *name, + DATA_BLOB *pblob); + +static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, + files_struct *fsp, + DATA_BLOB *pblob); + +static NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle, + const char *fname, + DATA_BLOB *pblob); + #define HASH_SECURITY_INFO (OWNER_SECURITY_INFORMATION | \ GROUP_SECURITY_INFORMATION | \ DACL_SECURITY_INFORMATION | \ @@ -438,7 +443,7 @@ static NTSTATUS inherit_new_acl(vfs_handle_struct *handle, Check ACL on open. For new files inherit from parent directory. *********************************************************************/ -int open_acl_common(vfs_handle_struct *handle, +static int open_acl_common(vfs_handle_struct *handle, struct smb_filename *smb_fname, files_struct *fsp, int flags, @@ -509,7 +514,7 @@ int open_acl_common(vfs_handle_struct *handle, return fsp->fh->fd; } -int mkdir_acl_common(vfs_handle_struct *handle, const char *path, mode_t mode) +static int mkdir_acl_common(vfs_handle_struct *handle, const char *path, mode_t mode) { struct smb_filename *smb_fname = NULL; int ret = SMB_VFS_NEXT_MKDIR(handle, path, mode); @@ -536,7 +541,7 @@ int mkdir_acl_common(vfs_handle_struct *handle, const char *path, mode_t mode) Fetch a security descriptor given an fsp. *********************************************************************/ -NTSTATUS fget_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS fget_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info, struct security_descriptor **ppdesc) { return get_nt_acl_internal(handle, fsp, @@ -547,7 +552,7 @@ NTSTATUS fget_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, Fetch a security descriptor given a pathname. *********************************************************************/ -NTSTATUS get_nt_acl_common(vfs_handle_struct *handle, +static NTSTATUS get_nt_acl_common(vfs_handle_struct *handle, const char *name, uint32_t security_info, struct security_descriptor **ppdesc) { return get_nt_acl_internal(handle, NULL, @@ -558,7 +563,7 @@ NTSTATUS get_nt_acl_common(vfs_handle_struct *handle, Store a security descriptor given an fsp. *********************************************************************/ -NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, +static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd) { NTSTATUS status; diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 07ad694a30..285c58ed9d 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -28,6 +28,8 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS +#include "modules/vfs_acl_common.c" + static unsigned int ref_count; static struct db_context *acl_db; @@ -135,7 +137,7 @@ static NTSTATUS acl_tdb_delete(vfs_handle_struct *handle, Pull a security descriptor into a DATA_BLOB from a tdb store. *******************************************************************/ -NTSTATUS get_acl_blob(TALLOC_CTX *ctx, +static NTSTATUS get_acl_blob(TALLOC_CTX *ctx, vfs_handle_struct *handle, files_struct *fsp, const char *name, @@ -193,7 +195,7 @@ NTSTATUS get_acl_blob(TALLOC_CTX *ctx, Store a DATA_BLOB into a tdb record given an fsp pointer. *******************************************************************/ -NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, +static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, files_struct *fsp, DATA_BLOB *pblob) { @@ -244,7 +246,7 @@ NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, Store a DATA_BLOB into a tdb record given a pathname. *******************************************************************/ -NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle, +static NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle, const char *fname, DATA_BLOB *pblob) { diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index d7711760ed..7a9cd27e5f 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -28,11 +28,14 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_VFS +/* Pull in the common functions. */ +#include "modules/vfs_acl_common.c" + /******************************************************************* Pull a security descriptor into a DATA_BLOB from a xattr. *******************************************************************/ -NTSTATUS get_acl_blob(TALLOC_CTX *ctx, +static NTSTATUS get_acl_blob(TALLOC_CTX *ctx, vfs_handle_struct *handle, files_struct *fsp, const char *name, @@ -90,7 +93,7 @@ NTSTATUS get_acl_blob(TALLOC_CTX *ctx, Store a DATA_BLOB into an xattr given an fsp pointer. *******************************************************************/ -NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, +static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, files_struct *fsp, DATA_BLOB *pblob) { @@ -128,7 +131,7 @@ NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle, Store a DATA_BLOB into an xattr given a pathname. *******************************************************************/ -NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle, +static NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle, const char *fname, DATA_BLOB *pblob) { -- cgit