Print this page
NEX-13644 File access audit logging
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
SMB-50 User-mode SMB server
Includes work by these authors:
Thomas Keiser <thomas.keiser@nexenta.com>
Albert Lee <trisk@nexenta.com>
SUP-642 Regression leading to AD usernames not being displayed by zfs userspace command.
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/lib/libidmap/common/idmap.h
+++ new/usr/src/lib/libidmap/common/idmap.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23 - * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
23 + * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
24 24 */
25 25
26 26 /*
27 27 * Header File for Clients of Native Identity Mapping Service
28 28 */
29 29
30 30 #ifndef _IDMAP_H
31 31 #define _IDMAP_H
32 32
33 33
34 34 #include <stdlib.h>
35 35 #include <ctype.h>
36 36 #include <sys/param.h>
37 37 #include <sys/types.h>
38 38 #include <sys/stat.h>
39 39 #include <sys/idmap.h>
40 40
41 41 #ifdef __cplusplus
42 42 extern "C" {
43 43 #endif
44 44
45 45 /*
46 46 * The ifdef's for these two accomodate duplicate definitions in
47 47 * lib/smbsrv/libfksmbsrv/common/sys/kidmap.h See notes there.
48 48 */
49 49
50 50 /* Status */
51 51 #ifndef _IDMAP_STAT_TYPE
52 52 #define _IDMAP_STAT_TYPE
53 53 typedef int32_t idmap_stat;
54 54 #endif /* _IDMAP_STAT_TYPE */
55 55
56 56 /* Opaque get handle */
57 57 #ifndef _IDMAP_GET_HANDLE_T
58 58 #define _IDMAP_GET_HANDLE_T
59 59 typedef struct idmap_get_handle idmap_get_handle_t;
60 60 #endif /* _IDMAP_GET_HANDLE_T */
61 61
62 62 typedef uint32_t idmap_rid_t;
63 63
64 64 /* Logger prototype which is based on syslog */
65 65 typedef void (*idmap_logger_t)(int, const char *, ...);
66 66
67 67 /*
68 68 * Setup API
69 69 */
70 70
71 71 /* Status code to string */
72 72 extern const char *idmap_stat2string(idmap_stat);
73 73
74 74 /* Free memory allocated by the API */
75 75 extern void idmap_free(void *);
76 76
77 77
78 78 /*
79 79 * Supported flag values for mapping requests.
80 80 * These flag values are applicable to the batch API and the
81 81 * Windows Name API below.
82 82 */
83 83 /* Use the libidmap cache */
84 84 #define IDMAP_REQ_FLG_USE_CACHE 0x00000010
85 85
86 86 /*
87 87 * API to batch SID to UID/GID mapping requests
88 88 */
89 89 /* Create handle */
90 90 extern idmap_stat idmap_get_create(idmap_get_handle_t **);
91 91
92 92 /* Given SID, get UID */
93 93 extern idmap_stat idmap_get_uidbysid(idmap_get_handle_t *, char *,
94 94 idmap_rid_t, int, uid_t *, idmap_stat *);
95 95
96 96 /* Given SID, get GID */
97 97 extern idmap_stat idmap_get_gidbysid(idmap_get_handle_t *, char *,
98 98 idmap_rid_t, int, gid_t *, idmap_stat *);
99 99
100 100 /* Given SID, get UID or GID */
101 101 extern idmap_stat idmap_get_pidbysid(idmap_get_handle_t *, char *,
102 102 idmap_rid_t, int, uid_t *, int *, idmap_stat *);
103 103
104 104 /* Given UID, get SID */
105 105 extern idmap_stat idmap_get_sidbyuid(idmap_get_handle_t *, uid_t, int,
106 106 char **, idmap_rid_t *, idmap_stat *);
107 107
108 108 /* Given GID, get SID */
109 109 extern idmap_stat idmap_get_sidbygid(idmap_get_handle_t *, gid_t, int,
110 110 char **, idmap_rid_t *, idmap_stat *);
111 111
112 112 /* Process the batched requests */
113 113 extern idmap_stat idmap_get_mappings(idmap_get_handle_t *);
114 114
115 115 /* Destroy the handle */
116 116 extern void idmap_get_destroy(idmap_get_handle_t *);
117 117
118 118
119 119 /*
120 120 * API to get Windows name by UID/GID and vice-versa
|
↓ open down ↓ |
87 lines elided |
↑ open up ↑ |
121 121 */
122 122 /* Given UID, get Windows name */
123 123 extern idmap_stat idmap_getwinnamebyuid(uid_t, int, char **, char **);
124 124
125 125 /* Given GID, get Windows name */
126 126 extern idmap_stat idmap_getwinnamebygid(gid_t, int, char **, char **);
127 127
128 128 /* Given PID, get Windows name */
129 129 extern idmap_stat idmap_getwinnamebypid(uid_t, int, int, char **, char **);
130 130
131 +/* Given SID, get Windows name */
132 +extern idmap_stat idmap_getwinnamebysid(char *, int, char **);
133 +
131 134 /* Given Windows name, get UID */
132 135 extern idmap_stat idmap_getuidbywinname(const char *, const char *,
133 136 int, uid_t *);
134 137
135 138 /* Given Windows name, get GID */
136 139 extern idmap_stat idmap_getgidbywinname(const char *, const char *,
137 140 int, gid_t *);
138 141
139 142
140 143 /* Logger */
141 144 extern void idmap_set_logger(idmap_logger_t funct);
142 145
143 146 #ifdef __cplusplus
144 147 }
145 148 #endif
146 149
147 150 #endif /* _IDMAP_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX