--- src/cache_cf.c.orig 2008-06-24 09:52:37.000000000 -0300 +++ src/cache_cf.c 2008-06-24 09:53:07.000000000 -0300 @@ -407,6 +407,10 @@ Config.Announce.period = 86400 * 365; /* one year */ Config.onoff.announce = 0; } + if (Config.onoff.disable_generated_by_string) + generated_by_option = 1; + else + generated_by_option = 0; if (Config.onoff.httpd_suppress_version_string) visible_appname_string = (char *) appname_string; else --- src/cf.data.pre.orig 2008-06-24 09:53:17.000000000 -0300 +++ src/cf.data.pre 2008-06-24 09:54:00.000000000 -0300 @@ -3308,6 +3308,16 @@ DOC_END +NAME: disable_generated_by_string +COMMENT: on|off +TYPE: onoff +DEFAULT: off +LOC: Config.onoff.disable_generated_by_string +DOC_START + Disable the generated by string in ftp, gopher and error pages. +DOC_END + + NAME: httpd_suppress_version_string COMMENT: on|off TYPE: onoff --- src/errorpage.c.orig 2008-06-24 09:54:12.000000000 -0300 +++ src/errorpage.c 2008-06-24 09:56:15.000000000 -0300 @@ -147,9 +147,13 @@ errorFindHardText(err_type type) { int i; + char *footer = "\n"; for (i = 0; i < error_hard_text_count; i++) - if (error_hard_text[i].type == type) + if (error_hard_text[i].type == type) { + if (generated_by_option) + return footer; return error_hard_text[i].text; + } return NULL; } --- src/ftp.c.orig 2008-06-24 09:56:29.000000000 -0300 +++ src/ftp.c 2008-06-24 09:58:35.000000000 -0300 @@ -363,8 +363,8 @@ int i, j, k; const char *title = strBuf(ftpState->title_url); storeAppendPrintf(e, "\n"); - storeAppendPrintf(e, "\n", - version_string); + if (!generated_by_option) + storeAppendPrintf(e, "\n", version_string); storeAppendPrintf(e, "\n", mkrfc1123(squid_curtime)); storeAppendPrintf(e, "\n"); { @@ -436,13 +436,17 @@ const char *path = ftpState->flags.dir_slash ? ftpState->filepath : "."; storeAppendPrintf(e, "<A HREF=\"%s/\">[As extended directory]</A>\n", html_quote(path)); } - storeAppendPrintf(e, "<HR noshade size=\"1px\">\n"); - storeAppendPrintf(e, "<ADDRESS>\n"); - storeAppendPrintf(e, "Generated %s by %s (%s)\n", - mkrfc1123(squid_curtime), - getMyHostname(), - visible_appname_string); - storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n"); + if (generated_by_option) { + storeAppendPrintf(e, "</BODY></HTML>\n"); + } else { + storeAppendPrintf(e, "<HR noshade size=\"1px\">\n"); + storeAppendPrintf(e, "<ADDRESS>\n"); + storeAppendPrintf(e, "Generated %s by %s (%s)\n", + mkrfc1123(squid_curtime), + getMyHostname(), + visible_appname_string); + storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n"); + } } static const char *Month[] = --- src/globals.h.orig 2008-06-24 09:58:48.000000000 -0300 +++ src/globals.h 2008-06-24 09:59:05.000000000 -0300 @@ -67,6 +67,7 @@ extern const char *storeStatusStr[]; extern const char *swapStatusStr[]; extern fde *fd_table; /* NULL */ +extern int generated_by_option; /* 0 */ extern int Biggest_FD; /* -1 */ extern int Number_FD; /* 0 */ extern int Opening_FD; /* 0 */ --- src/gopher.c.orig 2008-06-24 09:59:16.000000000 -0300 +++ src/gopher.c 2008-06-24 09:59:57.000000000 -0300 @@ -252,13 +252,17 @@ static void gopherHTMLFooter(StoreEntry * e) { - storeAppendPrintf(e, "<HR noshade size=\"1px\">\n"); - storeAppendPrintf(e, "<ADDRESS>\n"); - storeAppendPrintf(e, "Generated %s by %s (%s)\n", - mkrfc1123(squid_curtime), - getMyHostname(), - visible_appname_string); - storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n"); + if (generated_by_option) { + storeAppendPrintf(e, "</BODY></HTML>\n"); + } else { + storeAppendPrintf(e, "<HR noshade size=\"1px\">\n"); + storeAppendPrintf(e, "<ADDRESS>\n"); + storeAppendPrintf(e, "Generated %s by %s (%s)\n", + mkrfc1123(squid_curtime), + getMyHostname(), + visible_appname_string); + storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n"); + } } static void --- src/structs.h.orig 2008-06-24 10:00:09.000000000 -0300 +++ src/structs.h 2008-06-24 10:00:25.000000000 -0300 @@ -669,6 +669,7 @@ int relaxed_header_parser; int accel_no_pmtu_disc; int global_internal_static; + int disable_generated_by_string; int httpd_suppress_version_string; int via; int check_hostnames;