Fix for pdbedit error code returns (sorry, forgot who sent in the patch).
authorJeremy Allison <jra@samba.org>
Thu, 27 Nov 2003 18:34:42 +0000 (18:34 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 27 Nov 2003 18:34:42 +0000 (18:34 +0000)
Jeremy.
(This used to be commit 685097bc50a8ef387c5082401858d482329c37bc)

source3/utils/pdbedit.c

index c69b14946944def016e2676f19a0046a355bc46e..d72634d78b52389e2568cc3ac1318faed60fad0f 100644 (file)
@@ -489,7 +489,11 @@ static int delete_user_entry (struct pdb_context *in, const char *username)
                return -1;
        }
 
-       return NT_STATUS_IS_OK(in->pdb_delete_sam_account (in, samaccount));
+       if (!NT_STATUS_IS_OK(in->pdb_delete_sam_account (in, samaccount))) {
+               fprintf (stderr, "Unable to delete user %s\n", username);
+               return -1;
+       }
+       return 0;
 }
 
 /*********************************************************
@@ -515,7 +519,12 @@ static int delete_machine_entry (struct pdb_context *in, const char *machinename
                return -1;
        }
 
-       return NT_STATUS_IS_OK(in->pdb_delete_sam_account (in, samaccount));
+       if (!NT_STATUS_IS_OK(in->pdb_delete_sam_account (in, samaccount))) {
+               fprintf (stderr, "Unable to delete machine %s\n", name);
+               return -1;
+       }
+
+       return 0;
 }
 
 /*********************************************************