From: Andreas Schneider Date: Mon, 25 Nov 2019 10:06:57 +0000 (+0100) Subject: s3:libsmb: Add try_posixinfo to SMBSRV struct. Only enable for SMB1 with UNIX for... X-Git-Tag: samba-4.10.13~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c7ec52a01709ea2c73313047f15c3ba6baf9595;p=thirdparty%2Fsamba.git s3:libsmb: Add try_posixinfo to SMBSRV struct. Only enable for SMB1 with UNIX for now. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14101 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit bf9a3a7aa1913238ae2c997ce00369d0dbae3a08) --- diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index c1bcab18138..5627b0c867e 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -76,6 +76,7 @@ typedef struct DOS_ATTR_DESC { struct _SMBCSRV { struct cli_state *cli; dev_t dev; + bool try_posixinfo; bool no_pathinfo; bool no_pathinfo2; bool no_pathinfo3; diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c index 0067df48cac..d4f71d8c8b7 100644 --- a/source3/libsmb/libsmb_server.c +++ b/source3/libsmb/libsmb_server.c @@ -657,6 +657,15 @@ SMBC_server_internal(TALLOC_CTX *ctx, ZERO_STRUCTP(srv); DLIST_ADD(srv->cli, c); srv->dev = (dev_t)(str_checksum(server) ^ str_checksum(share)); + srv->try_posixinfo = false; + /* + * Until SMB2 POSIX is done, only + * try POSIX stat on SMB1 with POSIX capabilities. + */ + if ((smbXcli_conn_protocol(c->conn) < PROTOCOL_SMB2_02) && + (smb1cli_conn_capabilities(c->conn) & CAP_UNIX)) { + srv->try_posixinfo = true; + } srv->no_pathinfo = False; srv->no_pathinfo2 = False; srv->no_pathinfo3 = False;