summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-04-16 16:21:31 -0700
committerJeremy Allison <jra@samba.org>2009-04-16 16:22:37 -0700
commit37b1b9cfe90c81ec64486e68867fbd024250701f (patch)
treecbdb08774971238a5df0fc2383c5b9e8a3e384e9
parentd55ec4fd237ef6ebea2ee9a55c7d85dfe21f7737 (diff)
downloadsamba-37b1b9cfe90c81ec64486e68867fbd024250701f.tar.gz
samba-37b1b9cfe90c81ec64486e68867fbd024250701f.tar.bz2
samba-37b1b9cfe90c81ec64486e68867fbd024250701f.zip
Add torture tester to ensure we don't regress the ulogoff bug.
Jeremy.
-rw-r--r--source3/torture/torture.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 804e772516..33358307ae 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -5199,6 +5199,50 @@ static bool run_cli_echo(int dummy)
return NT_STATUS_IS_OK(status);
}
+static bool run_uid_regression_test(int dummy)
+{
+ static struct cli_state *cli;
+ int16_t old_vuid;
+ bool correct = True;
+
+ printf("starting uid regression test\n");
+
+ if (!torture_open_connection(&cli, 0)) {
+ return False;
+ }
+
+ cli_sockopt(cli, sockops);
+
+ /* Ok - now save then logoff our current user. */
+ old_vuid = cli->vuid;
+
+ if (!cli_ulogoff(cli)) {
+ d_printf("(%s) cli_ulogoff failed: %s\n",
+ __location__, cli_errstr(cli));
+ correct = false;
+ goto out;
+ }
+
+ cli->vuid = old_vuid;
+
+ /* Try an operation. */
+ if (!cli_mkdir(cli, "\\uid_reg_test")) {
+ /* We expect bad uid. */
+ if (!check_error(__LINE__, cli, ERRSRV, ERRbaduid,
+ NT_STATUS_NO_SUCH_USER)) {
+ return False;
+ }
+ goto out;
+ }
+
+ cli_rmdir(cli, "\\uid_reg_test");
+
+ out:
+
+ torture_close_connection(cli);
+ return correct;
+}
+
static bool run_local_substitute(int dummy)
{
bool ok = true;
@@ -5778,6 +5822,7 @@ static struct {
{"RW3", run_readwritelarge, 0},
{"OPEN", run_opentest, 0},
{"POSIX", run_simple_posix_open_test, 0},
+ { "UID-REGRESSION-TEST", run_uid_regression_test, 0},
#if 1
{"OPENATTR", run_openattrtest, 0},
#endif