summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-18 12:45:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:42 -0500
commit900fe6a6258b441d54f88400996235ce25ab7f83 (patch)
tree67e89b51ed95e5a0d009a4df48fff3c996eb89bc /source3/utils
parent01c77cefef0aa2e45384ee0fe9899b8b1d25ab66 (diff)
downloadsamba-900fe6a6258b441d54f88400996235ce25ab7f83.tar.gz
samba-900fe6a6258b441d54f88400996235ce25ab7f83.tar.bz2
samba-900fe6a6258b441d54f88400996235ce25ab7f83.zip
r17603: Make net_ads_join_ok return NTSTATUS.
Thanks to Michael Adam <ma@sernet.de> hop, hop, hop... ;-) Volker (This used to be commit 47facab798bdc6e20b2620972f1b8f2338fac239)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 8303e22a3b..2fbe088653 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -812,23 +812,25 @@ done:
return ret;
}
-static int net_ads_join_ok(void)
+static NTSTATUS net_ads_join_ok(void)
{
ADS_STRUCT *ads = NULL;
+ ADS_STATUS status;
if (!secrets_init()) {
DEBUG(1,("Failed to initialise secrets database\n"));
- return -1;
+ return NT_STATUS_ACCESS_DENIED;
}
net_use_machine_password();
- if (!ADS_ERR_OK(ads_startup(True, &ads))) {
- return -1;
+ status = ads_startup(True, &ads);
+ if (!ADS_ERR_OK(status)) {
+ return ads_ntstatus(status);
}
ads_destroy(&ads);
- return 0;
+ return NT_STATUS_OK;
}
/*
@@ -836,11 +838,14 @@ static int net_ads_join_ok(void)
*/
int net_ads_testjoin(int argc, const char **argv)
{
+ NTSTATUS status;
use_in_memory_ccache();
/* Display success or failure */
- if (net_ads_join_ok() != 0) {
- fprintf(stderr,"Join to domain is not valid\n");
+ status = net_ads_join_ok();
+ if (!NT_STATUS_IS_OK(status)) {
+ fprintf(stderr,"Join to domain is not valid: %s\n",
+ get_friendly_nt_error_msg(status));
return -1;
}