log_verbose_* functions mishandle arguments
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.
* 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_
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
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 $@; } warning_ msg() { [ "$VERBOSE" = no ] || log_warning_msg $@; }
log_verbose_
... could you write this (note the quotes)?
log_verbose_ success_ msg() { [ "$VERBOSE" = no ] || log_success_msg "$@"; } warning_ msg() { [ "$VERBOSE" = no ] || log_warning_msg "$@"; }
log_verbose_
That will preserve the same number of arguments when passing them through to the
underlying functions, rather than doing word splitting.