s3:net: Fix Bug #6222. Default to DRSUAPI replication for net rpc vampire keytab
authorStefan Metzmacher <metze@samba.org>
Mon, 13 Jul 2009 11:24:19 +0000 (13:24 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 13 Jul 2009 14:52:12 +0000 (16:52 +0200)
metze

Signed-off-by: Günther Deschner <gd@samba.org>
source3/utils/net_rpc_samsync.c

index bd5047c1ff057697c847a7f22568f92128fddb21..c0de247e7fa223f157236dcfb1bd932518b31825 100644 (file)
@@ -493,17 +493,20 @@ int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv)
 
        if (!dc_info.is_ad) {
                printf("DC is not running Active Directory\n");
-               return -1;
-       }
-
-       if (dc_info.is_mixed_mode) {
                ret = run_rpc_command(c, cli, &ndr_table_netlogon.syntax_id,
                                      0,
                                      rpc_vampire_keytab_internals, argc, argv);
+               return -1;
        } else {
                ret = run_rpc_command(c, cli, &ndr_table_drsuapi.syntax_id,
                                      NET_FLAGS_SEAL,
                                      rpc_vampire_keytab_ds_internals, argc, argv);
+               if (ret != 0 && dc_info.is_mixed_mode) {
+                       printf("Fallback to NT4 vampire on Mixed-Mode AD Domain\n");
+                       ret = run_rpc_command(c, cli, &ndr_table_netlogon.syntax_id,
+                                             0,
+                                             rpc_vampire_keytab_internals, argc, argv);
+               }
        }
 
        return ret;