mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
libsmbclient: If over SMB1 first try to do a posix stat on the file.
Disable in future, if server doesn't support this. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14101 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Dec 19 15:44:25 UTC 2019 on sn-devel-184
This commit is contained in:
parent
b3e3cb3bbd
commit
8b04590e4d
@ -504,6 +504,26 @@ SMBC_getatr(SMBCCTX * context,
|
||||
return False;
|
||||
}
|
||||
|
||||
if (srv->try_posixinfo) {
|
||||
SMB_STRUCT_STAT sbuf;
|
||||
|
||||
status = cli_posix_stat(targetcli, frame, &sbuf);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
setup_stat_from_stat_ex(&sbuf, path, sb);
|
||||
|
||||
TALLOC_FREE(frame);
|
||||
return true;
|
||||
}
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED) ||
|
||||
NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL)) {
|
||||
/*
|
||||
* Turn this off if the server doesn't
|
||||
* support it.
|
||||
*/
|
||||
srv->try_posixinfo = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!srv->no_pathinfo2) {
|
||||
status = cli_qpathinfo2(targetcli,
|
||||
targetpath,
|
||||
|
Loading…
Reference in New Issue
Block a user