diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/utils/net_rpc_trust.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/utils/net_rpc_trust.c')
-rw-r--r-- | source3/utils/net_rpc_trust.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source3/utils/net_rpc_trust.c b/source3/utils/net_rpc_trust.c index da0a7cca67..318c06ffe9 100644 --- a/source3/utils/net_rpc_trust.c +++ b/source3/utils/net_rpc_trust.c @@ -25,6 +25,7 @@ #include "../librpc/gen_ndr/ndr_lsa_c.h" #include "../lib/crypto/crypto.h" #include "../libcli/security/dom_sid.h" +#include "libsmb/libsmb.h" #define ARG_OTHERSERVER "otherserver=" @@ -418,19 +419,22 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, struct other_dom_data *other_dom_data; struct net_context *other_net_ctx = NULL; struct dom_data dom_data[2]; + void (*usage)(void); + + switch (op) { + case TRUST_CREATE: + usage = print_trust_usage; + break; + case TRUST_DELETE: + usage = print_trust_delete_usage; + break; + default: + DEBUG(0, ("Unsupported trust operation.\n")); + return -1; + } if (net_ctx->display_usage) { - switch (op) { - case TRUST_CREATE: - print_trust_usage(); - break; - case TRUST_DELETE: - print_trust_delete_usage(); - break; - default: - DEBUG(0, ("Unsupported trust operation.\n")); - return -1; - } + usage(); return 0; } @@ -443,7 +447,7 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, ret = parse_trust_args(mem_ctx, argc, argv, &other_dom_data, &trust_pw); if (ret != 0) { if (ret == EINVAL) { - print_trust_usage(); + usage(); } else { DEBUG(0, ("Failed to parse arguments.\n")); } @@ -470,7 +474,7 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, (dom_data[1].domain_name == NULL || dom_data[1].dns_domain_name == NULL))) { DEBUG(0, ("Missing required argument.\n")); - print_trust_usage(); + usage(); goto done; } } |