svn commit: samba r6430 - in
branches/SAMBA_4_0/source/torture/libnet: .
mimir at samba.org
mimir at samba.org
Fri Apr 22 05:11:53 GMT 2005
Author: mimir
Date: 2005-04-22 05:11:53 +0000 (Fri, 22 Apr 2005)
New Revision: 6430
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6430
Log:
Delete existing test account if, for some reason, it hasn't been
deleted last time running the test.
rafal
Modified:
branches/SAMBA_4_0/source/torture/libnet/userman.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/libnet/userman.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/userman.c 2005-04-22 04:25:21 UTC (rev 6429)
+++ branches/SAMBA_4_0/source/torture/libnet/userman.c 2005-04-22 05:11:53 UTC (rev 6430)
@@ -176,6 +176,22 @@
status = dcerpc_samr_CreateUser(p, mem_ctx, &r1);
if (!NT_STATUS_IS_OK(status)) {
printf("CreateUser failed - %s\n", nt_errstr(status));
+
+ if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
+ printf("User (%s) already exists - attempting to delete and recreate account again\n", user);
+ if (!test_cleanup(p, mem_ctx, handle, TEST_USERNAME)) {
+ return False;
+ }
+
+ printf("creating user account\n");
+
+ status = dcerpc_samr_CreateUser(p, mem_ctx, &r1);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("CreateUser failed - %s\n", nt_errstr(status));
+ return False;
+ }
+ return True;
+ }
return False;
}
@@ -292,12 +308,12 @@
ret = False;
goto done;
}
-
- if (!test_userdel(p, mem_ctx, &h, name)) {
+
+ if (!test_userdel(p, mem_ctx, &h, name)) {
ret = False;
goto done;
}
-
+
done:
talloc_free(mem_ctx);
return ret;
More information about the samba-cvs
mailing list