This does not really request posix extensions, but it depends on them
being activated because it changes behaviour.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
struct timespec w_time_ts = {0};
time_t write_time = 0;
SMB_INO_T ino = 0;
+ mode_t mode = S_IFREG;
struct cli_credentials *creds = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
&size,
&attr,
&ino,
- NULL);
+ &mode);
if (NT_STATUS_IS_OK(status)) {
goto setup_stat;
}
change_time_ts,
write_time_ts);
+ if ((context->internal->posix_extensions) && (mode != S_IFREG)) {
+ sb->st_mode = (sb->st_mode & ~S_IFMT) | mode;
+ }
+
TALLOC_FREE(frame);
return NT_STATUS_OK;