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:
bc29e50
)
udev: do not export "static node" tags for non-existing devices
author
Kay Sievers
<kay@vrfy.org>
Wed, 2 Apr 2014 13:47:09 +0000
(15:47 +0200)
committer
Kay Sievers
<kay@vrfy.org>
Wed, 2 Apr 2014 13:47:09 +0000
(15:47 +0200)
src/udev/udev-rules.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-rules.c
b/src/udev/udev-rules.c
index 26302640a6405c157c7a6c39ba5688cefc9abe7b..17f47f2613f363893ae1b315a17167479b5b1323 100644
(file)
--- a/
src/udev/udev-rules.c
+++ b/
src/udev/udev-rules.c
@@
-2555,10
+2555,15
@@
int udev_rules_apply_static_dev_perms(struct udev_rules *rules)
struct stat stats;
/* we assure, that the permissions tokens are sorted before the static token */
struct stat stats;
/* we assure, that the permissions tokens are sorted before the static token */
+
if (mode == 0 && uid == 0 && gid == 0 && tags == NULL)
goto next;
strscpyl(device_node, sizeof(device_node), "/dev/", rules_str(rules, cur->key.value_off), NULL);
if (mode == 0 && uid == 0 && gid == 0 && tags == NULL)
goto next;
strscpyl(device_node, sizeof(device_node), "/dev/", rules_str(rules, cur->key.value_off), NULL);
+ if (stat(device_node, &stats) != 0)
+ break;
+ if (!S_ISBLK(stats.st_mode) && !S_ISCHR(stats.st_mode))
+ break;
/* export the tags to a directory as symlinks, allowing otherwise dead nodes to be tagged */
if (tags) {
/* export the tags to a directory as symlinks, allowing otherwise dead nodes to be tagged */
if (tags) {
@@
-2588,11
+2593,6
@@
int udev_rules_apply_static_dev_perms(struct udev_rules *rules)
if (mode == 0 && uid == 0 && gid == 0)
break;
if (mode == 0 && uid == 0 && gid == 0)
break;
- if (stat(device_node, &stats) != 0)
- break;
- if (!S_ISBLK(stats.st_mode) && !S_ISCHR(stats.st_mode))
- break;
-
if (mode == 0) {
if (gid > 0)
mode = 0660;
if (mode == 0) {
if (gid > 0)
mode = 0660;