smbdotconf: mark "root directory" with substitution="1"
authorRalph Boehme <slow@samba.org>
Tue, 5 Nov 2019 10:51:56 +0000 (11:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:36 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/security/rootdirectory.xml
source3/smbd/process.c

index e795af26bf86abe5db04df01bae4bcd658685078..008ec5086fc42388c927b81764f0fb45b4acd5ea 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="root directory"
                  context="G"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <synonym>root</synonym>
 <synonym>root dir</synonym>
index 0e0d45d2af13971c106572382d4369d04ad83777..c2952ddfc93f1bc3e08404d8f8d9af5da9374759 100644 (file)
@@ -3899,6 +3899,8 @@ void smbd_process(struct tevent_context *ev_ctx,
                .ev = ev_ctx,
                .frame = talloc_stackframe(),
        };
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        struct smbXsrv_client *client = NULL;
        struct smbd_server_connection *sconn = NULL;
        struct smbXsrv_connection *xconn = NULL;
@@ -4029,7 +4031,7 @@ void smbd_process(struct tevent_context *ev_ctx,
                exit_server("Could not open account policy tdb.\n");
        }
 
-       chroot_dir = lp_root_directory(talloc_tos());
+       chroot_dir = lp_root_directory(talloc_tos(), lp_sub);
        if (chroot_dir[0] != '\0') {
                rc = chdir(chroot_dir);
                if (rc != 0) {