Index: /trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp
===================================================================
--- /trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp	(revision 79612)
+++ /trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp	(revision 79613)
@@ -169,18 +169,6 @@
     {
         m_strBaseName = m_strNetwork;
-
-/** @todo make IPRT function for this.   */
-        char ch;
-#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
-        static const char s_szIllegals[] = "/\\\"*:<>?|\t\v\n\r\f\a\b"; /** @todo all control chars... */
-        for (char *psz = m_strBaseName.mutableRaw(); (ch = *psz) != '\0'; ++psz)
-            if (strchr(s_szIllegals, ch))
-                *psz = '_';
-#else
-        for (char *psz = m_strBaseName.mutableRaw(); (ch = *psz) != '\0'; ++psz)
-            if (RTPATH_IS_SEP(ch))
-                *psz = '_';
-#endif
-        m_strBaseName.jolt(); /* Not really necessary, but it's protocol. */
+        RTPathPurgeFilename(m_strBaseName.mutableRaw(), RTPATH_STR_F_STYLE_HOST);
+        m_strBaseName.jolt();
     }
     else
@@ -260,5 +248,5 @@
         RTUUID Uuid;
         int rc = RTUuidCreate(&Uuid);
-        AssertReturn(rc, rc);
+        AssertRCReturn(rc, rc);
 
         m_MacAddress.au8[0] = 0x08;
@@ -747,4 +735,6 @@
         m_strTrunk = "";
 
+    m_strLeaseFilename = pElmServer->findAttributeValue("leaseFilename"); /* optional */
+
     i_getIPv4AddrAttribute(pElmServer, "IPAddress", &m_IPv4Address);
     i_getIPv4AddrAttribute(pElmServer, "networkMask", &m_IPv4Netmask);
Index: /trunk/src/VBox/NetworkServices/Dhcpd/Config.h
===================================================================
--- /trunk/src/VBox/NetworkServices/Dhcpd/Config.h	(revision 79612)
+++ /trunk/src/VBox/NetworkServices/Dhcpd/Config.h	(revision 79613)
@@ -46,4 +46,5 @@
     RTCString       m_strNetwork;       /**< The name of the internal network the DHCP server is connected to. */
     RTCString       m_strBaseName;      /**< m_strNetwork sanitized to be usable in a path component. */
+    RTCString       m_strLeaseFilename; /**< The lease filename if one given.  Dhcpd will pick a default if empty. */
 
     RTCString       m_strTrunk;         /**< The trunk name of the internal network. */
@@ -91,6 +92,7 @@
 
     const RTCString    &getNetwork() const RT_NOEXCEPT          { return m_strNetwork; }
+    const RTCString    &getBaseName() const RT_NOEXCEPT         { return m_strBaseName; }
+    const RTCString    &getLeaseFilename() const RT_NOEXCEPT    { return m_strLeaseFilename; }
 
-    const RTCString    &getBaseName() const RT_NOEXCEPT         { return m_strBaseName; }
     const RTCString    &getTrunk() const RT_NOEXCEPT            { return m_strTrunk; }
     INTNETTRUNKTYPE     getTrunkType() const RT_NOEXCEPT        { return m_enmTrunkType; }
Index: /trunk/src/VBox/NetworkServices/Dhcpd/DHCPD.cpp
===================================================================
--- /trunk/src/VBox/NetworkServices/Dhcpd/DHCPD.cpp	(revision 79612)
+++ /trunk/src/VBox/NetworkServices/Dhcpd/DHCPD.cpp	(revision 79613)
@@ -45,14 +45,16 @@
     AssertReturn(!m_pConfig, VERR_INVALID_STATE);
 
-    /** @todo r=bird: This must be configurable so main can read the database and
-     * fish assignments out of it.  (That's the most efficient and accurate way of
-     * figuring  out the IP address of a VM.) */
-
     /* leases filename */
-    int rc = m_strLeasesFilename.assignNoThrow(pConfig->getHome());
-    if (RT_SUCCESS(rc))
-        rc = RTPathAppendCxx(m_strLeasesFilename, pConfig->getBaseName());
-    if (RT_SUCCESS(rc))
-        rc = m_strLeasesFilename.appendNoThrow("-Dhcpd.leases");
+    int rc;
+    if (pConfig->getLeaseFilename().isEmpty())
+        rc = m_strLeasesFilename.assignNoThrow(pConfig->getLeaseFilename());
+    else
+    {
+        rc = m_strLeasesFilename.assignNoThrow(pConfig->getHome());
+        if (RT_SUCCESS(rc))
+            rc = RTPathAppendCxx(m_strLeasesFilename, pConfig->getBaseName());
+        if (RT_SUCCESS(rc))
+            rc = m_strLeasesFilename.appendNoThrow("-Dhcpd.leases");
+    }
     if (RT_SUCCESS(rc))
     {
@@ -322,7 +324,5 @@
     if (req.ciaddr().u != 0 && reqAddr.present() && reqAddr.value().u != req.ciaddr().u)
     {
-        std::unique_ptr<DhcpServerMessage> nak (
-            i_createMessage(RTNET_DHCP_MT_NAC, req)
-        );
+        std::unique_ptr<DhcpServerMessage> nak(i_createMessage(RTNET_DHCP_MT_NAC, req));
         nak->addOption(OptMessage("Requested address does not match ciaddr"));
         return nak.release();
@@ -349,4 +349,5 @@
     ack->addOptions(m_pConfig->getOptions(replyOptions, optlist, req.clientId()));
 
+    /** @todo r=bird: Sec 9.9 in rfc-2132 indicates the server only sends this in NACKs. Test code? */
     ack->addOption(OptMessage("Ok, ok, here it is"));
 
