s3:libsmb: SMBC_getatr use pathinfo3 for second try
authorGregor Beck <gbeck@sernet.de>
Fri, 11 Oct 2013 09:02:24 +0000 (11:02 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 30 Oct 2013 22:23:51 +0000 (15:23 -0700)
The pathinfo2 call might fail against NetApp because it is sending broken
packages.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/libsmb_internal.h
source3/libsmb/libsmb_file.c
source3/libsmb/libsmb_server.c

index 63c96fe..ce73181 100644 (file)
@@ -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;
 
index 09f5810..277ca83 100644 (file)
@@ -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;
index 9d87f42..2f3ea96 100644 (file)
@@ -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: