2 Unix SMB/CIFS mplementation.
3 API for determining af an attribute belongs to the filtered set.
5 Copyright (C) Nadezhda Ivanova <nivanova@samba.org> 2010
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.
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.
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/>.
22 #include "dsdb/samdb/samdb.h"
23 #include "dsdb/common/util.h"
24 #include "lib/ldb/include/ldb_errors.h"
25 #include "../lib/util/dlinklist.h"
26 #include "param/param.h"
28 const char *never_in_filtered_attrs
[] = { "accountExpires",
36 "isCriticalSystemObject",
37 "lockOutObservationWindow",
44 "msDS-AdditionalDnsHostName",
45 "msDS-AdditionalSamAccountName",
46 "msDS-AllowedToDelegateTo",
47 "msDS-AuthenticatedAtDC",
48 "msDS-ExecuteScriptPassword",
51 "msDS-SupportedEncryptionTypes",
52 "msDS-TrustForestTrustInfo",
55 "notFiltlockoutThreshold",
57 "operatingSystemServicePack",
58 "operatingSystemVersion",
65 "servicePrincipalName",
72 DSDB_SECRET_ATTRIBUTES
75 /* returns true if the attribute can be in a filtered replica */
77 bool dsdb_attribute_is_attr_in_filtered_replica(struct dsdb_attribute
*attribute
)
79 int i
, size
= sizeof(never_in_filtered_attrs
)/sizeof(char *);
80 if (attribute
->systemOnly
||
81 attribute
->schemaFlagsEx
& SCHEMA_FLAG_ATTR_IS_CRITICAL
) {
84 if (attribute
->systemFlags
& (DS_FLAG_ATTR_NOT_REPLICATED
|
85 DS_FLAG_ATTR_REQ_PARTIAL_SET_MEMBER
|
86 DS_FLAG_ATTR_IS_CONSTRUCTED
)) {
90 for (i
=0; i
< size
; i
++) {
91 if (strcmp(attribute
->lDAPDisplayName
, never_in_filtered_attrs
[i
]) == 0) {
96 if (attribute
->searchFlags
& SEARCH_FLAG_RODC_ATTRIBUTE
) {