Avoid 'salvageserver -client -showlog' segfault
authorAndrew Deason <adeason@sinenomine.net>
Fri, 23 Oct 2009 20:02:12 +0000 (15:02 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 26 Oct 2009 18:54:04 +0000 (11:54 -0700)
commitb90f4241285efccdf8be5f9ce3ae28c64fbccd38
tree333b020883e055e5e2c5882bf15516bc6b146e45
parent8edafd92c0ec5b31aff7f86b73f954a04d0f17d4
Avoid 'salvageserver -client -showlog' segfault

Running salvageserver with the -client and -showlog options will
currently segfault, since -client does not open logFile, and -showlog
will attempt to rewind logFile on exit.

Fix this by not allowing -client and -showlog together (since it won't
work anyway, as -showlog tries to read SalvageLog), and by making
showlog() check logFile for NULL-ness.

Change-Id: I30f43ef1696f1e7e8873b9e1cc3867b4e06d1980
Reviewed-on: http://gerrit.openafs.org/734
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vol/salvaged.c
src/vol/vol-salvage.c