s3: safe_string: do not include string_wrappers.h
[bbaumbach/samba-autobuild/.git] / source3 / nmbd / nmbd_workgroupdb.c
index 43a28aa66994e3197ccbbcb7ad8f87c44b673b2e..cd97efd8273aa1f45059b4afd6082b878f0f91d3 100644 (file)
@@ -23,8 +23,9 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/svcctl.h"
 #include "nmbd/nmbd.h"
+#include "lib/util/string_wrappers.h"
 
-extern uint16 samba_nb_type;
+extern uint16_t samba_nb_type;
 
 int workgroup_count = 0; /* unique index key: one for each workgroup */
 
@@ -226,6 +227,8 @@ static void fail_register(struct subnet_record *subrec, struct response_record *
 
 void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work)
 {
+       const struct loadparm_substitution *lp_sub =
+               loadparm_s3_global_substitution();
        int i;
 
        if(!strequal(lp_workgroup(), work->work_group))
@@ -254,7 +257,7 @@ workgroup %s on subnet %s\n", work->work_group, subrec->subnet_name));
                        stype &= ~(SV_TYPE_MASTER_BROWSER|SV_TYPE_POTENTIAL_BROWSER|SV_TYPE_DOMAIN_MASTER|SV_TYPE_DOMAIN_MEMBER);
    
                create_server_on_workgroup(work,name,stype|SV_TYPE_LOCAL_LIST_ONLY, PERMANENT_TTL, 
-                               string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH));
+                               string_truncate(lp_server_string(talloc_tos(), lp_sub), MAX_SERVER_STRING_LENGTH));
                DEBUG(3,("initiate_myworkgroup_startup: Added server name entry %s \
 on subnet %s\n", name, subrec->subnet_name));
        }