projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0410444
)
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
Lennart Poettering
<lennart@poettering.net>
Mon, 26 Feb 2018 17:39:32 +0000
(18:39 +0100)
src/login/logind.c
patch
|
blob
|
history
diff --git
a/src/login/logind.c
b/src/login/logind.c
index
875d467
..
5220861
100644
(file)
--- a/
src/login/logind.c
+++ b/
src/login/logind.c
@@
-453,6
+453,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