From: Art Cancro Date: Wed, 14 Jun 2017 03:28:10 +0000 (-0400) Subject: WebCit (classic) now loads obsolete "directory" domains as "localhost" domains X-Git-Tag: v939~539 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=3a308abf0c7a376902be8d5140d3ffc2cf9a0b2f WebCit (classic) now loads obsolete "directory" domains as "localhost" domains --- diff --git a/webcit/inetconf.c b/webcit/inetconf.c index 554a74c64..265f3f6bd 100644 --- a/webcit/inetconf.c +++ b/webcit/inetconf.c @@ -61,20 +61,22 @@ void load_inetconf(void) 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(); - 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) { - 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; } @@ -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)) - serv_printf("%s|%s", - ChrPtr(Str), - CfgNames[i].Key); + serv_printf("%s|%s", ChrPtr(Str), CfgNames[i].Key); } DeleteHashPos(&where); } @@ -179,6 +179,7 @@ void new_save_inetconf(void) { url_do_template(); } + void DeleteInetConfHash(StrBuf *Target, WCTemplputParams *TP) { wcsession *WCC = WC; diff --git a/webcit/static/t/aide/display_inetconf.html b/webcit/static/t/aide/display_inetconf.html index a9e32e81a..9ab378849 100644 --- a/webcit/static/t/aide/display_inetconf.html +++ b/webcit/static/t/aide/display_inetconf.html @@ -12,14 +12,11 @@
-

-
-