Chung-chieh Shan wrote:
Package: laptop-mode-tools
Version: 1.34-1
Severity: normal
Tags: patch

Hello,

/etc/init.d/laptop-mode creates a temporary file without removing it
every time it is run, because it invokes rm only on abnormal exit.
The numerous occurrences of
    $( cat $TEMPFILE )
in this script are underquoted: where it is double quoted, it should
be single quoted so that cat is not run too early, and where it is
unquoted, it should be double quoted so that the output of laptop_mode
is not subject to globbing.  Finally, these uses of temporary files
are unnecessary because the shell can directly turn the output of
laptop_mode into an argument to log_action_end_msg.
[...]
-trap "log_action_end_msg 10 $( cat $TEMPFILE ) ; rm $TEMPFILE; exit 10" HUP 
INT ABRT QUIT SEGV TERM
+trap 'log_action_end_msg 10 "Failed to start laptop mode"; exit 10' HUP INT 
ABRT QUIT SEGV TERM

I've finally gotten around to this, sorry for the delay. I think this solution hides the output of the command on failure, which is exactly when you *would* want to see it. Therefore I don't think we can get rid of the temporary files. You're right about the quoting though, I'll add proper quoting and I'll remove the file properly at the end!

Cheers,
Bart



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to