mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
libsmbclient: Read the file type from the server with posix enabled
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>
This commit is contained in:
parent
feb7803555
commit
6a4413c65c
@ -467,6 +467,7 @@ SMBC_getatr(SMBCCTX * context,
|
||||
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;
|
||||
@ -517,7 +518,7 @@ SMBC_getatr(SMBCCTX * context,
|
||||
&size,
|
||||
&attr,
|
||||
&ino,
|
||||
NULL);
|
||||
&mode);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
goto setup_stat;
|
||||
}
|
||||
@ -584,6 +585,10 @@ 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user