e189fc45702c650ad0c4c700820bccb1fd5177fb
[metze/samba/wip.git] / source3 / modules / onefs.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * Support for OneFS
4  *
5  * Copyright (C) Steven Danneman, 2008
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef _ONEFS_H
22 #define _ONEFS_H
23
24 #include "includes.h"
25
26 #include <sys/isi_acl.h>
27
28 /* OneFS Module smb.conf parameters and defaults */
29
30 /**
31 * Specifies when ACLs presented to Windows should be canonicalized
32 * into the ordering which Explorer expects.
33 */
34 enum onefs_acl_wire_format
35 {
36         ACL_FORMAT_RAW, /**< Never canonicalize */
37         ACL_FORMAT_WINDOWS_SD, /**< Only canonicalize synthetic ACLs */
38         ACL_FORMAT_ALWAYS /**< Always canonicalize */
39 };
40
41 #define PARM_ONEFS_TYPE "onefs"
42 #define PARM_ACL_WIRE_FORMAT "acl wire format"
43 #define PARM_ACL_WIRE_FORMAT_DEFAULT ACL_FORMAT_WINDOWS_SD
44 #define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE "simple file sharing compatibility mode"
45 #define PARM_SIMPLE_FILE_SHARING_COMPATIBILITY_MODE_DEFAULT false
46 #define PARM_CREATOR_OWNER_GETS_FULL_CONTROL "creator owner gets full control"
47 #define PARM_CREATOR_OWNER_GETS_FULL_CONTROL_DEFAULT true
48 #define PARM_UNMAPPABLE_SIDS_DENY_EVERYONE "unmappable sids deny everyone"
49 #define PARM_UNMAPPABLE_SIDS_DENY_EVERYONE_DEFAULT false
50 #define PARM_UNMAPPABLE_SIDS_IGNORE "ignore unmappable sids"
51 #define PARM_UNMAPPABLE_SIDS_IGNORE_DEFAULT false
52 #define PARM_UNMAPPABLE_SIDS_IGNORE_LIST "unmappable sids ignore list"
53 #define PARM_UNMAPPABLE_SIDS_IGNORE_LIST_DEFAULT NULL
54 #define PARM_IGNORE_SACL "ignore sacl"
55 #define PARM_IGNORE_SACL_DEFAULT false
56
57 /*
58  * vfs interface handlers
59  */
60 NTSTATUS onefs_create_file(vfs_handle_struct *handle,
61                            struct smb_request *req,
62                            uint16_t root_dir_fid,
63                            const char *fname,
64                            uint32_t create_file_flags,
65                            uint32_t access_mask,
66                            uint32_t share_access,
67                            uint32_t create_disposition,
68                            uint32_t create_options,
69                            uint32_t file_attributes,
70                            uint32_t oplock_request,
71                            uint64_t allocation_size,
72                            struct security_descriptor *sd,
73                            struct ea_list *ea_list,
74                            files_struct **result,
75                            int *pinfo,
76                            SMB_STRUCT_STAT *psbuf);
77
78 int onefs_close(vfs_handle_struct *handle, struct files_struct *fsp);
79
80 int onefs_rename(vfs_handle_struct *handle, const char *oldname,
81                  const char *newname);
82
83 int onefs_stat(vfs_handle_struct *handle, const char *fname,
84                SMB_STRUCT_STAT *sbuf);
85
86 int onefs_fstat(vfs_handle_struct *handle, struct files_struct *fsp,
87                 SMB_STRUCT_STAT *sbuf);
88
89 int onefs_lstat(vfs_handle_struct *handle, const char *path,
90                 SMB_STRUCT_STAT *sbuf);
91
92 int onefs_unlink(vfs_handle_struct *handle, const char *path);
93
94 int onefs_chflags(vfs_handle_struct *handle, const char *path,
95                   unsigned int flags);
96
97 NTSTATUS onefs_streaminfo(vfs_handle_struct *handle,
98                           struct files_struct *fsp,
99                           const char *fname,
100                           TALLOC_CTX *mem_ctx,
101                           unsigned int *num_streams,
102                           struct stream_struct **streams);
103
104 NTSTATUS onefs_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
105                            uint32 security_info, SEC_DESC **ppdesc);
106
107 NTSTATUS onefs_get_nt_acl(vfs_handle_struct *handle, const char* name,
108                           uint32 security_info, SEC_DESC **ppdesc);
109
110 NTSTATUS onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
111                            uint32 security_info_sent, SEC_DESC *psd);
112 /*
113  * Utility functions
114  */
115 NTSTATUS onefs_samba_sd_to_sd(uint32 security_info_sent, SEC_DESC *psd,
116                               struct ifs_security_descriptor *sd, int snum);
117
118 NTSTATUS onefs_split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
119                                       char **pbase, char **pstream);
120
121 /*
122  * System Interfaces
123  */
124 int onefs_sys_create_file(connection_struct *conn,
125                           int base_fd,
126                           const char *path,
127                           uint32_t access_mask,
128                           uint32_t open_access_mask,
129                           uint32_t share_access,
130                           uint32_t create_options,
131                           int flags,
132                           mode_t mode,
133                           int oplock_request,
134                           uint64_t id,
135                           struct security_descriptor *sd,
136                           uint32_t ntfs_flags,
137                           int *granted_oplock);
138
139
140
141 #endif /* _ONEFS_H */