]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture3: Use cli_chmod instead of cli_posix_chmod
authorVolker Lendecke <vl@samba.org>
Fri, 2 Aug 2024 21:06:17 +0000 (23:06 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 6 Aug 2024 16:29:33 +0000 (16:29 +0000)
Show that it works the same even for dangling posix symlinks

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/test_posix.c
source3/torture/torture.c

index 58bb7cd9cdea8050db4847755031408ac87a2a98..07185615dd5a6e5ebcadfa160e077aff1860c727 100644 (file)
@@ -1066,19 +1066,19 @@ bool run_posix_symlink_chmod_test(int dummy)
        }
 
        /* We should not be able to chmod symlinks that point to something. */
-       status = cli_posix_chmod(cli_unix, fname_real_symlink, 0777);
+       status = cli_chmod(cli_unix, fname_real_symlink, 0777);
 
        /* This should fail with something other than server crashed. */
        if (NT_STATUS_IS_OK(status)) {
-               printf("cli_posix_chmod of %s succeeded (should have failed)\n",
-                       fname_real_symlink);
+               printf("cli_chmod of %s succeeded (should have failed)\n",
+                      fname_real_symlink);
                goto out;
        }
        if (NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_DISCONNECTED)) {
                /* Oops. Server crashed. */
-               printf("cli_posix_chmod of %s failed error %s\n",
-                       fname_real_symlink,
-                       nt_errstr(status));
+               printf("cli_chmod of %s failed error %s\n",
+                      fname_real_symlink,
+                      nt_errstr(status));
                goto out;
        }
        /* Any other failure is ok. */
@@ -1096,19 +1096,19 @@ bool run_posix_symlink_chmod_test(int dummy)
        }
 
        /* We should not be able to chmod symlinks that point to nothing. */
-       status = cli_posix_chmod(cli_unix, nonexist_symlink, 0777);
+       status = cli_chmod(cli_unix, nonexist_symlink, 0777);
 
        /* This should fail with something other than server crashed. */
        if (NT_STATUS_IS_OK(status)) {
-               printf("cli_posix_chmod of %s succeeded (should have failed)\n",
-                       nonexist_symlink);
+               printf("cli_chmod of %s succeeded (should have failed)\n",
+                      nonexist_symlink);
                goto out;
        }
        if (NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_DISCONNECTED)) {
                /* Oops. Server crashed. */
-               printf("cli_posix_chmod of %s failed error %s\n",
-                       nonexist_symlink,
-                       nt_errstr(status));
+               printf("cli_chmod of %s failed error %s\n",
+                      nonexist_symlink,
+                      nt_errstr(status));
                goto out;
        }
 
index 1f8621654ec58b285e5792085219bbfeec8bc0b2..2dc7d831b8fa6dd7b9706f5e7526b00f3bd25f89 100644 (file)
@@ -6755,10 +6755,11 @@ static bool run_rename_access(int dummy)
                goto fail;
        }
        /* Now go around the back and chmod to 777 via POSIX. */
-       status = cli_posix_chmod(posix_cli, dname, 0777);
+       status = cli_chmod(posix_cli, dname, 0777);
        if (!NT_STATUS_IS_OK(status)) {
-               printf("cli_posix_chmod failed for %s (%s)\n",
-                       dname, nt_errstr(status));
+               printf("cli_chmod failed for %s (%s)\n",
+                      dname,
+                      nt_errstr(status));
                goto fail;
        }