vfs: Fix alternative posix and no-op sys acl implementations to take a mem_ctx
[samba.git] / source3 / modules / vfs_irixacl.c
1 /*
2    Unix SMB/Netbios implementation.
3    VFS module to get and set irix acls
4    Copyright (C) Michael Adam 2006,2008
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "includes.h"
21 #include "system/filesys.h"
22 #include "smbd/smbd.h"
23 #include "modules/vfs_irixacl.h"
24
25
26 /* prototypes for private functions first - for clarity */
27
28 /* public functions - the api */
29
30 SMB_ACL_T irixacl_sys_acl_get_file(vfs_handle_struct *handle,
31                                    const char *path_p,
32                                    SMB_ACL_TYPE_T type,
33                                    TALLOC_CTX *mem_ctx)
34 {
35         errno = ENOTSUP;
36         return NULL;
37 }
38
39 SMB_ACL_T irixacl_sys_acl_get_fd(vfs_handle_struct *handle,
40                                  files_struct *fsp,
41                                  TALLOC_CTX *mem_ctx)
42 {
43         errno = ENOTSUP;
44         return NULL;
45 }
46
47 int irixacl_sys_acl_set_file(vfs_handle_struct *handle,
48                               const char *name,
49                               SMB_ACL_TYPE_T type,
50                               SMB_ACL_T theacl)
51 {
52         errno = ENOTSUP;
53         return -1;
54 }
55
56 int irixacl_sys_acl_set_fd(vfs_handle_struct *handle,
57                             files_struct *fsp,
58                             SMB_ACL_T theacl)
59 {
60         errno = ENOTSUP;
61         return -1;
62 }
63
64 int irixacl_sys_acl_delete_def_file(vfs_handle_struct *handle,
65                                      const char *path)
66 {
67         errno = ENOTSUP;
68         return -1;
69 }
70
71 /* private functions */
72
73 /* VFS operations structure */
74
75 static struct vfs_fn_pointers irixacl_fns = {
76         .sys_acl_get_file_fn = irixacl_sys_acl_get_file,
77         .sys_acl_get_fd_fn = irixacl_sys_acl_get_fd,
78         .sys_acl_blob_get_file_fn = posix_sys_acl_blob_get_file,
79         .sys_acl_blob_get_fd_fn = posix_sys_acl_blob_get_fd,
80         .sys_acl_set_file_fn = irixacl_sys_acl_set_file,
81         .sys_acl_set_fd_fn = irixacl_sys_acl_set_fd,
82         .sys_acl_delete_def_file_fn = irixacl_sys_acl_delete_def_file,
83 };
84
85 NTSTATUS vfs_irixacl_init(void);
86 NTSTATUS vfs_irixacl_init(void)
87 {
88         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "irixacl",
89                                 &irixacl_fns);
90 }
91
92 /* ENTE */