summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-07-09 18:13:41 +0200
committerKay Sievers <kay@vrfy.org>2012-07-09 18:13:41 +0200
commit2be7287b0eb88ec7ebc3117e59554c2f6e7ac9e4 (patch)
tree0058c9f53a327ee4f0b941147572d4d1738bb522 /src
parent461b1822321d6be0d7fd8be29bf3b4993ebd1b85 (diff)
udev: never touch device nodes with symlink requests
Diffstat (limited to 'src')
-rw-r--r--src/udev/udev-node.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 1bef5212e6..9add76547f 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -67,21 +67,8 @@ static int node_symlink(struct udev *udev, const char *node, const char *slink)
/* preserve link with correct target, do not replace node of other device */
if (lstat(slink, &stats) == 0) {
if (S_ISBLK(stats.st_mode) || S_ISCHR(stats.st_mode)) {
- struct stat stats2;
-
- log_debug("found existing node instead of symlink '%s'\n", slink);
- if (lstat(node, &stats2) == 0) {
- if ((stats.st_mode & S_IFMT) == (stats2.st_mode & S_IFMT) &&
- stats.st_rdev == stats2.st_rdev && stats.st_ino != stats2.st_ino) {
- log_debug("replace device node '%s' with symlink to our node '%s'\n",
- slink, node);
- } else {
- log_error("device node '%s' already exists, "
- "link to '%s' will not overwrite it\n",
- slink, node);
- goto exit;
- }
- }
+ log_error("conflicting device node '%s' found, link to '%s' will not be created\n", slink, node);
+ goto exit;
} else if (S_ISLNK(stats.st_mode)) {
char buf[UTIL_PATH_SIZE];
int len;