summaryrefslogtreecommitdiff
path: root/src/shared/virt.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-10-09 22:25:32 +0200
committerLennart Poettering <lennart@poettering.net>2012-10-09 22:25:32 +0200
commit96ede2601f27cd5fe52eed96b873bef55cd0ce23 (patch)
tree0c9812fd9196b9e2e5a186e328c25d65e2ef8ee5 /src/shared/virt.c
parent7a69007a24cfff30158ea80665cb6c3c9d3251b0 (diff)
detect-virt: install with fs caps by default to allow unprivileged access
Diffstat (limited to 'src/shared/virt.c')
-rw-r--r--src/shared/virt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/virt.c b/src/shared/virt.c
index 6e4479449..fc62c7232 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";