Package: lsb-base
Version: 3.1-22
Severity: important

I believe bug #388836 is invalid and the workaround introduced in
3.1-18 is not only wrong, but introduces a "real" bug.

 PARAMS="--this --that --start-command 'hibernate -F hibernate.conf'"

[remark: I had to add double quotes around the value, because the
submitter used invalid shell syntax - I assume this is what he meant]

This just doesn't do what the submitter probably thinks it should.
You can't use bash quotes inside a string value.  It's a string, you
can't nest quotes.  The single quotes in the string are not being used
to quote strings, they're just printable characters that happen to
look like a single quote.  There was no need to fix a bug because
there was none.

Let's talk about the new bug: spaces in parameters don't work at all
if you specify them correctly:

 start_daemon -- /usr/sbin/foobard --foo "one two  three"

This should result in two parameters passed to /usr/sbin/foobard:
first one is "--foo" and the second one is "one two  three".  Instead,
start_daemon passes four parameters: "--foo", "one", "two", "tree".

Please see the attached test scripts and try running foo.sh.  The
first invocation (directly, without start_daemon) is perfectly
correct, the second one (with start_daemon) breaks in every case.

Here's list of breakages caused by the "eval":

- whitespaces in parameters cause the values to be split
- can't use quotes in parameter values ("unexpected EOF while looking
  for matching `''")
- can't use dollars in parameter values
- empty paramers are dismissed
- any amount of any whitespace is replaced with a single space
- try backquotes! it's fun!
- probably a lot more breakages due to bash syntax conflicting with
  parameter values

Please remove the eval.  It's evil.

Max

Attachment: foo.sh
Description: Bourne shell script

Attachment: bar.sh
Description: Bourne shell script

Reply via email to