sysfsutils/0009-path_is_file-should-call-stat-not-lstat.patch
Zhiqiang Liu c843adc279 sysfsutils: backport upstream bugfix patches
sysfsutils: backport upstream bugfix patches

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
2020-07-13 14:33:07 +08:00

26 lines
652 B
Diff

From b7d5488a0a7b392842ae7ff988a6615eab32a95e Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Mon, 29 Jun 2020 10:11:02 -0700
Subject: [PATCH 9/9] path_is_file() should call stat(), not lstat()
---
lib/sysfs_utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sysfs_utils.c b/lib/sysfs_utils.c
index 4fa10f7..0257ffa 100644
--- a/lib/sysfs_utils.c
+++ b/lib/sysfs_utils.c
@@ -293,7 +293,7 @@ int sysfs_path_is_link(const char *path)
errno = EINVAL;
return 1;
}
- if ((lstat(path, &astats)) != 0) {
+ if ((stat(path, &astats)) != 0) {
dprintf("stat() failed\n");
return 1;
}
--
1.8.3.1