s4:dsdb: allocate DSDB_CONTROL_DBCHECK_FIX_DUPLICATE_LINKS oid
[samba.git] / source4 / dsdb / samdb / samdb.h
index 20a55fecb754dc421462dc20a715a38b981f8429..617edc9aa2bc8dea32a92ac910f0ed77f5bfb435 100644 (file)
@@ -40,6 +40,7 @@ struct dsdb_trust_routing_table;
 #include "dsdb/schema/schema.h"
 #include "dsdb/samdb/samdb_proto.h"
 #include "dsdb/common/dsdb_dn.h"
+#include "dsdb/common/util_links.h"
 #include "dsdb/common/proto.h"
 #include "../libds/common/flags.h"
 
@@ -63,12 +64,10 @@ struct dsdb_control_current_partition {
 #define DSDB_REPL_FLAG_PARTIAL_REPLICA     2
 #define DSDB_REPL_FLAG_ADD_NCNAME         4
 #define DSDB_REPL_FLAG_EXPECT_NO_SECRETS   8
-
+#define DSDB_REPL_FLAG_OBJECT_SUBSET       16
+#define DSDB_REPL_FLAG_TARGETS_UPTODATE    32
 
 #define DSDB_CONTROL_REPLICATED_UPDATE_OID "1.3.6.1.4.1.7165.4.3.3"
-struct dsdb_control_replicated_update {
-       uint32_t dsdb_repl_flags;
-};
 
 #define DSDB_CONTROL_DN_STORAGE_FORMAT_OID "1.3.6.1.4.1.7165.4.3.4"
 /* DSDB_CONTROL_DN_STORAGE_FORMAT_OID has NULL data and behaves very
@@ -128,6 +127,9 @@ struct dsdb_control_password_change {
 /* passed when dbcheck wants to modify a read only replica (very special case) */
 #define DSDB_CONTROL_DBCHECK_MODIFY_RO_REPLICA "1.3.6.1.4.1.7165.4.3.19.1"
 
+/* passed by dbcheck to fix duplicate linked attributes (bug #13095) */
+#define DSDB_CONTROL_DBCHECK_FIX_DUPLICATE_LINKS "1.3.6.1.4.1.7165.4.3.19.2"
+
 /* passed when importing plain text password on upgrades */
 #define DSDB_CONTROL_PASSWORD_BYPASS_LAST_SET_OID "1.3.6.1.4.1.7165.4.3.20"
 
@@ -182,6 +184,17 @@ struct dsdb_control_password_user_account_control {
  */
 #define DSDB_CONTROL_SKIP_DUPLICATES_CHECK_OID "1.3.6.1.4.1.7165.4.3.28"
 
+/* passed when we want to thoroughly delete linked attributes */
+#define DSDB_CONTROL_REPLMD_VANISH_LINKS "1.3.6.1.4.1.7165.4.3.29"
+
+/*
+ * lockoutTime is a replicated attribute, but must be modified before
+ * connectivity occurs to allow password lockouts.
+ */
+#define DSDB_CONTROL_FORCE_RODC_LOCAL_CHANGE "1.3.6.1.4.1.7165.4.3.31"
+
+#define DSDB_CONTROL_INVALID_NOT_IMPLEMENTED "1.3.6.1.4.1.7165.4.3.32"
+
 #define DSDB_EXTENDED_REPLICATED_OBJECTS_OID "1.3.6.1.4.1.7165.4.4.1"
 struct dsdb_extended_replicated_object {
        struct ldb_message *msg;
@@ -200,7 +213,7 @@ struct dsdb_extended_replicated_objects {
         * this is the version of the dsdb_extended_replicated_objects
         * version 0: initial implementation
         */
-#define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 2
+#define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 3
        uint32_t version;
 
        /* DSDB_REPL_FLAG_* flags */
@@ -215,9 +228,11 @@ struct dsdb_extended_replicated_objects {
        struct dsdb_extended_replicated_object *objects;
 
        uint32_t linked_attributes_count;
-       const struct drsuapi_DsReplicaLinkedAttribute *linked_attributes;
+       struct drsuapi_DsReplicaLinkedAttribute *linked_attributes;
 
        WERROR error;
+
+       bool originating_updates;
 };
 
 #define DSDB_EXTENDED_CREATE_PARTITION_OID "1.3.6.1.4.1.7165.4.4.4"
@@ -257,7 +272,6 @@ struct dsdb_openldap_dereference_result_control {
 
 struct samldb_msds_intid_persistant {
        uint32_t msds_intid;
-       uint64_t usn;
 };
 
 #define SAMLDB_MSDS_INTID_OPAQUE "SAMLDB_MSDS_INTID_OPAQUE"
@@ -270,7 +284,6 @@ struct dsdb_extended_dn_store_format {
        bool store_extended_dn_in_ldb;
 };
 
-#define DSDB_OPAQUE_LAST_SCHEMA_UPDATE_MSG_OPAQUE_NAME "DSDB_OPAQUE_LAST_SCHEMA_UPDATE"
 #define DSDB_OPAQUE_PARTITION_MODULE_MSG_OPAQUE_NAME "DSDB_OPAQUE_PARTITION_MODULE_MSG"
 
 /* this takes a struct dsdb_fsmo_extended_op */
@@ -281,6 +294,16 @@ struct dsdb_fsmo_extended_op {
        struct GUID destination_dsa_guid;
 };
 
+/* this takes no data */
+#define DSDB_EXTENDED_CREATE_OWN_RID_SET "1.3.6.1.4.1.7165.4.4.8"
+
+/* this takes a struct dsdb_extended_allocate_rid */
+#define DSDB_EXTENDED_ALLOCATE_RID "1.3.6.1.4.1.7165.4.4.9"
+
+struct dsdb_extended_allocate_rid {
+       uint32_t rid;
+};
+
 /*
  * passed from the descriptor module in order to
  * store the recalucated nTSecurityDescriptor without
@@ -297,4 +320,17 @@ struct dsdb_extended_sec_desc_propagation_op {
 #define DSDB_SAMDB_MINIMUM_ALLOWED_RID   1000
 
 #define DSDB_METADATA_SCHEMA_SEQ_NUM   "SCHEMA_SEQ_NUM"
+
+/*
+ * must be in LDB_FLAG_INTERNAL_MASK
+ * see also the values in lib/ldb/include/ldb_module.h
+ */
+#define DSDB_FLAG_INTERNAL_FORCE_META_DATA 0x10000
+
+#define SAMBA_COMPATIBLE_FEATURES_ATTR "compatibleFeatures"
+#define SAMBA_REQUIRED_FEATURES_ATTR "requiredFeatures"
+#define SAMBA_FEATURES_SUPPORTED_FLAG "@SAMBA_FEATURES_SUPPORTED"
+
+#define SAMBA_SORTED_LINKS_FEATURE "sortedLinks"
+
 #endif /* __SAMDB_H__ */