diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index 7b1dd3136c40..44aa8ed3bae1 100644 --- a/usr.bin/logger/logger.c +++ b/usr.bin/logger/logger.c @@ -181,8 +181,10 @@ main(int argc, char *argv[]) err(1, "Unable to contact Casper"); caph_cache_catpages(); caph_cache_tzdata(); - if (caph_enter() < 0) - err(1, "Unable to enter capability mode"); + if (nsock == 0) { + if (caph_enter() < 0) + err(1, "Unable to enter capability mode"); + } capsyslog = cap_service_open(capcas, "system.syslog"); if (capsyslog == NULL) err(1, "Unable to open system.syslog service");