summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-27 00:29:10 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-27 00:29:10 +0000
commita0e1930489523b3c9682e6f90db710553cd70084 (patch)
tree3ee12a6822e068cbb095fbdf1b3862dc18ec3866 /source3/utils
parentfae1164304c39b43f231a952faf8cc91a9cca088 (diff)
downloadsamba-a0e1930489523b3c9682e6f90db710553cd70084.tar.gz
samba-a0e1930489523b3c9682e6f90db710553cd70084.tar.bz2
samba-a0e1930489523b3c9682e6f90db710553cd70084.zip
fixed bugs in fdpass tests
(This used to be commit ee4f6335adb2a781eea7e1f6b520d79ea1197427)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/torture.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c
index a3a39d83d7..aa2737af30 100644
--- a/source3/utils/torture.c
+++ b/source3/utils/torture.c
@@ -1466,7 +1466,7 @@ security hole)
*/
static void run_fdpasstest(int dummy)
{
- static struct cli_state cli1, cli2;
+ static struct cli_state cli1, cli2, cli3;
char *fname = "\\fdpass.tst";
int fnum1;
pstring buf;
@@ -1492,12 +1492,12 @@ static void run_fdpasstest(int dummy)
return;
}
- cli2.vuid = cli1.vuid;
- cli2.cnum = cli1.cnum;
- cli2.pid = cli1.pid;
-
+ cli3 = cli2;
+ cli3.vuid = cli1.vuid;
+ cli3.cnum = cli1.cnum;
+ cli3.pid = cli1.pid;
- if (cli_read(&cli2, fnum1, buf, 0, 13) == 13) {
+ if (cli_read(&cli3, fnum1, buf, 0, 13) == 13) {
printf("read succeeded! nasty security hole [%s]\n",
buf);
return;
@@ -1588,13 +1588,16 @@ static void run_maxfidtest(int dummy)
break;
}
fnum++;
+ if (fnum % 100 == 0) printf("%d\r", fnum);
}
+ printf("%d\n", fnum);
printf("cleaning up\n");
- while (fnum > n) {
+ while (fnum > 0) {
fnum--;
slprintf(fname,sizeof(fname)-1,template, fnum,(int)getpid());
- if (cli_unlink(&cli, fname)) {
+ cli_close(&cli, fnum);
+ if (!cli_unlink(&cli, fname)) {
printf("unlink of %s failed (%s)\n",
fname, cli_errstr(&cli));
}