From: Jeremy Allison Date: Wed, 3 Jun 2020 21:12:38 +0000 (-0700) Subject: s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes. X-Git-Tag: ldb-2.2.0~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ad8a8f7ae5b727126d64587cbd859e2c27055d3;p=thirdparty%2Fsamba.git s3: libsmb: Change cli_setatr() and async version to use 32-bit attributes. Fix the callers. Only sets 16 bits on the wire for this level. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 308aaedc6e6..5ae7779192c 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -4497,7 +4497,7 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, const char *fname, - uint16_t attr, + uint32_t attr, time_t mtime) { struct tevent_req *req = NULL, *subreq = NULL; @@ -4572,7 +4572,7 @@ NTSTATUS cli_setatr_recv(struct tevent_req *req) NTSTATUS cli_setatr(struct cli_state *cli, const char *fname, - uint16_t attr, + uint32_t attr, time_t mtime) { TALLOC_CTX *frame = NULL; diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index cb0378290f8..12abb734c2d 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -1957,7 +1957,7 @@ SMBC_chmod_ctx(SMBCCTX *context, char *targetpath = NULL; struct cli_state *targetcli = NULL; char *path = NULL; - uint16_t attr; + uint32_t attr; uint16_t port = 0; TALLOC_CTX *frame = talloc_stackframe(); NTSTATUS status; diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index d1fa3cb10ac..5f50439c41b 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -644,7 +644,7 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, * seems to work on win98. */ if (ret && attr != (uint16_t) -1) { - ret = NT_STATUS_IS_OK(cli_setatr(srv->cli, path, attr, 0)); + ret = NT_STATUS_IS_OK(cli_setatr(srv->cli, path, (uint32_t)attr, 0)); } if (! ret) { diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index bbc3d6efa03..d0d15d31b9b 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -560,12 +560,12 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, const char *fname, - uint16_t attr, + uint32_t attr, time_t mtime); NTSTATUS cli_setatr_recv(struct tevent_req *req); NTSTATUS cli_setatr(struct cli_state *cli, const char *fname, - uint16_t attr, + uint32_t attr, time_t mtime); struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,