]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Add placeholder "mode" parameter to cli_qpathinfo2()
authorVolker Lendecke <vl@samba.org>
Wed, 23 Aug 2023 11:47:20 +0000 (13:47 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 12 Oct 2023 16:55:34 +0000 (16:55 +0000)
Unused so far: Patch stripped out to not clutter the real patches that
follow.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/clirap.c
source3/libsmb/clirap.h
source3/libsmb/libsmb_file.c
source3/torture/torture.c

index 7944eeb847c2e2daf2783f299066812d97ebace4..eb3e028e7d66273923aff27899140a28c2f28d46 100644 (file)
@@ -893,8 +893,10 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
                             struct timespec *access_time,
                             struct timespec *write_time,
                             struct timespec *change_time,
-                            off_t *size, uint32_t *pattr,
-                            SMB_INO_T *ino)
+                            off_t *size,
+                            uint32_t *pattr,
+                            SMB_INO_T *ino,
+                            mode_t *mode)
 {
        struct cli_qpathinfo2_state *state = tevent_req_data(
                req, struct cli_qpathinfo2_state);
@@ -925,16 +927,22 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
        if (ino) {
                *ino = state->ino;
        }
+       if (mode != NULL) {
+               *mode = 0;
+       }
        return NT_STATUS_OK;
 }
 
-NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
+NTSTATUS cli_qpathinfo2(struct cli_state *cli,
+                       const char *fname,
                        struct timespec *create_time,
                        struct timespec *access_time,
                        struct timespec *write_time,
                        struct timespec *change_time,
-                       off_t *size, uint32_t *pattr,
-                       SMB_INO_T *ino)
+                       off_t *size,
+                       uint32_t *pattr,
+                       SMB_INO_T *ino,
+                       mode_t *mode)
 {
        TALLOC_CTX *frame = talloc_stackframe();
        struct tevent_context *ev = NULL;
@@ -959,8 +967,15 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
        if (!tevent_req_poll_ntstatus(req, ev, &status)) {
                goto fail;
        }
-       status = cli_qpathinfo2_recv(req, create_time, access_time,
-                                    write_time, change_time, size, pattr, ino);
+       status = cli_qpathinfo2_recv(req,
+                                    create_time,
+                                    access_time,
+                                    write_time,
+                                    change_time,
+                                    size,
+                                    pattr,
+                                    ino,
+                                    mode);
  fail:
        TALLOC_FREE(frame);
        return status;
@@ -1693,9 +1708,16 @@ NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
                 * an intermediate attr variable as below but can
                 * pass pattr directly.
                 */
-               return cli_qpathinfo2(cli, fname,
-                                     create_time, access_time, write_time, change_time,
-                                     size, pattr, ino);
+               return cli_qpathinfo2(cli,
+                                     fname,
+                                     create_time,
+                                     access_time,
+                                     write_time,
+                                     change_time,
+                                     size,
+                                     pattr,
+                                     ino,
+                                     NULL);
        }
 
        if (create_time || access_time || write_time || change_time || pattr) {
index 8f351e42ff2af8cf0df1b361b9f5bf1c9bbad3da..4dc0441cc5bb786aaf8f6ed0729edf3182a22218 100644 (file)
@@ -74,15 +74,20 @@ NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
                             struct timespec *access_time,
                             struct timespec *write_time,
                             struct timespec *change_time,
-                            off_t *size, uint32_t *pattr,
-                            SMB_INO_T *ino);
-NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
+                            off_t *size,
+                            uint32_t *pattr,
+                            SMB_INO_T *ino,
+                            mode_t *mode);
+NTSTATUS cli_qpathinfo2(struct cli_state *cli,
+                       const char *fname,
                        struct timespec *create_time,
                        struct timespec *access_time,
                        struct timespec *write_time,
                        struct timespec *change_time,
-                       off_t *size, uint32_t *pattr,
-                       SMB_INO_T *ino);
+                       off_t *size,
+                       uint32_t *pattr,
+                       SMB_INO_T *ino,
+                       mode_t *mode);
 NTSTATUS cli_qpathinfo3(struct cli_state *cli, const char *fname,
                        struct timespec *create_time,
                        struct timespec *access_time,
index 98750754036fa5a951491f696f7b280c5ddff54b..858679a8cc1e91b87b452097935d58596ea651cd 100644 (file)
@@ -516,7 +516,8 @@ SMBC_getatr(SMBCCTX * context,
                                        &change_time_ts,
                                        &size,
                                        &attr,
-                                       &ino);
+                                       &ino,
+                                       NULL);
                if (NT_STATUS_IS_OK(status)) {
                        goto setup_stat;
                }
