chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build-sys: make PolicyKit support compile-time optional (was runtime-optional already)
[elogind.git]
/
src
/
shared
/
virt.c
diff --git
a/src/shared/virt.c
b/src/shared/virt.c
index 6e447944967a115a2e7b0b596254a2d5d9bebc2f..fc62c72328e381341850d021dbd076fb6d5e73ee 100644
(file)
--- 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 */
/* Unfortunately many of these operations require root access
* in one way or another */
- if (geteuid() != 0)
- return -EPERM;
-
- if (r
unning_in_chroot()
> 0) {
+ r = running_in_chroot();
+ if (r < 0)
+ return r;
+ if (r > 0) {
if (id)
*id = "chroot";
if (id)
*id = "chroot";