summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-13 09:03:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:51:42 -0500
commit8c2c5c5d1d3ccbb9f3bab9136c23d1020e4e20f1 (patch)
treedf8447da6dd3674f972ff81b8ca42f8bbf0a64cb /source3/utils
parentbad8c0d6f15990b8de6e9ff6dc79628c67eba187 (diff)
downloadsamba-8c2c5c5d1d3ccbb9f3bab9136c23d1020e4e20f1.tar.gz
samba-8c2c5c5d1d3ccbb9f3bab9136c23d1020e4e20f1.tar.bz2
samba-8c2c5c5d1d3ccbb9f3bab9136c23d1020e4e20f1.zip
r18446: Add the ldap 'leave domain' code - call this as
a non-fatal error path if the 'disable machine account' code succeeded. Jeremy. (This used to be commit f47bffa21ec1caf5ec3a6ec77af801df0b63d83a)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 5134727066..18c00f3de8 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -758,6 +758,7 @@ static int net_ads_status(int argc, const char **argv)
static int net_ads_leave(int argc, const char **argv)
{
ADS_STRUCT *ads = NULL;
+ ADS_STATUS adsret;
int ret = -1;
struct cli_state *cli = NULL;
TALLOC_CTX *ctx;
@@ -800,11 +801,21 @@ static int net_ads_leave(int argc, const char **argv)
goto done;
}
- d_printf("Disabled account for '%s' in realm '%s'\n",
- global_myname(), ads->config.realm);
-
ret = 0;
+ /* Now we've disabled the account, try and delete it
+ via LDAP - the old way we used to. Don't log a failure
+ if this failed. */
+
+ adsret = ads_leave_realm(ads, global_myname());
+ if (ADS_ERR_OK(adsret)) {
+ d_printf("Deleted account for '%s' in realm '%s'\n",
+ global_myname(), ads->config.realm);
+ } else {
+ d_printf("Disabled account for '%s' in realm '%s'\n",
+ global_myname(), ads->config.realm);
+ }
+
done:
if ( cli )
cli_shutdown(cli);