From 5e9f4542562315b1da665042833c0431942ce6cc Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 12 Sep 2019 14:35:01 +0200 Subject: [PATCH] Use stat instead of lstat to iterate /Volumes Some entries are symbolic links, so follow them and check the link target for being a directory. --- channels/rdpdr/client/rdpdr_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index b7e88c0..af78c68 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -405,7 +405,8 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr) if (pDirent->d_name[0] != '.') { sprintf_s(fullpath, ARRAYSIZE(fullpath), "%s/%s", szdir, pDirent->d_name); - lstat(fullpath, &buf); + if (stat(fullpath, &buf) != 0) + continue; if (S_ISDIR(buf.st_mode)) { -- 2.7.4