s3: VFS: vfs_acl_common: Add dirfsp, flags parameters to unlink_acl_common().
[samba.git] / source3 / modules / vfs_acl_common.h
1 /*
2  * Store Windows ACLs in data store - common functions.
3  *
4  * Copyright (C) Volker Lendecke, 2008
5  * Copyright (C) Jeremy Allison, 2009
6  * Copyright (C) Ralph Böhme, 2016
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifndef __VFS_ACL_COMMON_H__
23 #define __VFS_ACL_COMMON_H__
24
25 #include "smbd/proto.h"
26
27 struct acl_common_config {
28         bool ignore_system_acls;
29         enum default_acl_style default_acl_style;
30 };
31
32 bool init_acl_common_config(vfs_handle_struct *handle,
33                             const char *module_name);
34
35 int rmdir_acl_common(struct vfs_handle_struct *handle,
36                      const struct smb_filename *smb_fname);
37 int unlink_acl_common(struct vfs_handle_struct *handle,
38                         struct files_struct *dirfsp,
39                         const struct smb_filename *smb_fname,
40                         int flags);
41 int chmod_acl_module_common(struct vfs_handle_struct *handle,
42                             const struct smb_filename *smb_fname,
43                             mode_t mode);
44 int fchmod_acl_module_common(struct vfs_handle_struct *handle,
45                              struct files_struct *fsp, mode_t mode);
46 int chmod_acl_acl_module_common(struct vfs_handle_struct *handle,
47                                 const struct smb_filename *smb_fname,
48                                 mode_t mode);
49 NTSTATUS get_nt_acl_common(
50         NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx,
51                                     vfs_handle_struct *handle,
52                                     files_struct *fsp,
53                                     const struct smb_filename *smb_fname,
54                                     DATA_BLOB *pblob),
55         vfs_handle_struct *handle,
56         files_struct *fsp,
57         const struct smb_filename *smb_fname_in,
58         uint32_t security_info,
59         TALLOC_CTX *mem_ctx,
60         struct security_descriptor **ppdesc);
61
62 NTSTATUS fset_nt_acl_common(
63         NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx,
64                                     vfs_handle_struct *handle,
65                                     files_struct *fsp,
66                                     const struct smb_filename *smb_fname,
67                                     DATA_BLOB *pblob),
68         NTSTATUS (*store_acl_blob_fsp_fn)(vfs_handle_struct *handle,
69                                           files_struct *fsp,
70                                           DATA_BLOB *pblob),
71         const char *module_name,
72         vfs_handle_struct *handle, files_struct *fsp,
73         uint32_t security_info_sent,
74         const struct security_descriptor *orig_psd);
75
76
77
78 #endif