ALT Linux Bugzilla
– Attachment 896 Details for
Bug 6902
Version information leak in imapd/pop3d/*d
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
fixed patch.
cyrus-imapd-2.2.12-alt-serverversion-print-disable.patch (text/plain), 10.84 KB, created by
algor
on 2005-05-20 10:58:47 MSD
(
hide
)
Description:
fixed patch.
Filename:
MIME Type:
Creator:
algor
Created:
2005-05-20 10:58:47 MSD
Size:
10.84 KB
patch
obsolete
>--- cyrus-imapd-2.2.12.orig/lib/imapoptions 2005-05-19 16:05:32 +0400 >+++ cyrus-imapd-2.2.12/lib/imapoptions 2005-05-19 16:23:54 +0400 >@@ -771,6 +771,9 @@ are listed with ``<none>''. > IMAP and LMTP daemons. If it is unset, then the result returned > from gethostname(2) is used. */ > >+{ "showserverver", 1, SWITCH } >+/* Show or don't show server version in POP3 banner. */ >+ > { "sharedprefix", "Shared Folders", STRING } > /* If using the alternate IMAP namespace, the prefix for the shared > namespace. The hierarchy delimiter will be automatically appended. */ > >--- cyrus-imapd-2.2.12.orig/imap/pop3d.c 2005-05-19 16:05:32 +0400 >+++ cyrus-imapd-2.2.12/imap/pop3d.c 2005-05-19 16:54:18 +0400 >@@ -425,9 +425,16 @@ int service_main(int argc __attribute__( > syslog(LOG_WARNING, "APOP disabled: can't create challenge"); > } > >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(popd_out, "+OK %s Cyrus POP3%s %s server ready %s\r\n", > config_servername, config_mupdate_server ? " Murder" : "", > CYRUS_VERSION, popd_apop_chal); >+ } >+ else { >+ prot_printf(popd_out, "+OK %s Cyrus POP3%s server ready %s\r\n", >+ config_servername, config_mupdate_server ? " Murder" : "", >+ popd_apop_chal); >+ } > cmdloop(); > > /* QUIT executed */ >@@ -1205,11 +1212,18 @@ void cmd_capa() > || config_getswitch(IMAPOPT_ALLOWPLAINTEXT))) { > prot_printf(popd_out, "USER\r\n"); > } >- >+ >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(popd_out, > "IMPLEMENTATION Cyrus POP3%s server %s\r\n", > config_mupdate_server ? " Murder" : "", CYRUS_VERSION); >- >+ } >+ else { >+ prot_printf(popd_out, >+ "IMPLEMENTATION Cyrus POP3%s server \r\n", >+ config_mupdate_server ? " Murder" : ""); >+ } >+ > prot_printf(popd_out, ".\r\n"); > prot_flush(popd_out); > } >--- cyrus-imapd-2.2.12.orig/imap/imapd.c 2005-05-19 16:05:32 +0400 >+++ cyrus-imapd-2.2.12/imap/imapd.c 2005-05-20 09:25:31 +0400 >@@ -820,9 +820,16 @@ void cmdloop() > char *p, shut[1024]; > const char *err; > >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(imapd_out, > "* OK %s Cyrus IMAP4 %s server ready\r\n", config_servername, > CYRUS_VERSION); >+ } >+ else { >+ prot_printf(imapd_out, >+ "* OK %s Cyrus IMAP4 server ready\r\n", config_servername); >+ } >+ > > ret = snprintf(motdfilename, sizeof(motdfilename), "%s/msg/motd", > config_dir); >@@ -5060,10 +5067,16 @@ void cmd_netscrape(char *tag) > url = config_getstring(IMAPOPT_NETSCAPEURL); > > /* I only know of three things to reply with: */ >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(imapd_out, > "* OK [NETSCAPE] Carnegie Mellon Cyrus IMAP\r\n" > "* VERSION %s\r\n", > CYRUS_VERSION); >+ } >+ else { >+ prot_printf(imapd_out, >+ "* OK [NETSCAPE] Carnegie Mellon Cyrus IMAP\r\n"); >+ } > if (url) prot_printf(imapd_out, "* ACCOUNT-URL %s\r\n", url); > prot_printf(imapd_out, "%s OK %s\r\n", > tag, error_message(IMAP_OK_COMPLETED)); >--- cyrus-imapd-2.2.12.orig/imap/lmtp_sieve.c 2004-06-01 17:47:16 +0400 >+++ cyrus-imapd-2.2.12/imap/lmtp_sieve.c 2005-05-20 09:27:18 +0400 >@@ -228,8 +228,14 @@ static int send_rejection(const char *or > fprintf(sm, "--%d/%s\r\n" > "Content-Type: message/disposition-notification\r\n\r\n", > (int) p, config_servername); >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > fprintf(sm, "Reporting-UA: %s; Cyrus %s/%s\r\n", > config_servername, CYRUS_VERSION, SIEVE_VERSION); >+ } >+ else { >+ fprintf(sm, "Reporting-UA: %s; Cyrus %s\r\n", >+ config_servername, SIEVE_VERSION); >+ } > if (origreceip) > fprintf(sm, "Original-Recipient: rfc822; %s\r\n", origreceip); > fprintf(sm, "Final-Recipient: rfc822; %s\r\n", mailreceip); >--- cyrus-imapd-2.2.12.orig/imap/lmtpengine.c 2004-08-10 21:18:38 +0400 >+++ cyrus-imapd-2.2.12/imap/lmtpengine.c 2005-05-20 09:30:38 +0400 >@@ -1118,10 +1118,16 @@ void lmtpmode(struct lmtp_func *func, > if(havelocal) sasl_setprop(cd.conn, SASL_IPLOCALPORT, &localip ); > if(haveremote) sasl_setprop(cd.conn, SASL_IPREMOTEPORT, &remoteip); > } >- >+ >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(pout, "220 %s LMTP Cyrus %s ready\r\n", > config_servername, > CYRUS_VERSION); >+ } >+ else { >+ prot_printf(pout, "220 %s LMTP Cyrus ready\r\n", >+ config_servername); >+ } > > for (;;) { > nextcmd: >--- cyrus-imapd-2.2.12.orig/imap/lmtpproxyd.c 2004-12-17 19:32:16 +0300 >+++ cyrus-imapd-2.2.12/imap/lmtpproxyd.c 2005-05-20 09:32:27 +0400 >@@ -260,8 +260,14 @@ int service_main(int argc __attribute__( > mhandle = NULL; > syslog(LOG_ERR, "couldn't connect to %s: %s", config_mupdate_server, > error_message(r)); >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(deliver_out, "451 %s LMTP Cyrus %s %s\r\n", > config_servername, CYRUS_VERSION, error_message(r)); >+ } >+ else { >+ prot_printf(deliver_out, "451 %s LMTP Cyrus %s\r\n", >+ config_servername, error_message(r)); >+ } > } > > /* free session state */ >--- cyrus-imapd-2.2.12.orig/imap/mupdate.c 2004-12-17 19:32:16 +0300 >+++ cyrus-imapd-2.2.12/imap/mupdate.c 2005-05-20 09:34:33 +0400 >@@ -995,10 +995,18 @@ static void dobanner(struct conn *c) > > prot_printf(c->pout, "* PARTIAL-UPDATE\r\n"); > >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(c->pout, > "* OK MUPDATE \"%s\" \"Cyrus Murder\" \"%s\" \"%s\"\r\n", > config_servername, > CYRUS_VERSION, masterp ? "(master)" : slavebuf); >+ } >+ else { >+ prot_printf(c->pout, >+ "* OK MUPDATE \"%s\" \"Cyrus Murder\" \"%s\"\r\n", >+ config_servername, >+ masterp ? "(master)" : slavebuf); >+ } > > prot_flush(c->pout); > } >--- cyrus-imapd-2.2.12.orig/imap/nntpd.c 2005-01-07 23:59:04 +0300 >+++ cyrus-imapd-2.2.12/imap/nntpd.c 2005-05-20 09:46:33 +0400 >@@ -664,20 +664,36 @@ int service_main(int argc __attribute__( > if (nntps == 1) cmd_starttls(1); > > if (shutdown_file(unavail, sizeof(unavail))) { >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(nntp_out, > "400 %s Cyrus NNTP%s %s server unavailable, %s\r\n", > config_servername, config_mupdate_server ? " Murder" : "", > CYRUS_VERSION, unavail); >+ } >+ else { >+ prot_printf(nntp_out, >+ "400 %s Cyrus NNTP%s server unavailable, %s\r\n", >+ config_servername, config_mupdate_server ? " Murder" : "", unavail); >+ } > > shut_down(0); > } > >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(nntp_out, > "%u %s Cyrus NNTP%s %s server ready, posting %s\r\n", > (nntp_capa & MODE_READ) ? 200 : 201, > config_servername, config_mupdate_server ? " Murder" : "", > CYRUS_VERSION, > (nntp_capa & MODE_READ) ? "allowed" : "prohibited"); >+ } >+ else { >+ prot_printf(nntp_out, >+ "%u %s Cyrus NNTP%s server ready, posting %s\r\n", >+ (nntp_capa & MODE_READ) ? 200 : 201, >+ config_servername, config_mupdate_server ? " Murder" : "", >+ (nntp_capa & MODE_READ) ? "allowed" : "prohibited"); >+ } > > cmdloop(); > >@@ -1806,9 +1822,16 @@ static void cmd_capabilities(char *keywo > > prot_printf(nntp_out, "101 Capability list follows:\r\n"); > prot_printf(nntp_out, "VERSION 2\r\n"); >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(nntp_out, > "IMPLEMENTATION Cyrus NNTP%s server %s\r\n", > config_mupdate_server ? " Murder" : "", CYRUS_VERSION); >+ } >+ else { >+ prot_printf(nntp_out, >+ "IMPLEMENTATION Cyrus NNTP%s server\r\n", >+ config_mupdate_server ? " Murder" : ""); >+ } > > /* add STARTTLS */ > if (tls_enabled() && !nntp_starttls_done && !nntp_authstate) >@@ -2664,12 +2687,21 @@ static void cmd_mode(char *arg) > lcase(arg); > > if (!strcmp(arg, "reader")) { >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(nntp_out, > "%u %s Cyrus NNTP%s %s server ready, posting %s\r\n", > (nntp_capa & MODE_READ) ? 200 : 201, > config_servername, config_mupdate_server ? " Murder" : "", > CYRUS_VERSION, > (nntp_capa & MODE_READ) ? "allowed" : "prohibited"); >+ } >+ else { >+ prot_printf(nntp_out, >+ "%u %s Cyrus NNTP%s server ready, posting %s\r\n", >+ (nntp_capa & MODE_READ) ? 200 : 201, >+ config_servername, config_mupdate_server ? " Murder" : "", >+ (nntp_capa & MODE_READ) ? "allowed" : "prohibited"); >+ } > } > else if (!strcmp(arg, "stream")) { > if (nntp_capa & MODE_FEED) { >--- cyrus-imapd-2.2.12.orig/imap/proxyd.c 2004-12-17 19:32:20 +0300 >+++ cyrus-imapd-2.2.12/imap/proxyd.c 2005-05-20 09:49:48 +0400 >@@ -1482,9 +1482,15 @@ void cmdloop() > "%s/msg/shutdown", config_dir); > > gethostname(hostname, sizeof(hostname)); >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(proxyd_out, > "* OK %s Cyrus IMAP4 Murder %s server ready\r\n", hostname, > CYRUS_VERSION); >+ } >+ else { >+ prot_printf(proxyd_out, >+ "* OK %s Cyrus IMAP4 Murder server ready\r\n", hostname); >+ } > > snprintf(motdfilename, sizeof(motdfilename), "%s/msg/motd", config_dir); > if ((fd = open(motdfilename, O_RDONLY, 0)) != -1) { >@@ -4552,9 +4558,15 @@ cmd_netscape(tag) > url = config_getstring(IMAPOPT_NETSCAPEURL); > > /* I only know of three things to reply with: */ >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(proxyd_out, > "* OK [NETSCAPE] Carnegie Mellon Cyrus IMAP proxy\r\n* VERSION %s\r\n", > CYRUS_VERSION); >+ } >+ else { >+ prot_printf(proxyd_out, >+"* OK [NETSCAPE] Carnegie Mellon Cyrus IMAP proxy\r\n*"); >+ } > prot_printf(proxyd_out, > "* ACCOUNT-URL %s\r\n%s OK %s\r\n", > url, tag, error_message(IMAP_OK_COMPLETED)); > >--- cyrus-imapd-2.2.12.orig/imap/version.c 2004-06-21 19:31:13 +0400 >+++ cyrus-imapd-2.2.12/imap/version.c 2005-05-20 10:27:27 +0400 >@@ -63,6 +63,7 @@ > #include "lock.h" > #include "nonblock.h" > #include "idle.h" >+#include "global.h" > > #ifdef USE_SIEVE > #include "sieve_interface.h" >@@ -95,12 +96,20 @@ void id_response(struct protstream *pout > int sasl_ver; > char env_buf[MAXIDVALUELEN+1]; > >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(pout, "* ID (" > "\"name\" \"Cyrus IMAPD\"" > " \"version\" \"%s %s\"" > " \"vendor\" \"Project Cyrus\"" > " \"support-url\" \"http://asg.web.cmu.edu/cyrus\"", > CYRUS_VERSION, CYRUS_CVSDATE); >+ } >+ else { >+ prot_printf(pout, "* ID (" >+ "\"name\" \"Cyrus IMAPD\"" >+ " \"vendor\" \"Project Cyrus\"" >+ " \"support-url\" \"http://asg.web.cmu.edu/cyrus\""); >+ } > > /* add the os info */ > if (uname(&os) != -1) >--- cyrus-imapd-2.2.12.orig/timsieved/actions.c 2003-10-22 22:50:31 +0400 >+++ cyrus-imapd-2.2.12/timsieved/actions.c 2005-05-20 10:42:25 +0400 >@@ -166,8 +166,13 @@ int capabilities(struct protstream *conn > unsigned mechcount; > > /* implementation */ >+ if (config_getswitch(IMAPOPT_SHOWSERVERVER)) { > prot_printf(conn, "\"IMPLEMENTATION\" \"Cyrus timsieved %s\"\r\n", > CYRUS_VERSION); >+ } >+ else { >+ prot_printf(conn, "\"IMPLEMENTATION\" \"Cyrus timsieved\"\r\n"); >+ } > > /* SASL */ > if (!authenticated &&
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 6902
:
895
| 896