source: branches/samba-3.5.x/libcli/security/security_descriptor.h

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 3.0 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 Samba utility functions
4
5 Copyright (C) 2009 Jelmer Vernooij <jelmer@samba.org>
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 __SECURITY_DESCRIPTOR_H__
22#define __SECURITY_DESCRIPTOR_H__
23
24#include "librpc/gen_ndr/security.h"
25
26struct security_descriptor *security_descriptor_initialise(TALLOC_CTX *mem_ctx);
27struct security_descriptor *security_descriptor_copy(TALLOC_CTX *mem_ctx,
28 const struct security_descriptor *osd);
29NTSTATUS security_descriptor_sacl_add(struct security_descriptor *sd,
30 const struct security_ace *ace);
31NTSTATUS security_descriptor_dacl_add(struct security_descriptor *sd,
32 const struct security_ace *ace);
33NTSTATUS security_descriptor_dacl_del(struct security_descriptor *sd,
34 const struct dom_sid *trustee);
35NTSTATUS security_descriptor_sacl_del(struct security_descriptor *sd,
36 const struct dom_sid *trustee);
37bool security_ace_equal(const struct security_ace *ace1,
38 const struct security_ace *ace2);
39bool security_acl_equal(const struct security_acl *acl1,
40 const struct security_acl *acl2);
41bool security_descriptor_equal(const struct security_descriptor *sd1,
42 const struct security_descriptor *sd2);
43bool security_descriptor_mask_equal(const struct security_descriptor *sd1,
44 const struct security_descriptor *sd2,
45 uint32_t mask);
46struct security_descriptor *security_descriptor_append(struct security_descriptor *sd,
47 ...);
48struct security_descriptor *security_descriptor_dacl_create(TALLOC_CTX *mem_ctx,
49 uint16_t sd_type,
50 const char *owner_sid,
51 const char *group_sid,
52 ...);
53struct security_descriptor *security_descriptor_sacl_create(TALLOC_CTX *mem_ctx,
54 uint16_t sd_type,
55 const char *owner_sid,
56 const char *group_sid,
57 ...);
58struct security_ace *security_ace_create(TALLOC_CTX *mem_ctx,
59 const char *sid_str,
60 enum security_ace_type type,
61 uint32_t access_mask,
62 uint8_t flags);
63
64struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
65 const struct security_acl *oacl);
66
67struct security_acl *security_acl_concatenate(TALLOC_CTX *mem_ctx,
68 const struct security_acl *acl1,
69 const struct security_acl *acl2);
70
71#endif /* __SECURITY_DESCRIPTOR_H__ */
Note: See TracBrowser for help on using the repository browser.