chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5f1976
)
basic/virt: fix userns check on CONFIG_USER_NS=n kernel (#4651)
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 11 Nov 2016 15:54:54 +0000
(10:54 -0500)
committer
Sven Eden
<yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:35 +0000
(17:58 +0200)
ENOENT should be treated as "false", but because of the broken errno check it
was treated as an error. So ConditionVirtualization=user-namespaces probably
returned the correct answer, but only by accident.
Fixes #4608.
src/basic/virt.c
patch
|
blob
|
history
diff --git
a/src/basic/virt.c
b/src/basic/virt.c
index 35beebe7fa4116f5dedfd2b2a0e50fd0cc97486c..c935c534bb99863695fdf8b3cec3ad4927bfa383 100644
(file)
--- a/
src/basic/virt.c
+++ b/
src/basic/virt.c
@@
-498,7
+498,7
@@
static int userns_has_mapping(const char *name) {
f = fopen(name, "re");
if (!f) {
log_debug_errno(errno, "Failed to open %s: %m", name);
- return errno ==
-
ENOENT ? false : -errno;
+ return errno == ENOENT ? false : -errno;
}
n = getline(&buf, &n_allocated, f);