smbdotconf: mark "root preexec" with substitution="1"
authorRalph Boehme <slow@samba.org>
Mon, 4 Nov 2019 11:20:21 +0000 (12:20 +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/rootpreexec.xml
source3/smbd/service.c

index 32bfe442bde5488220a3459df5ddad1c0718574a..32c4ef7b6fe3aade7dc5bf24f911ffc6ccee62de 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="root preexec"
                  context="S"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
        <para>
index 07732a2329733698352c76a36f7cda95be3227f8..f82bc0d5d1311e21433a41fe5bcb37f38b7ef251 100644 (file)
@@ -732,7 +732,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
        /* Preexecs are done here as they might make the dir we are to ChDir
         * to below */
        /* execute any "root preexec = " line */
-       if (*lp_root_preexec(talloc_tos(), snum)) {
+       if (*lp_root_preexec(talloc_tos(), lp_sub, snum)) {
                char *cmd = talloc_sub_full(talloc_tos(),
                                        lp_const_servicename(SNUM(conn)),
                                        conn->session_info->unix_info->unix_name,
@@ -740,7 +740,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
                                        conn->session_info->unix_token->gid,
                                        conn->session_info->unix_info->sanitized_username,
                                        conn->session_info->info->domain_name,
-                                       lp_root_preexec(talloc_tos(), snum));
+                                       lp_root_preexec(talloc_tos(), lp_sub, snum));
                DEBUG(5,("cmd=%s\n",cmd));
                ret = smbrun(cmd, NULL, NULL);
                TALLOC_FREE(cmd);