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 <ldb_errors.h>
25 #include "../lib/util/dlinklist.h"
26 #include "param/param.h"
28 static const char * const never_in_filtered_attrs
[] = {
37 "isCriticalSystemObject",
38 "lockOutObservationWindow",
45 "msDS-AdditionalDnsHostName",
46 "msDS-AdditionalSamAccountName",
47 "msDS-AllowedToDelegateTo",
48 "msDS-AuthenticatedAtDC",
49 "msDS-ExecuteScriptPassword",
52 "msDS-SupportedEncryptionTypes",
53 "msDS-TrustForestTrustInfo",
56 "notFiltlockoutThreshold",
58 "operatingSystemServicePack",
59 "operatingSystemVersion",
66 "servicePrincipalName",
73 DSDB_SECRET_ATTRIBUTES
76 /* returns true if the attribute can be in a filtered replica */
78 bool dsdb_attribute_is_attr_in_filtered_replica(struct dsdb_attribute
*attribute
)
80 int i
, size
= sizeof(never_in_filtered_attrs
)/sizeof(char *);
81 if (attribute
->systemOnly
||
82 attribute
->schemaFlagsEx
& SCHEMA_FLAG_ATTR_IS_CRITICAL
) {
85 if (attribute
->systemFlags
& (DS_FLAG_ATTR_NOT_REPLICATED
|
86 DS_FLAG_ATTR_REQ_PARTIAL_SET_MEMBER
|
87 DS_FLAG_ATTR_IS_CONSTRUCTED
)) {
91 for (i
=0; i
< size
; i
++) {
92 if (strcmp(attribute
->lDAPDisplayName
, never_in_filtered_attrs
[i
]) == 0) {
97 if (attribute
->searchFlags
& SEARCH_FLAG_RODC_ATTRIBUTE
) {