Fix up bugs in the new 'store sec_channel type' code - we were always joining
authorAndrew Bartlett <abartlet@samba.org>
Tue, 22 Apr 2003 05:32:01 +0000 (05:32 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Apr 2003 05:32:01 +0000 (05:32 +0000)
as a BDC.

Andrew Bartlett
(This used to be commit f35674e7552dcfece342e7bece10bbfb0e81cbf8)

source3/utils/net_ads.c
source3/utils/net_rpc_join.c

index 3615fd0e949dbce8d5abb8f2510d87f14a739e82..a498104bce6dab08d896e2ab1edf36a9a0c6eab0 100644 (file)
@@ -637,7 +637,7 @@ int net_ads_join(int argc, const char **argv)
        void *res;
        DOM_SID dom_sid;
        char *ou_str;
-       uint32 sec_channel_type;
+       uint32 sec_channel_type = SEC_CHAN_WKSTA;
        uint32 account_type = UF_WORKSTATION_TRUST_ACCOUNT;
 
        if (argc > 0) org_unit = argv[0];
@@ -647,11 +647,6 @@ int net_ads_join(int argc, const char **argv)
                return -1;
        }
 
-       /* check what type of join 
-          TODO: make this variable like RPC
-       */
-       account_type = UF_WORKSTATION_TRUST_ACCOUNT;
-
        tmp_password = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
        password = strdup(tmp_password);
 
index 35564b1e10c27a924892f46ff4ceb1037e630231..e389cf8ef8de6e653df376b43d97eea0a7ba0726 100644 (file)
@@ -143,11 +143,14 @@ int net_rpc_join_newstyle(int argc, const char **argv)
        switch (sec_channel_type) {
        case SEC_CHAN_WKSTA:
                acb_info = ACB_WSTRUST;
+               break;
        case SEC_CHAN_BDC:
                acb_info = ACB_SVRTRUST;
+               break;
 #if 0
        case SEC_CHAN_DOMAIN:
                acb_info = ACB_DOMTRUST;
+               break;
 #endif
        }