index 3c18058ce5b7efb8c1cc3ce6107786e9b3b4a110..86a6e928e14c4b93449e6ef3c598cb62c951234c 100644 (file)
@@ -4534,8 +4534,16 @@ static bool run_trans2test(int dummy)
        cli_openx(cli, fname, 
                        O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
        cli_close(cli, fnum);
-       status = cli_qpathinfo2(cli, fname, &c_time_ts, &a_time_ts, &w_time_ts,
-                               &m_time_ts, &size, NULL, &ino);
+       status = cli_qpathinfo2(cli,
+                               fname,
+                               &c_time_ts,
+                               &a_time_ts,
+                               &w_time_ts,
+                               &m_time_ts,
+                               &size,
+                               NULL,
+                               &ino,
+                               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("ERROR: qpathinfo2 failed (%s)\n", nt_errstr(status));
                correct = False;
@@ -4571,8 +4579,16 @@ static bool run_trans2test(int dummy)
                correct = False;
        }
        sleep(3);
-       status = cli_qpathinfo2(cli, "\\trans2\\", &c_time_ts, &a_time_ts,
-                               &w_time_ts, &m_time_ts, &size, NULL, NULL);
+       status = cli_qpathinfo2(cli,
+                               "\\trans2\\",
+                               &c_time_ts,
+                               &a_time_ts,
+                               &w_time_ts,
+                               &m_time_ts,
+                               &size,
+                               NULL,
+                               NULL,
+                               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("ERROR: qpathinfo2 failed (%s)\n", nt_errstr(status));
                correct = False;
@@ -4582,8 +4598,16 @@ static bool run_trans2test(int dummy)
                        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);
-       status = cli_qpathinfo2(cli, "\\trans2\\", &c_time_ts, &a_time_ts,
-                               &w_time_ts, &m_time2_ts, &size, NULL, NULL);
+       status = cli_qpathinfo2(cli,
+                               "\\trans2\\",
+                               &c_time_ts,
+                               &a_time_ts,
+                               &w_time_ts,
+                               &m_time2_ts,
+                               &size,
+                               NULL,
+                               NULL,
+                               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("ERROR: qpathinfo2 failed (%s)\n", nt_errstr(status));
                correct = False;
@@ -12471,8 +12495,16 @@ static bool run_dir_createtime(int dummy)
                goto out;
        }
 
-       status = cli_qpathinfo2(cli, dname, &create_time, NULL, NULL, NULL,
-                               NULL, NULL, &ino);
+       status = cli_qpathinfo2(cli,
+                               dname,
+                               &create_time,
+                               NULL,
+                               NULL,
+                               NULL,
+                               NULL,
+                               NULL,
+                               &ino,
+                               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("cli_qpathinfo2 returned %s\n",
                       nt_errstr(status));
@@ -12503,8 +12535,16 @@ static bool run_dir_createtime(int dummy)
                goto out;
        }
 
-       status = cli_qpathinfo2(cli, dname, &create_time1, NULL, NULL, NULL,
-                               NULL, NULL, NULL);
+       status = cli_qpathinfo2(cli,
+                               dname,
+                               &create_time1,
+                               NULL,
+                               NULL,
+                               NULL,
+                               NULL,
+                               NULL,
+                               NULL,
+                               NULL);
        if (!NT_STATUS_IS_OK(status)) {
                printf("cli_qpathinfo2 (2) returned %s\n",
                       nt_errstr(status));