]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbdotconf: mark "dont descend" with substitution="1"
authorRalph Boehme <slow@samba.org>
Thu, 31 Oct 2019 16:51:06 +0000 (17:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:33 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/misc/dontdescend.xml
source3/smbd/reply.c
source3/smbd/smb2_query_directory.c
source3/smbd/trans2.c

index fe6686b7f0c1604c6fa7681b131efa0fd381b9ea..ca9c75f191e58d4e8c7774987f40e0ea31228ccd 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="dont descend"
                  context="S"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
        <para>There are certain directories on some systems 
index 9e126cd36924dae0bba2070c12ce8ac457995f47..0e591417860556171727594aee35eaca92575bb6 100644 (file)
@@ -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;
                }
 
index a8ba5eaa389c516c6dd72d1fd9c8521d7e282238..031a2c87d7c8bf1aa59a35dcda5ab1f51db963fd 100644 (file)
@@ -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;
        }
index d5000e83cb1d8d4fa36c28f8bf4e5e2a992b1660..26939ad636d5ad01c06db43007d40f6cbadd6f08 100644 (file)
@@ -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;