s4-drs: Use new samdb_rodc() function in s4 code
authorFernando J V da Silva <fernandojvsilva@yahoo.com.br>
Thu, 15 Apr 2010 21:54:13 +0000 (18:54 -0300)
committerAndrew Tridgell <tridge@samba.org>
Thu, 22 Apr 2010 09:36:15 +0000 (19:36 +1000)
This patch fits the calling to the new samdb_rodc() function and
fix a little bug in this function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
source4/dsdb/common/util.c
source4/rpc_server/lsa/dcesrv_lsa.c

index 9e2e358b3b651e458180c44b26242a2af58f7b0e..e395ea540b446e30be64701958e881427ac5c23f 100644 (file)
@@ -2663,7 +2663,7 @@ int samdb_is_rodc(struct ldb_context *sam_ctx, const struct GUID *invocationId,
        struct ldb_result *res;
        TALLOC_CTX *tmp_ctx = talloc_new(sam_ctx);
 
-       config_dn = samdb_config_dn(sam_ctx);
+       config_dn = ldb_get_config_basedn(sam_ctx);
        if (!config_dn) {
                talloc_free(tmp_ctx);
                return LDB_ERR_OPERATIONS_ERROR;
index e683348140beaf0eac8fca19a4daa84666d3a290..aaa0f7baa2eb204d40ae95d6a8655502b4e4c137 100644 (file)
@@ -4258,6 +4258,7 @@ static NTSTATUS dcesrv_lsa_lsaRSetForestTrustInformation(struct dcesrv_call_stat
        DATA_BLOB ft_blob;
        enum ndr_err_code ndr_err;
        NTSTATUS nt_status;
+       bool am_rodc;
        int ret;
 
        DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY);
@@ -4273,7 +4274,8 @@ static NTSTATUS dcesrv_lsa_lsaRSetForestTrustInformation(struct dcesrv_call_stat
                return NT_STATUS_INVALID_DOMAIN_ROLE;
        }
 
-       if (samdb_rodc(p_state->sam_ldb)) {
+       ret = samdb_rodc(p_state->sam_ldb, &am_rodc);
+       if (ret == LDB_SUCCESS && am_rodc) {
                return NT_STATUS_NO_SUCH_DOMAIN;
        }