Automated submission of kernel panic reports

Colin Percival cperciva at freebsd.org
Mon Nov 4 03:01:04 UTC 2013


On 11/03/13 13:29, Jilles Tjoelker wrote:
> Some remarks about panicmail:
> 
>> local tmpfile=`mktemp` || exit 1
> 
> This kind of thing does not do what you expect. The 'local' utility
> returns 0 because it successfully created the local variable, ignoring
> the status from the command substitution. Use
>   local tmpfile
>   tmpfile=`mktemp` || exit 1
> in both occurrences.

Wow, I had no idea.  I guess it never occurred to me that 'local' would
even *have* an exit status...

>> return 0;
> 
> It would be better style to omit the redundant semicolon here (occurs
> several times).

Yes, that's already fixed (pointed out by dt71).

> Some remarks about pkesh:
> 
>> D=`mktemp -d "${TMP:-/tmp}/pkesh.XXXXXX"`
> 
> I think the usual environment variable for the directory for temporary
> files is TMPDIR, not TMP.

Fixed.

> The rest of the script uses $D mostly unquoted, unlike the change that
> was made to panicmail.

Fixed.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid


More information about the freebsd-hackers mailing list