smbdotconf: mark "auto services" with substitution="1"
authorRalph Boehme <slow@samba.org>
Mon, 4 Nov 2019 14:11:04 +0000 (15:11 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 27 Nov 2019 10:25:34 +0000 (10:25 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
docs-xml/smbdotconf/misc/auto_services.xml
lib/param/loadparm.c
source3/param/loadparm.c
source3/printing/load.c

index a7d7f13ffcdbf5770af02d84dcadf5133bafd41f..d843d889972ca5e645a5507217d636fe40df8f4f 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="auto services"
                  context="G"
                  type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <synonym>preload</synonym>
 <description>
index 25cf4eb7785579345b8a523f08787f56e2b76ec7..1919e0bc477e0231fa40a1d1e9812876446d73a3 100644 (file)
@@ -3132,13 +3132,15 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx)
        struct debug_settings settings;
        int max_protocol, min_protocol;
        TALLOC_CTX *tmp_ctx;
+       const struct loadparm_substitution *lp_sub =
+               lpcfg_noop_substitution();
 
        tmp_ctx = talloc_new(lp_ctx);
        if (tmp_ctx == NULL) {
                return false;
        }
 
-       lpcfg_add_auto_services(lp_ctx, lpcfg_auto_services(lp_ctx, tmp_ctx));
+       lpcfg_add_auto_services(lp_ctx, lpcfg_auto_services(lp_ctx, lp_sub, tmp_ctx));
 
        if (!lp_ctx->globals->wins_server_list && lp_ctx->globals->we_are_a_wins_server) {
                lpcfg_do_global_parameter(lp_ctx, "wins server", "127.0.0.1");
index ccd5d8bd83937476b783bca15b1d0226e42ec3b6..5c0adb6f4d61ec1823ecfaefe08554c659c809a8 100644 (file)
@@ -3989,7 +3989,9 @@ static bool lp_load_ex(const char *pszFname,
        }
 
        {
-               char *serv = lp_auto_services(talloc_tos());
+               const struct loadparm_substitution *lp_sub =
+                       loadparm_s3_global_substitution();
+               char *serv = lp_auto_services(talloc_tos(), lp_sub);
                lp_add_auto_services(serv);
                TALLOC_FREE(serv);
        }
index 7e25d5a91c71c07bffcf48bb2a39716ef50b8350..6a5d4ed97c2c1a6bffafab1bf93d1e8536dd330d 100644 (file)
@@ -27,6 +27,8 @@ auto-load some homes and printer services
 ***************************************************************************/
 static void add_auto_printers(void)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        const char *p;
        int pnum = lp_servicenumber(PRINTERS_NAME);
        char *str;
@@ -40,7 +42,7 @@ static void add_auto_printers(void)
        if (pnum < 0)
                return;
 
-       auto_serv = lp_auto_services(talloc_tos());
+       auto_serv = lp_auto_services(talloc_tos(), lp_sub);
        str = SMB_STRDUP(auto_serv);
        TALLOC_FREE(auto_serv);
        if (str == NULL) {