Fix the build breakage by #including modules/vfs_acl_common.c
authorJeremy Allison <jra@samba.org>
Mon, 27 Jul 2009 19:09:40 +0000 (12:09 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 27 Jul 2009 19:09:40 +0000 (12:09 -0700)
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/Makefile.in
source3/include/proto.h
source3/modules/vfs_acl_common.c
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c

index b963511b39a8ac97a6229672b34b4b236c9e7071..e6d0cf00ddd0069f6a60e2bba5961c8f3a42c54d 100644 (file)
@@ -706,8 +706,8 @@ VFS_FILEID_OBJ = modules/vfs_fileid.o
 VFS_AIO_FORK_OBJ = modules/vfs_aio_fork.o
 VFS_PREOPEN_OBJ = modules/vfs_preopen.o
 VFS_SYNCOPS_OBJ = modules/vfs_syncops.o
-VFS_ACL_XATTR_OBJ = modules/vfs_acl_xattr.o modules/vfs_acl_common.o
-VFS_ACL_TDB_OBJ = modules/vfs_acl_tdb.o modules/vfs_acl_common.o
+VFS_ACL_XATTR_OBJ = modules/vfs_acl_xattr.o
+VFS_ACL_TDB_OBJ = modules/vfs_acl_tdb.o
 VFS_SMB_TRAFFIC_ANALYZER_OBJ = modules/vfs_smb_traffic_analyzer.o
 VFS_ONEFS_OBJ = modules/vfs_onefs.o modules/onefs_acl.o modules/onefs_system.o \
                modules/onefs_open.o modules/onefs_streams.o modules/onefs_dir.o \
index 3e9f5e8ae7c7a6805bf90f121ef671b5060e4c9f..f7fedc7e5212177cc5d4f2eb7eaa4c1456e0858d 100644 (file)
@@ -7288,31 +7288,4 @@ uint32_t ds_uf2atype(uint32_t uf);
 uint32_t ds_gtype2atype(uint32_t gtype);
 enum lsa_SidType ds_atype_map(uint32_t atype);
 
-/* The following definitions come from modules/vfs_acl_xattr.c */
-NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
-                       vfs_handle_struct *handle,
-                       files_struct *fsp,
-                       const char *name,
-                       DATA_BLOB *pblob);
-NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
-                       files_struct *fsp,
-                       DATA_BLOB *pblob);
-NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle,
-                       const char *fname,
-                       DATA_BLOB *pblob);
-
-/* The following definitions come from modules/vfs_acl_common.c */
-int open_acl_common(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *fsp,
-                       int flags,
-                       mode_t mode);
-int mkdir_acl_common(vfs_handle_struct *handle, const char *path, mode_t mode);
-NTSTATUS fget_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp,
-       uint32_t security_info, struct security_descriptor **ppdesc);
-NTSTATUS get_nt_acl_common(vfs_handle_struct *handle,
-       const char *name, uint32_t security_info, struct security_descriptor **ppdesc);
-NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp,
-       uint32_t security_info_sent, const struct security_descriptor *psd);
-
 #endif /*  _PROTO_H_  */
index d8ff8c648e99f3ae02ad6db2b1486f574c4ce1ca..5fdd2b4725c0b7f61e6ccae8e8bbb6177c7d626d 100644 (file)
@@ -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
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-/* 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;
index 07ad694a30660cc429513ec730bf5070242c1294..285c58ed9d19f00731d1d11f7c6400963912c6ff 100644 (file)
@@ -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)
 {
index d7711760ed4eaad8de19058431ceb6484144392c..7a9cd27e5fca848eb11318ff33e23650e0f492eb 100644 (file)
 #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)
 {