8982 Support building with OpenSSL 1.1
[unleashed.git] / usr / src / lib / libsmbfs / netsmb / smbfs_acl.h
blobacdef1d062ffb57b7055a0d03a6f33524cceabd0
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _NETSMB_SMBFS_ACL_H
28 #define _NETSMB_SMBFS_ACL_H
31 * Get/set ACL via contracted interface in libsmbfs.
32 * The ACL is in the form used by libsec (type=ACE_T)
33 * but we need to carry the uid/gid info here too.
36 #include <sys/acl.h>
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 * Get a ZFS-style acl from an FD opened in smbfs.
44 * Intentionally similar to: facl_get(3SEC)
46 * Allocates an acl_t via libsec. Free with: acl_free(3SEC)
47 * Get owner/group IDs too if ID pointers != NULL
49 int smbfs_acl_get(int fd, acl_t **, uid_t *, gid_t *);
52 * Set a ZFS-style acl onto an FD opened in smbfs.
53 * Intentionally similar to: facl_set(3SEC)
55 * The acl_t must be of type ACE_T (from libsec).
56 * Set owner/group IDs too if ID values != -1
58 int smbfs_acl_set(int fd, acl_t *, uid_t, gid_t);
62 * Slightly lower-level functions, allowing access to
63 * the raw Windows Security Descriptor (SD)
65 * The struct i_ntsid is opaque in this I/F.
66 * Real decl. in: common/smbclnt/smbfs_ntacl.h
68 struct i_ntsd;
71 * Get an "internal form" SD from the FD (opened in smbfs).
72 * Allocates a hierarchy in isdp. Caller must free it via
73 * smbfs_acl_free_isd()
75 int smbfs_acl_getsd(int fd, uint32_t, struct i_ntsd **);
78 * Set an "internal form" SD onto the FD (opened in smbfs).
80 int smbfs_acl_setsd(int fd, uint32_t, struct i_ntsd *);
83 * Selector bits (2nd arg above) copied from smb.h so we
84 * don't need that whole thing exposed to our consumers.
85 * Any mismatch would be detected in smb/acl_api.c
87 #define OWNER_SECURITY_INFORMATION 0x00000001
88 #define GROUP_SECURITY_INFORMATION 0x00000002
89 #define DACL_SECURITY_INFORMATION 0x00000004
90 #define SACL_SECURITY_INFORMATION 0x00000008
92 struct __FILE;
93 void smbfs_acl_print_sd(struct __FILE *, struct i_ntsd *);
96 * These are duplicated from common/smbclnt/smbfs_ntacl.h
97 * rather than exporting that header for this library.
98 * Any mismatch would be detected in smb/acl_api.c
100 int smbfs_acl_sd2zfs(struct i_ntsd *, acl_t *, uid_t *, gid_t *);
101 int smbfs_acl_zfs2sd(acl_t *, uid_t, gid_t, uint32_t, struct i_ntsd **);
102 void smbfs_acl_free_sd(struct i_ntsd *);
104 #ifdef __cplusplus
106 #endif
108 #endif /* _NETSMB_SMBFS_ACL_H */