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 \
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_ */
/*
* 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 | \
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,
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);
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,
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,
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;
#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;
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,
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)
{
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)
{
#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,
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)
{
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)
{