Blob Blame History Raw
From fbdc6ab15f7eea0ddcd63da355356ef156dd0d96 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Sat, 13 Aug 2016 17:04:01 +0200
Subject: [PATCH 10/43] fix #716 : crash in scan_dmi_sysfs() when run as
 non-root

---
 src/core/dmi.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/dmi.cc b/src/core/dmi.cc
index ced891a..250f485 100644
--- a/src/core/dmi.cc
+++ b/src/core/dmi.cc
@@ -1823,7 +1823,7 @@ static bool smbios_entry_point(const u8 *buf, size_t len,
 
 static bool scan_dmi_sysfs(hwNode & n)
 {
-  if (!exists(SYSFSDMI "/smbios_entry_point") || !exists(SYSFSDMI "/DMI"))
+  if (access(SYSFSDMI "/smbios_entry_point", R_OK)!=0 || access(SYSFSDMI "/DMI", R_OK)!=0)
     return false;
 
   uint32_t table_len = 0;
-- 
2.10.2