If the -r option is given we cannot enter capability mode.

The option tells kdump to convert numeric UIDs and GIDs into user and
group names plus to convert times and dates into locallized versions.
This all needs opening various files at various occasions.
This commit is contained in:
Pawel Jakub Dawidek 2013-05-30 21:59:29 +00:00
parent 3dd2790a9f
commit d2c9ca44c3

View File

@ -240,8 +240,10 @@ main(int argc, char *argv[])
* XXXPJD: There should be strerror_init() and strsignal_init() in libc.
*/
(void)catopen("libc", NL_CAT_LOCALE);
if (cap_enter() < 0 && errno != ENOSYS)
err(1, "unable to enter capability mode");
if (resolv == 0) {
if (cap_enter() < 0 && errno != ENOSYS)
err(1, "unable to enter capability mode");
}
limitfd(STDIN_FILENO);
limitfd(STDOUT_FILENO);
limitfd(STDERR_FILENO);