From 3a308abf0c7a376902be8d5140d3ffc2cf9a0b2f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 13 Jun 2017 23:28:10 -0400 Subject: [PATCH] WebCit (classic) now loads obsolete "directory" domains as "localhost" domains --- webcit/inetconf.c | 21 +++++++++++---------- webcit/static/t/aide/display_inetconf.html | 3 --- 2 files changed, 11 insertions(+), 13 deletions(-) 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 @@
-

-
-


-- 2.30.2