bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #15806] hello translator: unquoted contents option


From: Kalle Olavi Niemitalo
Subject: [bug #15806] hello translator: unquoted contents option
Date: Mon, 12 Sep 2016 22:55:57 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #4, bug #15806 (project hurd):

I prototyped changing fsysopts and showtrans to add quotation marks and
backslashes to the argz vectors when printing them, so that POSIX sh can parse
them.  I added a function that writes an argz vector to a FILE *, with
heuristics so that --option=value becomes --option="value" rather than
"--option=value" if possible.  It mostly works, but there are two snags:

(1) A malicious translator might return an invalid argz vector (in which the
last string does not end with '\0') from file_get_translator or
file_get_fs_options.  The argz_next function that I used is not documented as
tolerating that.  Should use memchr instead, or just check the validity of the
argz vectors as soon as they come from the RPCs.

(2) The upstream version of fsysopts passes the result of argz_stringify to
the error function if fsys_set_options fails.  It is not straightforward to
replace that argz_stringify call with a function that writes to a FILE *. 
Should either use open_memstream or replace the quoting function with one that
writes to a character buffer.

The idea of having fsysopts and showtrans quote the strings seems reasonable
overall, though.

It is probably not useful to add a -0 option like in xargs.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?15806>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]