diff options
author | Günther Deschner <gd@samba.org> | 2008-04-14 16:13:52 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-04-14 16:13:52 +0200 |
commit | bc65d9678274d5d1c2f0179955c6d2cfdf20c752 (patch) | |
tree | 117434850f3d0ed666de466ee2b019ad56dbc06e /source3 | |
parent | 202e8cc57efc1f69f0d6dd57a6e9bc38ea8e4afd (diff) | |
download | samba-bc65d9678274d5d1c2f0179955c6d2cfdf20c752.tar.gz samba-bc65d9678274d5d1c2f0179955c6d2cfdf20c752.tar.bz2 samba-bc65d9678274d5d1c2f0179955c6d2cfdf20c752.zip |
net: use WERROR for check_ads_config().
Guenther
(This used to be commit 9176057986be63c7ebebb56f7daabbc3883802c5)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/net_ads.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 9c8d1fbb1f..a6712b7172 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -918,27 +918,27 @@ int net_ads_testjoin(int argc, const char **argv) Simple configu checks before beginning the join ********************************************************************/ -static NTSTATUS check_ads_config( void ) +static WERROR check_ads_config( void ) { if (lp_server_role() != ROLE_DOMAIN_MEMBER ) { d_printf("Host is not configured as a member server.\n"); - return NT_STATUS_INVALID_DOMAIN_ROLE; + return WERR_INVALID_DOMAIN_ROLE; } if (strlen(global_myname()) > 15) { d_printf("Our netbios name can be at most 15 chars long, " "\"%s\" is %u chars long\n", global_myname(), (unsigned int)strlen(global_myname())); - return NT_STATUS_NAME_TOO_LONG; + return WERR_INVALID_COMPUTER_NAME; } if ( lp_security() == SEC_ADS && !*lp_realm()) { d_fprintf(stderr, "realm must be set in in %s for ADS " "join to succeed.\n", get_dyn_CONFIGFILE()); - return NT_STATUS_INVALID_PARAMETER; + return WERR_INVALID_PARAM; } - return NT_STATUS_OK; + return WERR_OK; } /******************************************************************* @@ -1096,7 +1096,6 @@ static int net_ads_join_usage(int argc, const char **argv) int net_ads_join(int argc, const char **argv) { - NTSTATUS nt_status; TALLOC_CTX *ctx = NULL; struct libnet_JoinCtx *r = NULL; const char *domain = lp_realm(); @@ -1108,10 +1107,9 @@ int net_ads_join(int argc, const char **argv) const char *os_name = NULL; const char *os_version = NULL; - nt_status = check_ads_config(); - if (!NT_STATUS_IS_OK(nt_status)) { + werr = check_ads_config(); + if (!W_ERROR_IS_OK(werr)) { d_fprintf(stderr, "Invalid configuration. Exiting....\n"); - werr = ntstatus_to_werror(nt_status); goto fail; } |