CVE-2023-0614 dsdb: Add DSDB_MARK_REQ_UNTRUSTED
[Samba.git] / source4 / dsdb / common / util.h
blob5bb96d60b3cca2208bdb3acdc125d08ea7bcf7a2
1 /*
2 Unix SMB/CIFS implementation.
3 Samba utility functions
5 Copyright (C) Andrew Tridgell 2010
6 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2009
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef __DSDB_COMMON_UTIL_H__
23 #define __DSDB_COMMON_UTIL_H__
26 flags for dsdb_request_add_controls(). For the module functions,
27 the upper 16 bits are in dsdb/samdb/ldb_modules/util.h
29 #define DSDB_SEARCH_SEARCH_ALL_PARTITIONS 0x00001
30 #define DSDB_SEARCH_SHOW_DELETED 0x00002
31 #define DSDB_SEARCH_SHOW_DN_IN_STORAGE_FORMAT 0x00004
32 #define DSDB_SEARCH_REVEAL_INTERNALS 0x00008
33 #define DSDB_SEARCH_SHOW_EXTENDED_DN 0x00010
34 #define DSDB_MODIFY_RELAX 0x00020
35 #define DSDB_MODIFY_PERMISSIVE 0x00040
36 #define DSDB_FLAG_AS_SYSTEM 0x00080
37 #define DSDB_TREE_DELETE 0x00100
38 #define DSDB_SEARCH_ONE_ONLY 0x00200 /* give an error unless 1 record */
39 #define DSDB_SEARCH_SHOW_RECYCLED 0x00400
40 #define DSDB_PROVISION 0x00800
41 #define DSDB_BYPASS_PASSWORD_HASH 0x01000
42 #define DSDB_SEARCH_NO_GLOBAL_CATALOG 0x02000
43 #define DSDB_MODIFY_PARTIAL_REPLICA 0x04000
44 #define DSDB_PASSWORD_BYPASS_LAST_SET 0x08000
45 #define DSDB_REPLMD_VANISH_LINKS 0x10000
46 #define DSDB_MARK_REQ_UNTRUSTED 0x20000
48 bool is_attr_in_list(const char * const * attrs, const char *attr);
50 #define DSDB_SECRET_ATTRIBUTES_EX(sep) \
51 "pekList" sep \
52 "msDS-ExecuteScriptPassword" sep \
53 "currentValue" sep \
54 "dBCSPwd" sep \
55 "initialAuthIncoming" sep \
56 "initialAuthOutgoing" sep \
57 "lmPwdHistory" sep \
58 "ntPwdHistory" sep \
59 "priorValue" sep \
60 "supplementalCredentials" sep \
61 "trustAuthIncoming" sep \
62 "trustAuthOutgoing" sep \
63 "unicodePwd" sep \
64 "clearTextPassword"
66 #define DSDB_SECRET_ATTRIBUTES_COMMA ,
67 #define DSDB_SECRET_ATTRIBUTES DSDB_SECRET_ATTRIBUTES_EX(DSDB_SECRET_ATTRIBUTES_COMMA)
69 #define DSDB_PASSWORD_ATTRIBUTES \
70 "userPassword", \
71 "clearTextPassword", \
72 "unicodePwd", \
73 "dBCSPwd"
76 * ldb opaque values used to pass the user session information to ldb modules
78 #define DSDB_SESSION_INFO "sessionInfo"
79 #define DSDB_NETWORK_SESSION_INFO "networkSessionInfo"
81 struct GUID;
83 struct ldb_context;
85 int dsdb_werror_at(struct ldb_context *ldb, int ldb_ecode, WERROR werr,
86 const char *location, const char *func,
87 const char *reason);
89 #define dsdb_module_werror(module, ldb_ecode, werr, reason) \
90 dsdb_werror_at(ldb_module_get_ctx(module), ldb_ecode, werr, \
91 __location__, __func__, reason)
94 struct dsdb_ldb_dn_list_node {
95 struct dsdb_ldb_dn_list_node *prev, *next;
97 /* the dn of the partition */
98 struct ldb_dn *dn;
103 #endif /* __DSDB_COMMON_UTIL_H__ */