WebCit (classic) now loads obsolete "directory" domains as "localhost" domains
authorArt Cancro <ajc@citadel.org>
Wed, 14 Jun 2017 03:28:10 +0000 (23:28 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 14 Jun 2017 03:28:10 +0000 (23:28 -0400)
webcit/inetconf.c
webcit/static/t/aide/display_inetconf.html

index 554a74c6474e041736980cf8cfeafd815a595246..265f3f6bd1f61fc177eef28bd72c247fb0df1ca5 100644 (file)
@@ -61,20 +61,22 @@ void load_inetconf(void)
                
        if (GetServerStatus(Buf, NULL) == 1) {
                CfgToken = NewStrBuf();
                
        if (GetServerStatus(Buf, NULL) == 1) {
                CfgToken = NewStrBuf();
-               while ((len = StrBuf_ServGetln(Buf),
-                       ((len >= 0) && 
-                        ((len != 3) ||
-                         strcmp(ChrPtr(Buf), "000")))))
+               while ((len = StrBuf_ServGetln(Buf), ((len >= 0) && ((len != 3) || strcmp(ChrPtr(Buf), "000")))))
                {
                        Value = NewStrBuf();
                {
                        Value = NewStrBuf();
                        StrBufExtract_token(CfgToken, Buf, 1, '|');
                        StrBufExtract_token(CfgToken, Buf, 1, '|');
+
+                       // VILE SLEAZY HACK: change obsolete "directory" domains to "localhost" domains
+                       if (!strcasecmp(ChrPtr(CfgToken), "directory")) {
+                               FreeStrBuf(&CfgToken);
+                               CfgToken = NewStrBufPlain(HKEY("localhost"));
+                       }
+
                        StrBufExtract_token(Value, Buf, 0, '|');
                        GetHash(WCC->InetCfg, ChrPtr(CfgToken), StrLength(CfgToken), &vHash);
                        Hash = (HashList*) vHash;
                        if (Hash == NULL) {
                        StrBufExtract_token(Value, Buf, 0, '|');
                        GetHash(WCC->InetCfg, ChrPtr(CfgToken), StrLength(CfgToken), &vHash);
                        Hash = (HashList*) vHash;
                        if (Hash == NULL) {
-                               syslog(LOG_WARNING, "ERROR Loading inet config line: [%s]\n", 
-                                       ChrPtr(Buf));
+                               syslog(LOG_WARNING, "ERROR Loading inet config line: [%s]", ChrPtr(Buf));
                                FreeStrBuf(&Value);
                                continue;
                        }
                                FreeStrBuf(&Value);
                                continue;
                        }
@@ -165,9 +167,7 @@ void new_save_inetconf(void) {
                                while (GetNextHashPos(Hash, where, &KeyLen, &Key, &vStr)) {
                                        Str = (StrBuf*) vStr;
                                        if ((Str!= NULL) && (StrLength(Str) > 0))
                                while (GetNextHashPos(Hash, where, &KeyLen, &Key, &vStr)) {
                                        Str = (StrBuf*) vStr;
                                        if ((Str!= NULL) && (StrLength(Str) > 0))
-                                               serv_printf("%s|%s", 
-                                                           ChrPtr(Str),
-                                                           CfgNames[i].Key); 
+                                               serv_printf("%s|%s", ChrPtr(Str), CfgNames[i].Key); 
                                }
                                DeleteHashPos(&where);
                        }                       
                                }
                                DeleteHashPos(&where);
                        }                       
@@ -179,6 +179,7 @@ void new_save_inetconf(void) {
        url_do_template();
 }
 
        url_do_template();
 }
 
+
 void DeleteInetConfHash(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
 void DeleteInetConfHash(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
index a9e32e81ab65c50eebd96030c60f8dd531461742..9ab378849bcd41df5162e1fe0bc9c0c7069c4c7b 100644 (file)
 
 
 <?DOBOXED("aide_inet_aliases", _("Local host aliases"))><br>
 
 
 <?DOBOXED("aide_inet_aliases", _("Local host aliases"))><br>
-<?DOBOXED("aide_inet_dirnames", _("Directory domains"))><br>
 <?DOBOXED("aide_inet_smarthosts", _("Smart hosts"))><br>
 <?DOBOXED("aide_inet_smarthosts", _("Smart hosts"))><br>
-<?DOBOXED("aide_inet_fallbackhosts", _("Fallback smart hosts"))><br>
 <?DOBOXED("aide_inet_notify", _("Notification hosts"))>
 
 </td><td valign="top" width="50%">
 
 <?DOBOXED("aide_inet_notify", _("Notification hosts"))>
 
 </td><td valign="top" width="50%">
 
-
 <?DOBOXED("aide_inet_rbldns", _("RBL hosts"))><br>
 <?DOBOXED("aide_inet_spamass", _("SpamAssassin hosts"))><br>
 <?DOBOXED("aide_inet_clamav", _("ClamAV clamd hosts"))><br>
 <?DOBOXED("aide_inet_rbldns", _("RBL hosts"))><br>
 <?DOBOXED("aide_inet_spamass", _("SpamAssassin hosts"))><br>
 <?DOBOXED("aide_inet_clamav", _("ClamAV clamd hosts"))><br>