vfs_gpfs: Register smbd process with GPFS
[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         char *security_acl_xattr_name;
31 };
32
33 struct acl_common_fsp_ext {
34         bool setting_nt_acl;
35 };
36
37 bool init_acl_common_config(vfs_handle_struct *handle,
38                             const char *module_name);
39
40 int rmdir_acl_common(struct vfs_handle_struct *handle,
41                         struct files_struct *dirfsp,
42                         const struct smb_filename *smb_fname);
43 int unlink_acl_common(struct vfs_handle_struct *handle,
44                         struct files_struct *dirfsp,
45                         const struct smb_filename *smb_fname,
46                         int flags);
47 int fchmod_acl_module_common(struct vfs_handle_struct *handle,
48                              struct files_struct *fsp, mode_t mode);
49 int chmod_acl_acl_module_common(struct vfs_handle_struct *handle,
50                                 const struct smb_filename *smb_fname,
51                                 mode_t mode);
52 NTSTATUS get_nt_acl_common_at(
53         NTSTATUS (*get_acl_blob_at_fn)(TALLOC_CTX *ctx,
54                                     vfs_handle_struct *handle,
55                                     struct files_struct *dirfsp,
56                                     const struct smb_filename *smb_fname,
57                                     DATA_BLOB *pblob),
58         vfs_handle_struct *handle,
59         struct files_struct *dirfsp,
60         const struct smb_filename *smb_fname_in,
61         uint32_t security_info,
62         TALLOC_CTX *mem_ctx,
63         struct security_descriptor **ppdesc);
64
65 NTSTATUS fget_nt_acl_common(
66         NTSTATUS (*fget_acl_blob_fn)(TALLOC_CTX *ctx,
67                                     vfs_handle_struct *handle,
68                                     files_struct *fsp,
69                                     DATA_BLOB *pblob),
70         vfs_handle_struct *handle,
71         files_struct *fsp,
72         uint32_t security_info,
73         TALLOC_CTX *mem_ctx,
74         struct security_descriptor **ppdesc);
75
76 NTSTATUS fset_nt_acl_common(
77         NTSTATUS (*fget_acl_blob_fn)(TALLOC_CTX *ctx,
78                                     vfs_handle_struct *handle,
79                                     files_struct *fsp,
80                                     DATA_BLOB *pblob),
81         NTSTATUS (*store_acl_blob_fsp_fn)(vfs_handle_struct *handle,
82                                           files_struct *fsp,
83                                           DATA_BLOB *pblob),
84         const char *module_name,
85         vfs_handle_struct *handle, files_struct *fsp,
86         uint32_t security_info_sent,
87         const struct security_descriptor *orig_psd);
88
89
90
91 #endif