From 96ede2601f27cd5fe52eed96b873bef55cd0ce23 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 9 Oct 2012 22:25:32 +0200 Subject: detect-virt: install with fs caps by default to allow unprivileged access --- src/shared/virt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/shared/virt.c') diff --git a/src/shared/virt.c b/src/shared/virt.c index 6e44794496..fc62c72328 100644 --- a/src/shared/virt.c +++ b/src/shared/virt.c @@ -159,10 +159,10 @@ int detect_container(const char **id) { /* Unfortunately many of these operations require root access * in one way or another */ - if (geteuid() != 0) - return -EPERM; - - if (running_in_chroot() > 0) { + r = running_in_chroot(); + if (r < 0) + return r; + if (r > 0) { if (id) *id = "chroot"; -- cgit v1.2.3-54-g00ecf