timespec_string_buf(×[3], false, &tbuf[3])));
status = cli_setpathinfo_ext(
- cli, fname, times[0], times[1], times[2], times[3], -1);
+ cli, fname, times[0], times[1], times[2], times[3],
+ (uint32_t)-1);
if (!NT_STATUS_IS_OK(status)) {
d_printf("cli_setpathinfo_ext failed: %s\n",
nt_errstr(status));
struct timespec access_time,
struct timespec write_time,
struct timespec change_time,
- uint16_t attr)
+ uint32_t attr)
{
char *p = (char *)buf;
/*
TIMESTAMP_SET_NT_OR_BETTER, p, &change_time);
p += 8;
- if (attr == (uint16_t)-1 || attr == FILE_ATTRIBUTE_NORMAL) {
+ if (attr == (uint32_t)-1 || attr == FILE_ATTRIBUTE_NORMAL) {
/* No change. */
attr = 0;
} else if (attr == 0) {
struct timespec access_time,
struct timespec write_time,
struct timespec change_time,
- uint16_t attr)
+ uint32_t attr)
{
uint8_t buf[40];
access_time,
write_time,
change_time,
- attr);
+ (uint32_t)attr);
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
state->in_data = (DATA_BLOB) {
struct timespec access_time,
struct timespec write_time,
struct timespec change_time,
- uint16_t attr);
+ uint32_t attr);
struct tevent_req *cli_setfileinfo_ext_send(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
{
uint16_t fd;
int ret;
+ uint32_t lattr = (uint32_t)attr;
TALLOC_CTX *frame = talloc_stackframe();
+ if (attr == (uint16_t)-1) {
+ /*
+ * External ABI only passes in
+ * 16-bits of attribute. Make
+ * sure we correctly map to
+ * (uint32_t)-1 meaning don't
+ * change attributes if attr was
+ * passed in as 16-bit -1.
+ */
+ lattr = (uint32_t)-1;
+ }
+
+
/*
* First, try setpathinfo (if qpathinfo succeeded), for it is the
* modern function for "new code" to be using, and it works given a
access_time,
write_time,
change_time,
- attr))) {
+ lattr))) {
/*
* setpathinfo is not supported; go to plan B.
(struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* access */
(struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* write */
(struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT }, /* change */
- (uint16_t)-1);
+ (uint32_t)-1);
if (!NT_STATUS_IS_OK(status)) {
printf("cli_setpathinfo_ext failed with %s\n",
nt_errstr(status));