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:
0063b26
)
logind: check file is device node before using .st_rdev
author
Lennart Poettering
<lennart@poettering.net>
Mon, 26 Feb 2018 17:34:43 +0000
(18:34 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 30 May 2018 05:59:06 +0000
(07:59 +0200)
src/login/logind.c
patch
|
blob
|
history
diff --git
a/src/login/logind.c
b/src/login/logind.c
index ed250bc2ab4dc42d98975ff3eecad357f0b459a4..481c5e40e58584f55276d0ad0d71843497f407e3 100644
(file)
--- a/
src/login/logind.c
+++ b/
src/login/logind.c
@@
-480,6
+480,12
@@
static int manager_attach_fds(Manager *m) {
continue;
}
+ if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode)) {
+ log_debug("Device fd doesn't actually point to device node: %m");
+ close_nointr(fd);
+ continue;
+ }
+
sd = hashmap_get(s->devices, &st.st_rdev);
if (!sd) {
/* Weird, we got an fd for a session device which wasn't