www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JDC <yo...@dreamscape.org>
Subject other/3062: main/rfc1413.c: "remote , local" port syntax will fail
Date Thu, 24 Sep 1998 11:41:17 GMT

>Number:         3062
>Category:       other
>Synopsis:       main/rfc1413.c: "remote , local" port syntax will fail
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Thu Sep 24 04:50:01 PDT 1998
>Last-Modified:
>Originator:     yoshi@dreamscape.org
>Organization:
apache
>Release:        1.3.2
>Environment:
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
Linux pentarou 2.0.35 #1 Wed Sep 9 14:34:04 PDT 1998 i586 unknown
libc 5.4.44
>Description:
>From main/rfc1413.c (line 186):

    if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port,

This is "correct syntax" according to RFC1413, but not all ident daemons
respond under recommended syntax of "remote , local". Some (50%) reply with
"remote,local" or "remote, local" syntax.
>How-To-Repeat:
Pipe in "remote,local" and watch sscanf() fail.
>Fix:
Change main/rfc1413.c (line 186) to:
 
    if (sscanf(buffer, "%u%*[^0-9]%u : USERID :%*[^:]:%512s", &rmt_port, &our_port,

Which should (and will) allow for any format. (This is probably not deemed
as a "proper," although it has yet to fail me).

NOTE: Same bug is present in *ALL* versions of tcp-wrappers (which is obviously
where main/rfc1413.c originated from). In the future, please try to refrain
from re-using 4+ (broken) year-old code. Thanks.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]




Mime
View raw message