summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/utils/net_ads.c7
-rw-r--r--source3/utils/net_rpc.c6
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index dd53cc5289..6cd332fd3d 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -721,6 +721,13 @@ int net_ads_join(int argc, const char **argv)
const char *short_domain_name = NULL;
TALLOC_CTX *ctx = NULL;
+ if ((lp_server_role() != ROLE_DOMAIN_MEMBER) ||
+ (lp_server_role() != ROLE_DOMAIN_BDC)) {
+ d_printf("can only join as domain member or as BDC\n");
+ return -1;
+ }
+
+
if (argc > 0) {
org_unit = argv[0];
}
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 561be2a41e..efc9bfbfaf 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -389,6 +389,12 @@ static int rpc_join_usage(int argc, const char **argv)
int net_rpc_join(int argc, const char **argv)
{
+ if ((lp_server_role() != ROLE_DOMAIN_MEMBER) ||
+ (lp_server_role() != ROLE_DOMAIN_BDC)) {
+ d_printf("can only join as domain member or as BDC\n");
+ return -1;
+ }
+
if ((net_rpc_perform_oldjoin(argc, argv) == 0))
return 0;