Skip to contentSkip to conversation

ip_conntrack_irc, allowance for quoted filenames

PATCH In review Rene Herman 2 participants 2 messages May 12, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip_conntrack_irc, allowance for quoted filenames

Resend, this time _with_ patch ...

[ please keep me in CC, not subscribed ]

When the irssi (www.irssi.org) IRC client is asked to DCC SEND a file with a filename containing spaces, it does so by leaving the spaces intact and quoting the filename (""). ip_conntrack_irc.c:parse_dcc() however can't handle the embedded spaces.

I haven't checked other clients but I assume they might do the same. Is the attached hack (against 2.4.20) acceptable? Should this be solved differently and/or elsewhere?

Rene.

net/ipv4/netfilter/ip_conntrack_irc.c renamed from net/ipv4/netfilter/ip_conntrack_irc.c.orig +6 -0
@@ -82,6 +82,12 @@
 	ad_beg_p	returns pointer to first byte of addr data
 	ad_end_p	returns pointer to last byte of addr data */
 {
+	/* handle quoted arguments containing spaces */
+	if (*data == '"')
+		/* at least 14: "\" AAAAAAAA P\1\n" */
+		while (*++data != '"')
+			if (data > data_end - 14)
+				return -1;
 
 	/* at least 12: "AAAAAAAA P\1\n" */
 	while (*data++ != ' ')
#1 lore raw
Quoted 8 lines · Rene Herman

Resend, this time _with_ patch ...

[ please keep me in CC, not subscribed ]

When the irssi (www.irssi.org) IRC client is asked to DCC SEND a file with a filename containing spaces, it does so by leaving the spaces intact and quoting the filename (""). ip_conntrack_irc.c:parse_dcc() however can't handle the embedded spaces.

Thanks a lot, I will include your patch.

This is, however, an irssi extension. the DCC specification does not include support for spaces in filenames, neither does the ircII implementation.

Quoted 3 lines

I haven't checked other clients but I assume they might do the same. Is the attached hack (against 2.4.20) acceptable? Should this be solved differently and/or elsewhere?

no, it's perfectly fine.

Quoted 1 line

Rene.

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie