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",
38 "initialAuthIncoming",
39 "initialAuthOutgoing",
40 "isCriticalSystemObject",
42 "lockOutObservationWindow",
49 "msDS-AdditionalDnsHostName",
50 "msDS-AdditionalSamAccountName",
51 "msDS-AllowedToDelegateTo",
52 "msDS-AuthenticatedAtDC",
53 "msDS-ExecuteScriptPassword",
56 "msDS-SupportedEncryptionTypes",
57 "msDS-TrustForestTrustInfo",
60 "notFiltlockoutThreshold",
63 "operatingSystemServicePack",
64 "operatingSystemVersion",
72 "servicePrincipalName",
73 "supplementalCredentials",
85 /* returns true if the attribute can be in a filtered replica */
87 bool dsdb_attribute_is_attr_in_filtered_replica(struct dsdb_attribute *attribute)
89 int i, size = sizeof(never_in_filtered_attrs)/sizeof(char *);
90 if (attribute->systemOnly ||
91 attribute->schemaFlagsEx & DS_FLAG_ATTR_IS_CRITICAL) {
94 if (attribute->systemFlags & (DS_FLAG_ATTR_NOT_REPLICATED |
95 DS_FLAG_ATTR_REQ_PARTIAL_SET_MEMBER |
96 DS_FLAG_ATTR_IS_CONSTRUCTED)) {
100 for (i=0; i < size; i++) {
101 if (strcmp(attribute->lDAPDisplayName, never_in_filtered_attrs[i]) == 0) {
106 if (attribute->searchFlags & SEARCH_FLAG_RODC_ATTRIBUTE) {