Unverified Commit c4ce5d0c authored by erdnaxe's avatar erdnaxe Committed by GitHub
Browse files

fix: handle absence of read perm on product_serial (#733)

parent e99b527e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -115,10 +115,11 @@ else
fi

SM_BIOS=""
PS="/sys/class/dmi/id/product_serial"

if [ -s "/sys/class/dmi/id/product_serial" ]; then
if [ -s "$PS" ] && [ -r "$PS" ]; then

  BIOS_SERIAL=$(</sys/class/dmi/id/product_serial)
  BIOS_SERIAL=$(<"$PS")
  BIOS_SERIAL="${BIOS_SERIAL//[![:alnum:]]/}"

  if [ -n "$BIOS_SERIAL" ]; then