log_verbose_* functions mishandle arguments

Bug #21626 reported by Markus Kolb
6
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Fix Released
Low
LaMont Jones

Bug Description

An ugly error message during boot...

$ sudo /etc/rcS.d/S22hwclockfirst.sh start
 * Setting the system clock...
Wrong number of arguments
 * System Clock set. Local time: Mi Sep 14 12:02:06 CEST 2005 [ ok ]

+ /sbin/hwclock --noadjfile --hctosys --localtime
+ /sbin/hwclock --show --localtime
+ grep -q '^The Hardware Clock registers contain values that are either
invalid'++ date
+ log_verbose_success_msg 'System Clock set. Local time: Mi Sep 14 12:05:07 CEST
2005'
+ '[' yes = no ']'
+ log_success_msg System Clock set. Local time: Mi Sep 14 12:05:07 CEST 2005
+ type usplash_write
+ usplash_write 'STATUS System' Clock set. Local time: Mi Sep 14 12:05:07 CEST 2005
Wrong number of arguments

Revision history for this message
Colin Watson (cjwatson) wrote :

This is primarily an lsb-base bug, which I've just fixed:

lsb (3.0-1ubuntu6) breezy; urgency=low

  * Use "$*" rather than "$@" when calling usplash_write, since it requires
    a single argument (part of Ubuntu #15403).

 -- Colin Watson <email address hidden> Wed, 14 Sep 2005 11:31:22 +0100

I think hwclock.sh's verbose logging functions are slightly buggy, though, which
triggers this. LaMont, instead of this:

log_verbose_success_msg() { [ "$VERBOSE" = no ] || log_success_msg $@; }
log_verbose_warning_msg() { [ "$VERBOSE" = no ] || log_warning_msg $@; }

... could you write this (note the quotes)?

log_verbose_success_msg() { [ "$VERBOSE" = no ] || log_success_msg "$@"; }
log_verbose_warning_msg() { [ "$VERBOSE" = no ] || log_warning_msg "$@"; }

That will preserve the same number of arguments when passing them through to the
underlying functions, rather than doing word splitting.

Revision history for this message
LaMont Jones (lamont) wrote :

Fixed in 2.12r-1

Changed in util-linux:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.