s3:torture: Remove trailing spaces in torture.c
authorAndreas Schneider <asn@samba.org>
Thu, 25 Apr 2024 09:55:17 +0000 (11:55 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 29 Apr 2024 08:43:32 +0000 (08:43 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/torture/torture.c

index b986d44d1689d2f66bd2ac3862bab22307aa9128..d2b97b9bfeee2d8b314d9ba5662cee57c912194a 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    SMB torture tester
    Copyright (C) Andrew Tridgell 1997-1998
@@ -336,7 +336,7 @@ bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
 }
 
 static bool torture_open_connection_share(struct cli_state **c,
-                                  const char *hostname, 
+                                  const char *hostname,
                                   const char *sharename,
                                   int flags)
 {
@@ -636,9 +636,9 @@ static bool check_error(int line, NTSTATUS status,
                num = NT_STATUS_DOS_CODE(status);
 
                 if (eclass != cclass || ecode != num) {
-                        printf("unexpected error code class=%d code=%d\n", 
+                        printf("unexpected error code class=%d code=%d\n",
                                (int)cclass, (int)num);
-                        printf(" expected %d/%d %s (line=%d)\n", 
+                        printf(" expected %d/%d %s (line=%d)\n",
                                (int)eclass, (int)ecode, nt_errstr(nterr),
                               line);
                         return False;
@@ -742,7 +742,7 @@ static bool rw_torture(struct cli_state *c)
 
        memset(buf, '\0', sizeof(buf));
 
-       status = cli_openx(c, lockfname, O_RDWR | O_CREAT | O_EXCL, 
+       status = cli_openx(c, lockfname, O_RDWR | O_CREAT | O_EXCL,
                         DENY_NONE, &fnum2);
        if (!NT_STATUS_IS_OK(status)) {
                status = cli_openx(c, lockfname, O_RDWR, DENY_NONE, &fnum2);
@@ -895,7 +895,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
        {
                for (i = 0; i < 500 && fnum == (uint16_t)-1; i++)
                {
-                       status = cli_openx(c, lockfname, O_RDONLY, 
+                       status = cli_openx(c, lockfname, O_RDONLY,
                                         DENY_NONE, &fnum);
                        if (NT_STATUS_IS_OK(status)) {
                                break;
@@ -1026,7 +1026,7 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
                        printf("read failed\n");
                        printf("read %ld, expected %ld\n",
                               (unsigned long)bytes_read,
-                              (unsigned long)buf_size); 
+                              (unsigned long)buf_size);
                        correct = False;
                        break;
                }
@@ -1277,7 +1277,7 @@ static bool run_netbench(int client)
                }
 
                if (!strcmp(params[0],"NTCreateX")) {
-                       nb_createx(params[1], ival(params[2]), ival(params[3]), 
+                       nb_createx(params[1], ival(params[2]), ival(params[3]),
                                   ival(params[4]));
                } else if (!strcmp(params[0],"Close")) {
                        nb_close(ival(params[1]));
@@ -1298,10 +1298,10 @@ static bool run_netbench(int client)
                } else if (!strcmp(params[0],"FIND_FIRST")) {
                        nb_findfirst(params[1]);
                } else if (!strcmp(params[0],"WriteX")) {
-                       nb_writex(ival(params[1]), 
+                       nb_writex(ival(params[1]),
                                  ival(params[2]), ival(params[3]), ival(params[4]));
                } else if (!strcmp(params[0],"ReadX")) {
-                       nb_readx(ival(params[1]), 
+                       nb_readx(ival(params[1]),
                                  ival(params[2]), ival(params[3]), ival(params[4]));
                } else if (!strcmp(params[0],"Flush")) {
                        nb_flush(ival(params[1]));
@@ -1337,7 +1337,7 @@ static bool run_nbench(int dummy)
        t = create_procs(run_netbench, &correct);
        alarm(0);
 
-       printf("\nThroughput %g MB/sec\n", 
+       printf("\nThroughput %g MB/sec\n",
               1.0e-6 * nbio_total() / t);
        return correct;
 }
@@ -1659,7 +1659,7 @@ static bool tcon_devtest(struct cli_state *cli,
                        if (return_devtype != NULL &&
                            strequal(cli->dev, return_devtype)) {
                                ret = True;
-                       } else { 
+                       } else {
                                printf("tconX to share %s with type %s "
                                       "succeeded but returned the wrong "
                                       "device type (got [%s] but should have got [%s])\n",
@@ -1756,10 +1756,10 @@ static bool run_tcon_devtype_test(int dummy)
 
 
 /*
-  This test checks that 
+  This test checks that
 
   1) the server supports multiple locking contexts on the one SMB
-  connection, distinguished by PID.  
+  connection, distinguished by PID.
 
   2) the server correctly fails overlapping locks made by the same PID (this
      goes against POSIX behaviour, which is why it is tricky to implement)
@@ -1921,7 +1921,7 @@ static bool run_locktest2(int dummy)
 
 
 /*
-  This test checks that 
+  This test checks that
 
   1) the server supports the full offset range in lock requests
 */
@@ -1965,7 +1965,7 @@ static bool run_locktest3(int dummy)
 
                status = cli_lock32(cli1, fnum1, offset-1, 1, 0, WRITE_LOCK);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("lock1 %d failed (%s)\n", 
+                       printf("lock1 %d failed (%s)\n",
                               i,
                               nt_errstr(status));
                        return False;
@@ -1973,7 +1973,7 @@ static bool run_locktest3(int dummy)
 
                status = cli_lock32(cli2, fnum2, offset-2, 1, 0, WRITE_LOCK);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("lock2 %d failed (%s)\n", 
+                       printf("lock2 %d failed (%s)\n",
                               i,
                               nt_errstr(status));
                        return False;
@@ -2013,7 +2013,7 @@ static bool run_locktest3(int dummy)
 
                status = cli_unlock(cli1, fnum1, offset-1, 1);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("unlock1 %d failed (%s)\n", 
+                       printf("unlock1 %d failed (%s)\n",
                               i,
                               nt_errstr(status));
                        return False;
@@ -2021,7 +2021,7 @@ static bool run_locktest3(int dummy)
 
                status = cli_unlock(cli2, fnum2, offset-2, 1);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("unlock2 %d failed (%s)\n", 
+                       printf("unlock2 %d failed (%s)\n",
                               i,
                               nt_errstr(status));
                        return False;
@@ -2374,12 +2374,12 @@ static bool run_locktest5(int dummy)
                  NT_STATUS_IS_OK(cli_unlock(cli1, fnum1, 0, 4));
 
        EXPECTED(ret, True);
-       printf("the same process %s unlock the stack of 4 locks\n", ret?"can":"cannot"); 
+       printf("the same process %s unlock the stack of 4 locks\n", ret?"can":"cannot");
 
        /* Ensure the next unlock fails. */
        ret = NT_STATUS_IS_OK(cli_unlock(cli1, fnum1, 0, 4));
        EXPECTED(ret, False);
-       printf("the same process %s count the lock stack\n", !ret?"can":"cannot"); 
+       printf("the same process %s count the lock stack\n", !ret?"can":"cannot");
 
        /* Ensure connection 2 can get a write lock. */
        status = cli_lock32(cli2, fnum2, 0, 4, 0, WRITE_LOCK);
@@ -3858,7 +3858,7 @@ static bool run_fdsesstest(int dummy)
 }
 
 /*
-  This test checks that 
+  This test checks that
 
   1) the server does not allow an unlink on a file that is open
 */
@@ -3938,7 +3938,7 @@ static bool run_maxfidtest(int dummy)
                status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE,
                                  &fnums[i]);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("open of %s failed (%s)\n", 
+                       printf("open of %s failed (%s)\n",
                               fname, nt_errstr(status));
                        printf("maximum fnum is %d\n", i);
                        break;
@@ -3955,7 +3955,7 @@ static bool run_maxfidtest(int dummy)
 
                status = cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
                if (!NT_STATUS_IS_OK(status)) {
-                       printf("unlink of %s failed (%s)\n", 
+                       printf("unlink of %s failed (%s)\n",
                               fname, nt_errstr(status));
                        correct = False;
                }
@@ -4095,12 +4095,12 @@ static bool run_randomipc(int dummy)
 
                rand_buf(param, param_len);
 
-               SSVAL(param,0,api); 
+               SSVAL(param,0,api);
 
-               cli_api(cli, 
-                       param, param_len, 8,  
+               cli_api(cli,
+                       param, param_len, 8,
                        NULL, 0, CLI_BUFFER_SIZE,
-                       &rparam, &rprcnt,     
+                       &rparam, &rprcnt,
                        &rdata, &rdrcnt);
                if (i % 100 == 0) {
                        printf("%d/%d\r", i,count);
@@ -4146,12 +4146,12 @@ static bool run_browsetest(int dummy)
        }
 
        printf("domain list:\n");
-       cli_NetServerEnum(cli, cli->server_domain, 
+       cli_NetServerEnum(cli, cli->server_domain,
                          SV_TYPE_DOMAIN_ENUM,
                          browse_callback, NULL);
 
        printf("machine list:\n");
-       cli_NetServerEnum(cli, cli->server_domain, 
+       cli_NetServerEnum(cli, cli->server_domain,
                          SV_TYPE_ALL,
                          browse_callback, NULL);
 
@@ -4215,7 +4215,7 @@ static bool run_attrtest(int dummy)
        }
 
        cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
-       cli_openx(cli, fname, 
+       cli_openx(cli, fname,
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
        cli_close(cli, fnum);
 
@@ -4534,7 +4534,7 @@ static bool run_trans2test(int dummy)
 
 
        cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
-       cli_openx(cli, fname, 
+       cli_openx(cli, fname,
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
        cli_close(cli, fnum);
        status = cli_qpathinfo2(cli,
@@ -4597,7 +4597,7 @@ static bool run_trans2test(int dummy)
                correct = False;
        }
 
-       cli_openx(cli, fname2, 
+       cli_openx(cli, fname2,
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
        cli_writeall(cli, fnum,  0, (uint8_t *)&fnum, 0, sizeof(fnum), NULL);
        cli_close(cli, fnum);
@@ -4671,7 +4671,7 @@ static bool run_w2ktest(int dummy)
                return False;
        }
 
-       cli_openx(cli, fname, 
+       cli_openx(cli, fname,
                        O_RDWR | O_CREAT , DENY_NONE, &fnum);
 
        for (level = 1004; level < 1040; level++) {
@@ -10430,7 +10430,7 @@ static bool run_error_map_extract(int dummy) {
                if (!NT_STATUS_IS_DOS(status)) {
                        nt_status = status;
                } else {
-                       printf("/** Dos error on NT connection! (%s) */\n", 
+                       printf("/** Dos error on NT connection! (%s) */\n",
                               nt_errstr(status));
                        nt_status = NT_STATUS(0xc0000000);
                }
@@ -10442,7 +10442,7 @@ static bool run_error_map_extract(int dummy) {
 
                /* Case #1: 32-bit NT errors */
                if (NT_STATUS_IS_DOS(status)) {
-                       printf("/** NT error on DOS connection! (%s) */\n", 
+                       printf("/** NT error on DOS connection! (%s) */\n",
                               nt_errstr(status));
                        errnum = errclass = 0;
                } else {
@@ -10450,15 +10450,15 @@ static bool run_error_map_extract(int dummy) {
                        errnum = NT_STATUS_DOS_CODE(status);
                }
 
-               if (NT_STATUS_V(nt_status) != error) { 
-                       printf("/*\t{ This NT error code was 'sqashed'\n\t from %s to %s \n\t during the session setup }\n*/\n", 
-                              get_nt_error_c_code(talloc_tos(), NT_STATUS(error)), 
+               if (NT_STATUS_V(nt_status) != error) {
+                       printf("/*\t{ This NT error code was 'sqashed'\n\t from %s to %s \n\t during the session setup }\n*/\n",
+                              get_nt_error_c_code(talloc_tos(), NT_STATUS(error)),
                               get_nt_error_c_code(talloc_tos(), nt_status));
                }
 
-               printf("\t{%s,\t%s,\t%s},\n", 
-                      smb_dos_err_class(errclass), 
-                      smb_dos_err_name(errclass, errnum), 
+               printf("\t{%s,\t%s,\t%s},\n",
+                      smb_dos_err_class(errclass),
+                      smb_dos_err_name(errclass, errnum),
                       get_nt_error_c_code(talloc_tos(), NT_STATUS(error)));
 
                TALLOC_FREE(user_creds);
@@ -15351,7 +15351,7 @@ static double create_procs(bool (*fn)(int), bool *result)
                                        printf("pid %d failed to start\n", (int)getpid());
                                        _exit(1);
                                }
-                               smb_msleep(10); 
+                               smb_msleep(10);
                        }
 
                        child_status[i] = getpid();
@@ -16272,7 +16272,7 @@ static bool run_test(const char *name)
        }
 
        for (i=0;torture_ops[i].name;i++) {
-               fstr_sprintf(randomfname, "\\XX%x", 
+               fstr_sprintf(randomfname, "\\XX%x",
                         (unsigned)random());
 
                if (strequal(name, torture_ops[i].name)) {
@@ -16280,7 +16280,7 @@ static bool run_test(const char *name)
                        printf("Running %s\n", name);
                        if (torture_ops[i].flags & FLAG_MULTIPROC) {
                                t = create_procs(torture_ops[i].fn, &result);
-                               if (!result) { 
+                               if (!result) {
                                        ret = False;
                                        printf("TEST %s FAILED!\n", name);
                                }
@@ -16518,7 +16518,7 @@ static void usage(void)
                }
        }
 
-       printf("host=%s share=%s user=%s myname=%s\n", 
+       printf("host=%s share=%s user=%s myname=%s\n",
               host, share, username, myname);
 
        torture_creds = cli_session_creds_init(frame,