smbdotconf: mark "wins hook" with substitution="1"
authorRalph Boehme <slow@samba.org>
Tue, 5 Nov 2019 11:21:58 +0000 (12:21 +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/wins/winshook.xml
source3/nmbd/nmbd_winsserver.c
source4/nbt_server/wins/winsdb.c

index 748e8b8f23902a30b23e05e322f96ba659013fb3..3dcf5d7cca5a9f9bf1628bb9f31fe4edc4595f22 100644 (file)
@@ -1,6 +1,7 @@
 <samba:parameter name="wins hook"
                  context="G"
-                                type="string"
+                 type="string"
+                 substitution="1"
                  xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
        <para>When Samba is running as a WINS server this 
index c34bfaea3beda87cf601279827dd380d00501970..f68d6eebc0b0060d149d3ba4d17523d4bd60226a 100644 (file)
@@ -454,8 +454,10 @@ static void get_global_id_and_update(uint64_t *current_id, bool update)
 
 static void wins_hook(const char *operation, struct name_record *namerec, int ttl)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        char *command = NULL;
-       char *cmd = lp_wins_hook(talloc_tos());
+       char *cmd = lp_wins_hook(talloc_tos(), lp_sub);
        char *p, *namestr;
        int i;
        TALLOC_CTX *ctx = talloc_tos();
index 41a9fd8550d4e9445c131c70cc18c77a1a8f8814..be1d8ba8050af9eaaf35884b7cabb71123b44229 100644 (file)
@@ -985,6 +985,8 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx,
                                     const char *owner,
                                     enum winsdb_handle_caller caller)
 {
+       const struct loadparm_substitution *lp_sub =
+               lpcfg_noop_substitution();
        struct winsdb_handle *h = NULL;
        unsigned int flags = 0;
        bool ret;
@@ -1005,7 +1007,7 @@ struct winsdb_handle *winsdb_connect(TALLOC_CTX *mem_ctx,
        if (!h->ldb) goto failed;
 
        h->caller = caller;
-       h->hook_script = lpcfg_wins_hook(lp_ctx, h);
+       h->hook_script = lpcfg_wins_hook(lp_ctx, lp_sub, h);
 
        h->local_owner = talloc_strdup(h, owner);
        if (!h->local_owner) goto failed;