s3: Allow disabling of mdns registrations
authorVolker Lendecke <vl@samba.org>
Fri, 5 Nov 2010 10:41:09 +0000 (11:41 +0100)
committerVolker Lendecke <vlendec@samba.org>
Fri, 5 Nov 2010 11:24:41 +0000 (11:24 +0000)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Nov  5 11:24:41 UTC 2010 on sn-devel-104

docs-xml/smbdotconf/base/multicastdnsregister.xml [new file with mode: 0644]
source3/include/proto.h
source3/param/loadparm.c
source3/smbd/server.c

diff --git a/docs-xml/smbdotconf/base/multicastdnsregister.xml b/docs-xml/smbdotconf/base/multicastdnsregister.xml
new file mode 100644 (file)
index 0000000..32d9cfc
--- /dev/null
@@ -0,0 +1,15 @@
+<samba:parameter name="multicast dns register"
+                               type="boolean"
+                 context="G"
+                 advanced="1"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+        <para>If compiled with proper support for it, Samba will
+        announce itself with multicast DNS services like for example
+        provided by the Avahi daemon.</para>
+
+       <para>This parameter allows disabling Samba to register
+       itself.</para>
+</description>
+<value type="default">yes</value>
+</samba:parameter>
index 1989fb1a8604c0c173fecb0769d2eb9502f59cff..6e14c3327286d44518ba176ed03cb57912c08b28 100644 (file)
@@ -3419,6 +3419,7 @@ bool lp_dos_filetimes(int );
 bool lp_dos_filetime_resolution(int );
 bool lp_fake_dir_create_times(int);
 bool lp_async_smb_echo_handler(void);
+bool lp_multicast_dns_register(void);
 bool lp_blocking_locks(int );
 bool lp_inherit_perms(int );
 bool lp_inherit_acls(int );
index 1d3c7353ed75ac9958ad24030ec672dabc13f99f..f65682fbedf43544399f82ff5a6b75613fd5f316 100644 (file)
@@ -374,6 +374,7 @@ struct global {
        char *szSMBPerfcountModule;
        bool bMapUntrustedToDomain;
        bool bAsyncSMBEchoHandler;
+       bool bMulticastDnsRegister;
        int ismb2_max_read;
        int ismb2_max_write;
        int ismb2_max_trans;
@@ -4408,6 +4409,15 @@ static struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
        },
+       {
+               .label          = "multicast dns register",
+               .type           = P_BOOL,
+               .p_class        = P_GLOBAL,
+               .ptr            = &Globals.bMulticastDnsRegister,
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED | FLAG_GLOBAL,
+       },
        {
                .label          = "panic action",
                .type           = P_STRING,
@@ -5372,6 +5382,7 @@ static void init_globals(bool reinit_globals)
        Globals.iminreceivefile = 0;
 
        Globals.bMapUntrustedToDomain = false;
+       Globals.bMulticastDnsRegister = true;
 
        Globals.ismb2_max_read = 1024*1024;
        Globals.ismb2_max_write = 1024*1024;
@@ -5857,6 +5868,7 @@ FN_LOCAL_BOOL(lp_dos_filetimes, bDosFiletimes)
 FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution)
 FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes)
 FN_GLOBAL_BOOL(lp_async_smb_echo_handler, &Globals.bAsyncSMBEchoHandler)
+FN_GLOBAL_BOOL(lp_multicast_dns_register, &Globals.bMulticastDnsRegister)
 FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks)
 FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms)
 FN_LOCAL_BOOL(lp_inherit_acls, bInheritACLS)
index dd3ae3a7306eec0c530d41ecd5129caef7487b0d..c30b344e452754c2cb5ec8bba63a6bbb9f21e4c2 100644 (file)
@@ -739,7 +739,7 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
                           msg_inject_fault);
 #endif
 
-       if (dns_port != 0) {
+       if (lp_multicast_dns_register() && (dns_port != 0)) {
 #ifdef WITH_DNSSD_SUPPORT
                smbd_setup_mdns_registration(smbd_event_context(),
                                             parent, dns_port);