From 0a3cc7e25ca54c5dc0b836680668401582b105b0 Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Fri, 11 Oct 2013 11:02:24 +0200 Subject: s3:libsmb: SMBC_getatr use pathinfo3 for second try The pathinfo2 call might fail against NetApp because it is sending broken packages. Signed-off-by: Gregor Beck Reviewed-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/include/libsmb_internal.h | 1 + source3/libsmb/libsmb_file.c | 13 +++++++++++++ source3/libsmb/libsmb_server.c | 1 + 3 files changed, 15 insertions(+) diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 63c96fecd1..ce73181fac 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -78,6 +78,7 @@ struct _SMBCSRV { dev_t dev; bool no_pathinfo; bool no_pathinfo2; + bool no_pathinfo3; bool no_nt_session; struct policy_handle pol; diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index 09f58105b2..277ca83e33 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -560,6 +560,19 @@ SMBC_getatr(SMBCCTX * context, srv->no_pathinfo2 = True; + if (!srv->no_pathinfo3 && + NT_STATUS_IS_OK(cli_qpathinfo3(targetcli, targetpath, + create_time_ts, + access_time_ts, + write_time_ts, + change_time_ts, + size, mode, ino))) { + TALLOC_FREE(frame); + return True; + } + + srv->no_pathinfo3 = True; + /* if this is NT then don't bother with the getatr */ if (smb1cli_conn_capabilities(targetcli->conn) & CAP_NT_SMBS) { errno = EPERM; diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index 9d87f421fb..2f3ea96602 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -606,6 +606,7 @@ SMBC_server_internal(TALLOC_CTX *ctx, srv->dev = (dev_t)(str_checksum(server) ^ str_checksum(share)); srv->no_pathinfo = False; srv->no_pathinfo2 = False; + srv->no_pathinfo3 = False; srv->no_nt_session = False; done: -- cgit