1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

r19524: Stop "net ads user delete" from doing funny things.

Guenther
This commit is contained in:
Günther Deschner 2006-11-01 10:38:54 +00:00 committed by Gerald (Jerry) Carter
parent 7c0ea791d2
commit a20e7c0315

View File

@ -574,7 +574,7 @@ static int ads_user_delete(int argc, const char **argv)
{
ADS_STRUCT *ads;
ADS_STATUS rc;
LDAPMessage *res;
LDAPMessage *res = NULL;
char *userdn;
if (argc < 1) {
@ -586,8 +586,9 @@ static int ads_user_delete(int argc, const char **argv)
}
rc = ads_find_user_acct(ads, &res, argv[0]);
if (!ADS_ERR_OK(rc)) {
if (!ADS_ERR_OK(rc) || ads_count_replies(ads, res) != 1) {
d_printf("User %s does not exist.\n", argv[0]);
ads_msgfree(ads, res);
ads_destroy(&ads);
return -1;
}
@ -595,7 +596,7 @@ static int ads_user_delete(int argc, const char **argv)
ads_msgfree(ads, res);
rc = ads_del_dn(ads, userdn);
ads_memfree(ads, userdn);
if (!ADS_ERR_OK(rc)) {
if (ADS_ERR_OK(rc)) {
d_printf("User %s deleted\n", argv[0]);
ads_destroy(&ads);
return 0;