24 lines
559 B
Diff
24 lines
559 B
Diff
For bug boo#908068: fuser -m not handling block devices properly
|
|
Avoid string comparision for device files
|
|
|
|
---
|
|
src/fuser.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
--- src/fuser.c
|
|
+++ src/fuser.c 2017-06-20 13:56:29.717283482 +0000
|
|
@@ -1915,6 +1915,13 @@ static int mntstat(const char *path, str
|
|
errno = 0;
|
|
return stat(path, buf);
|
|
}
|
|
+ if (strncmp("/dev/", use, 5) == 0) {
|
|
+ /*
|
|
+ * Could be a special file (socket, pipe, inotify)
|
|
+ */
|
|
+ errno = 0;
|
|
+ return stat(path, buf);
|
|
+ }
|
|
|
|
nlen = strlen(use);
|
|
list_for_each(ptr, &mntinfo) {
|