1 | /*
|
---|
2 | Unix SMB/CIFS implementation.
|
---|
3 |
|
---|
4 | endpoint server for the lsarpc pipe
|
---|
5 |
|
---|
6 | Copyright (C) Andrew Tridgell 2004
|
---|
7 | Copyright (C) Andrew Bartlett <abartlet@samba.org> 2004-2005
|
---|
8 |
|
---|
9 | This program is free software; you can redistribute it and/or modify
|
---|
10 | it under the terms of the GNU General Public License as published by
|
---|
11 | the Free Software Foundation; either version 3 of the License, or
|
---|
12 | (at your option) any later version.
|
---|
13 |
|
---|
14 | This program is distributed in the hope that it will be useful,
|
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
17 | GNU General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU General Public License
|
---|
20 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #include "includes.h"
|
---|
24 | #include "rpc_server/dcerpc_server.h"
|
---|
25 | #include "rpc_server/common/common.h"
|
---|
26 | #include "auth/auth.h"
|
---|
27 | #include "dsdb/samdb/samdb.h"
|
---|
28 | #include "libcli/ldap/ldap_ndr.h"
|
---|
29 | #include <ldb_errors.h>
|
---|
30 | #include "libcli/security/security.h"
|
---|
31 | #include "libcli/auth/libcli_auth.h"
|
---|
32 | #include "param/secrets.h"
|
---|
33 | #include "../lib/util/util_ldb.h"
|
---|
34 | #include "librpc/gen_ndr/ndr_dssetup.h"
|
---|
35 | #include "param/param.h"
|
---|
36 |
|
---|
37 | /*
|
---|
38 | state associated with a lsa_OpenPolicy() operation
|
---|
39 | */
|
---|
40 | struct lsa_policy_state {
|
---|
41 | struct dcesrv_handle *handle;
|
---|
42 | struct ldb_context *sam_ldb;
|
---|
43 | struct ldb_context *pdb;
|
---|
44 | struct ldb_dn *domain_dn;
|
---|
45 | struct ldb_dn *forest_dn;
|
---|
46 | struct ldb_dn *builtin_dn;
|
---|
47 | struct ldb_dn *system_dn;
|
---|
48 | const char *domain_name;
|
---|
49 | const char *domain_dns;
|
---|
50 | const char *forest_dns;
|
---|
51 | struct dom_sid *domain_sid;
|
---|
52 | struct GUID domain_guid;
|
---|
53 | struct dom_sid *builtin_sid;
|
---|
54 | struct dom_sid *nt_authority_sid;
|
---|
55 | struct dom_sid *creator_owner_domain_sid;
|
---|
56 | struct dom_sid *world_domain_sid;
|
---|
57 | int mixed_domain;
|
---|
58 | struct security_descriptor *sd;
|
---|
59 | uint32_t access_mask;
|
---|
60 | };
|
---|
61 |
|
---|
62 | enum lsa_handle {
|
---|
63 | LSA_HANDLE_POLICY,
|
---|
64 | LSA_HANDLE_ACCOUNT,
|
---|
65 | LSA_HANDLE_SECRET,
|
---|
66 | LSA_HANDLE_TRUSTED_DOMAIN
|
---|
67 | };
|
---|
68 |
|
---|
69 | #include "rpc_server/lsa/proto.h"
|
---|
70 |
|
---|