From 7ba58efd3a54fd63b639bb6c74866e7041ab0dad Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 14 Sep 2019 00:40:30 -0400 Subject: [PATCH] Installer: Skip block, character, FIFO, and socket devices/files. Fixes #15019. --- src/apps/installer/WorkerThread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/apps/installer/WorkerThread.cpp b/src/apps/installer/WorkerThread.cpp index f1aa7badaa..851014e390 100644 --- a/src/apps/installer/WorkerThread.cpp +++ b/src/apps/installer/WorkerThread.cpp @@ -117,6 +117,12 @@ public: virtual bool ShouldCopyEntry(const BEntry& entry, const char* path, const struct stat& statInfo, int32 level) const { + if (S_ISBLK(statInfo.st_mode) || S_ISCHR(statInfo.st_mode) + || S_ISFIFO(statInfo.st_mode) || S_ISSOCK(statInfo.st_mode)) { + printf("skipping '%s', it is a special file.\n", path); + return false; + } + if (fIgnorePaths.find(path) != fIgnorePaths.end()) { printf("ignoring '%s'.\n", path); return false;