sss_idmap
1.9.6
Main Page
Modules
Data Structures
Files
File List
src
lib
idmap
sss_idmap.h
1
/*
2
SSSD
3
4
ID-mapping library
5
6
Authors:
7
Sumit Bose <sbose@redhat.com>
8
9
Copyright (C) 2012 Red Hat
10
11
This program is free software; you can redistribute it and/or modify
12
it under the terms of the GNU General Public License as published by
13
the Free Software Foundation; either version 3 of the License, or
14
(at your option) any later version.
15
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU General Public License for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with this program. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
25
#ifndef SSS_IDMAP_H_
26
#define SSS_IDMAP_H_
27
28
#include <stdlib.h>
29
#include <stdint.h>
30
#include <stdbool.h>
31
#include <sys/types.h>
32
33
#define DOM_SID_PREFIX "S-1-5-21-"
34
#define DOM_SID_PREFIX_LEN (sizeof(DOM_SID_PREFIX) - 1)
35
46
enum
idmap_error_code
{
48
IDMAP_SUCCESS
= 0,
49
51
IDMAP_NOT_IMPLEMENTED
,
52
54
IDMAP_ERROR
,
55
57
IDMAP_OUT_OF_MEMORY
,
58
60
IDMAP_NO_DOMAIN
,
61
63
IDMAP_CONTEXT_INVALID
,
64
66
IDMAP_SID_INVALID
,
67
69
IDMAP_SID_UNKNOWN
,
70
72
IDMAP_NO_RANGE
,
73
75
IDMAP_BUILTIN_SID
76
};
77
81
typedef
void
*(
idmap_alloc_func
)(
size_t
size,
void
*pvt);
82
typedef
void (idmap_free_func)(
void
*ptr,
void
*pvt);
83
89
struct
sss_idmap_range
{
90
uint32_t min;
91
uint32_t max;
92
};
93
97
struct
sss_dom_sid;
98
102
struct
sss_idmap_ctx;
103
109
struct
dom_sid;
110
124
enum
idmap_error_code
sss_idmap_init
(
idmap_alloc_func
*alloc_func,
125
void
*alloc_pvt,
126
idmap_free_func *free_func,
127
struct
sss_idmap_ctx **ctx);
128
145
enum
idmap_error_code
sss_idmap_add_domain
(
struct
sss_idmap_ctx *ctx,
146
const
char
*domain_name,
147
const
char
*domain_sid,
148
struct
sss_idmap_range
*range);
149
163
enum
idmap_error_code
sss_idmap_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
164
const
char
*sid,
165
uint32_t *
id
);
166
180
enum
idmap_error_code
sss_idmap_dom_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
181
struct
sss_dom_sid *dom_sid,
182
uint32_t *
id
);
183
198
enum
idmap_error_code
sss_idmap_bin_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
199
uint8_t *bin_sid,
200
size_t
length,
201
uint32_t *
id
);
202
216
enum
idmap_error_code
sss_idmap_smb_sid_to_unix
(
struct
sss_idmap_ctx *ctx,
217
struct
dom_sid *smb_sid,
218
uint32_t *
id
);
219
233
enum
idmap_error_code
sss_idmap_unix_to_sid
(
struct
sss_idmap_ctx *ctx,
234
uint32_t
id
,
235
char
**sid);
236
249
enum
idmap_error_code
sss_idmap_unix_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
250
uint32_t
id
,
251
struct
sss_dom_sid **dom_sid);
252
267
enum
idmap_error_code
sss_idmap_unix_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
268
uint32_t
id
,
269
uint8_t **bin_sid,
270
size_t
*length);
271
280
enum
idmap_error_code
sss_idmap_free
(
struct
sss_idmap_ctx *ctx);
281
290
const
char
*
idmap_error_string
(
enum
idmap_error_code
err);
291
301
bool
is_domain_sid
(
const
char
*str);
302
316
enum
idmap_error_code
sss_idmap_bin_sid_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
317
const
uint8_t *bin_sid,
318
size_t
length,
319
struct
sss_dom_sid **dom_sid);
320
334
enum
idmap_error_code
sss_idmap_bin_sid_to_sid
(
struct
sss_idmap_ctx *ctx,
335
const
uint8_t *bin_sid,
336
size_t
length,
337
char
**sid);
338
352
enum
idmap_error_code
sss_idmap_dom_sid_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
353
struct
sss_dom_sid *dom_sid,
354
uint8_t **bin_sid,
355
size_t
*length);
356
370
enum
idmap_error_code
sss_idmap_sid_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
371
const
char
*sid,
372
uint8_t **bin_sid,
373
size_t
*length);
374
387
enum
idmap_error_code
sss_idmap_dom_sid_to_sid
(
struct
sss_idmap_ctx *ctx,
388
struct
sss_dom_sid *dom_sid,
389
char
**sid);
390
403
enum
idmap_error_code
sss_idmap_sid_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
404
const
char
*sid,
405
struct
sss_dom_sid **dom_sid);
406
419
enum
idmap_error_code
sss_idmap_sid_to_smb_sid
(
struct
sss_idmap_ctx *ctx,
420
const
char
*sid,
421
struct
dom_sid **smb_sid);
422
435
enum
idmap_error_code
sss_idmap_smb_sid_to_sid
(
struct
sss_idmap_ctx *ctx,
436
struct
dom_sid *smb_sid,
437
char
**sid);
438
451
enum
idmap_error_code
sss_idmap_dom_sid_to_smb_sid
(
struct
sss_idmap_ctx *ctx,
452
struct
sss_dom_sid *dom_sid,
453
struct
dom_sid **smb_sid);
454
467
enum
idmap_error_code
sss_idmap_smb_sid_to_dom_sid
(
struct
sss_idmap_ctx *ctx,
468
struct
dom_sid *smb_sid,
469
struct
sss_dom_sid **dom_sid);
470
484
enum
idmap_error_code
sss_idmap_bin_sid_to_smb_sid
(
struct
sss_idmap_ctx *ctx,
485
const
uint8_t *bin_sid,
486
size_t
length,
487
struct
dom_sid **smb_sid);
488
502
enum
idmap_error_code
sss_idmap_smb_sid_to_bin_sid
(
struct
sss_idmap_ctx *ctx,
503
struct
dom_sid *smb_sid,
504
uint8_t **bin_sid,
505
size_t
*length);
509
#endif
/* SSS_IDMAP_H_ */
Generated by
1.8.3.1