From: Volker Lendecke Date: Wed, 23 Aug 2023 11:47:20 +0000 (+0200) Subject: libsmb: Add placeholder "mode" parameter to cli_qpathinfo2() X-Git-Tag: tevent-0.16.0~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30f4129e860b36c42d8d00048e1b98b23dc0cb2c;p=thirdparty%2Fsamba.git libsmb: Add placeholder "mode" parameter to cli_qpathinfo2() Unused so far: Patch stripped out to not clutter the real patches that follow. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Böhme Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 7944eeb847c..eb3e028e7d6 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -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) { diff --git a/source3/libsmb/clirap.h b/source3/libsmb/clirap.h index 8f351e42ff2..4dc0441cc5b 100644 --- a/source3/libsmb/clirap.h +++ b/source3/libsmb/clirap.h @@ -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, diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index 98750754036..858679a8cc1 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -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; } diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 3c18058ce5b..86a6e928e14 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -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));