UTF-8 encoding in replies

Russ Allbery rra at stanford.edu
Thu Aug 28 06:16:21 UTC 2008


Julien ÉLIE <julien at trigofacile.com> writes:

> What is the proper way to "clean up" the (unfortunate) input of the
> user?  I especially mean INN_VERSION_STRING.  The news administrator can
> put non US-ASCII characters in that string, and encode it in something
> which is not UTF-8.  Therefore, it breaks the proper encoding of the
> banner:
>
>  200 server InterNetNews NNRP server ${INN_VERSION_STRING} ready (posting ok).
>
> and will also break this CAPABILITIES line:
>
>  IMPLEMENTATION ${INN_VERSION_STRING}
>
> I see that Message-IDs do not allow non US-ASCII characters so when the
> Message-ID is answered in a few NNTP replies, there is no problem.  Also
> no problem for the answer of LIST NEWSGROUPS, BODY, etc. because no
> specific encoding has to be applied.
>
> But how can we handle ${INN_VERSION_STRING}?  There might be other
> problems like the reason given to the server when paused or throttled,
> which is answered back by innd when issuing MODE READER.
>
> Unless we do not care at all not to send UTF-8 in those cases?

Well, to some extent it's the fault of the administrator who did that, but
if we wanted to patch it up, we could fairly easily.  Just add change:

version="$1"
extra="$2"

to

version=`echo "$1" | tr -dc 'A-Za-z0-9.,;_ -'`
extra=`echo "$2" | tr -dc 'A-Za-z0-9.,;_ -'`

in support/mkversion, with whatever accepting range of characters seems
best.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list