s4:samr RPC server - remove wrong implementation of ReplicaSourceNodeName
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 19 Sep 2010 08:50:28 +0000 (10:50 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 29 Oct 2010 09:55:18 +0000 (09:55 +0000)
This should represent a replication partner - never the DC iself

source4/dsdb/common/util.c
source4/rpc_server/samr/dcesrv_samr.c

index 39589e5fd5568d7913c76d1267fcbc85713cb31d..39fcc4d49b2441497ec5f3a2e0423b7b806838b5 100644 (file)
@@ -1347,28 +1347,6 @@ failed:
        return false;
 }
 
-/* Obtain the short name of the flexible single master operator
- * (FSMO), such as the PDC Emulator */
-const char *samdb_result_fsmo_name(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_message *msg, 
-                            const char *attr)
-{
-       /* Format is cn=NTDS Settings,cn=<NETBIOS name of FSMO>,.... */
-       struct ldb_dn *fsmo_dn = ldb_msg_find_attr_as_dn(ldb, mem_ctx, msg, attr);
-       const struct ldb_val *val = ldb_dn_get_component_val(fsmo_dn, 1);
-       const char *name = ldb_dn_get_component_name(fsmo_dn, 1);
-
-       if (!name || (ldb_attr_cmp(name, "cn") != 0)) {
-               /* Ensure this matches the format.  This gives us a
-                * bit more confidence that a 'cn' value will be a
-                * ascii string */
-               return NULL;
-       }
-       if (val) {
-               return (char *)val->data;
-       }
-       return NULL;
-}
-
 /*
   work out the ntds settings dn for the current open ldb
 */
index e419485cdcdeb428266d631e6df64fa046fffd59..1c4e9ecada16e898dd0195a26ef51ac7b6a13fbd 100644 (file)
@@ -483,14 +483,9 @@ static NTSTATUS dcesrv_samr_info_DomGeneralInformation(struct samr_domain_state
                                                       struct ldb_message **dom_msgs,
                                                       struct samr_DomGeneralInformation *info)
 {
-       /* This pulls the NetBIOS name from the 
-          cn=NTDS Settings,cn=<NETBIOS name of PDC>,....
-          string */
-       info->primary.string = samdb_result_fsmo_name(state->sam_ctx, mem_ctx, dom_msgs[0], "fSMORoleOwner");
-
-       if (!info->primary.string) {
-               info->primary.string = lpcfg_netbios_name(state->lp_ctx);
-       }
+       /* FIXME: this has a completely different meaning
+        * MS-SAMR 2.2.4.1 - ReplicaSourceNodeName */
+       info->primary.string = talloc_strdup(mem_ctx, "");
 
        info->force_logoff_time = ldb_msg_find_attr_as_uint64(dom_msgs[0], "forceLogoff", 
                                                            0x8000000000000000LL);
@@ -584,15 +579,9 @@ static NTSTATUS dcesrv_samr_info_DomInfo6(struct samr_domain_state *state,
                                   struct ldb_message **dom_msgs,
                                   struct samr_DomInfo6 *info)
 {
-       /* This pulls the NetBIOS name from the 
-          cn=NTDS Settings,cn=<NETBIOS name of PDC>,....
-          string */
-       info->primary.string = samdb_result_fsmo_name(state->sam_ctx, mem_ctx, 
-                                                     dom_msgs[0], "fSMORoleOwner");
-
-       if (!info->primary.string) {
-               info->primary.string = lpcfg_netbios_name(state->lp_ctx);
-       }
+       /* FIXME: this has a completely different meaning
+        * MS-SAMR 2.2.4.1 - ReplicaSourceNodeName */
+       info->primary.string = talloc_strdup(mem_ctx, "");
 
        return NT_STATUS_OK;
 }
@@ -753,7 +742,6 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call,
                static const char * const attrs2[] = {"forceLogoff",
                                                      "oEMInformation", 
                                                      "modifiedCount", 
-                                                     "fSMORoleOwner",
                                                      NULL};
                attrs = attrs2;
                break;
@@ -779,8 +767,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call,
        }
        case 6:
        {
-               static const char * const attrs2[] = {"fSMORoleOwner", 
-                                                     NULL};
+               static const char * const attrs2[] = { NULL };
                attrs = attrs2;
                break;
        }