From: Ralph Boehme Date: Thu, 31 Oct 2019 16:51:06 +0000 (+0100) Subject: smbdotconf: mark "dont descend" with substitution="1" X-Git-Tag: ldb-2.1.0~584 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=79cff6295d11d1c708bb997d458e9d982cddd480;p=thirdparty%2Fsamba.git smbdotconf: mark "dont descend" with substitution="1" Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/docs-xml/smbdotconf/misc/dontdescend.xml b/docs-xml/smbdotconf/misc/dontdescend.xml index fe6686b7f0c..ca9c75f191e 100644 --- a/docs-xml/smbdotconf/misc/dontdescend.xml +++ b/docs-xml/smbdotconf/misc/dontdescend.xml @@ -1,6 +1,7 @@ There are certain directories on some systems diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 9e126cd3692..0e591417860 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1774,6 +1774,8 @@ void reply_search(struct smb_request *req) struct smbXsrv_connection *xconn = req->xconn; struct smbd_server_connection *sconn = req->sconn; files_struct *fsp = NULL; + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); START_PROFILE(SMBsearch); @@ -2011,8 +2013,8 @@ void reply_search(struct smb_request *req) maxentries = MIN(maxentries, available_space/DIR_STRUCT_SIZE); DEBUG(8,("dirpath=<%s> dontdescend=<%s>\n", - directory,lp_dont_descend(ctx, SNUM(conn)))); - if (in_list(directory, lp_dont_descend(ctx, SNUM(conn)),True)) { + directory,lp_dont_descend(ctx, lp_sub, SNUM(conn)))); + if (in_list(directory, lp_dont_descend(ctx, lp_sub, SNUM(conn)),True)) { check_descend = True; } diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index a8ba5eaa389..031a2c87d7c 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -263,6 +263,8 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx, struct tevent_req *req; struct smbd_smb2_query_directory_state *state; connection_struct *conn = smb2req->tcon->compat; + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); NTSTATUS status; bool wcard_has_wild = false; struct tm tm; @@ -487,9 +489,9 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx, DEBUG(8,("smbd_smb2_query_directory_send: dirpath=<%s> dontdescend=<%s>, " "in_output_buffer_length = %u\n", - fsp->fsp_name->base_name, lp_dont_descend(talloc_tos(), SNUM(conn)), + fsp->fsp_name->base_name, lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)), (unsigned int)in_output_buffer_length )); - if (in_list(fsp->fsp_name->base_name,lp_dont_descend(talloc_tos(), SNUM(conn)), + if (in_list(fsp->fsp_name->base_name,lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)), conn->case_sensitive)) { state->dont_descend = true; } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index d5000e83cb1..26939ad636d 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2721,6 +2721,8 @@ static void call_trans2findfirst(connection_struct *conn, bool backup_priv = false; bool as_root = false; files_struct *fsp = NULL; + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); int ret; if (total_params < 13) { @@ -3008,9 +3010,9 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd a different TRANS2 call. */ DEBUG(8,("dirpath=<%s> dontdescend=<%s>\n", - directory,lp_dont_descend(talloc_tos(), SNUM(conn)))); + directory,lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)))); if (in_list(directory, - lp_dont_descend(talloc_tos(), SNUM(conn)), + lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)), conn->case_sensitive)) { dont_descend = True; } @@ -3203,6 +3205,8 @@ static void call_trans2findnext(connection_struct *conn, bool backup_priv = false; bool as_root = false; files_struct *fsp = NULL; + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); if (total_params < 13) { reply_nterror(req, NT_STATUS_INVALID_PARAMETER); @@ -3386,8 +3390,8 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd a different TRANS2 call. */ DEBUG(8,("dirpath=<%s> dontdescend=<%s>\n", - directory,lp_dont_descend(ctx, SNUM(conn)))); - if (in_list(directory,lp_dont_descend(ctx, SNUM(conn)),conn->case_sensitive)) + directory,lp_dont_descend(ctx, lp_sub, SNUM(conn)))); + if (in_list(directory,lp_dont_descend(ctx, lp_sub, SNUM(conn)),conn->case_sensitive)) dont_descend = True; p = pdata;