Lvl4Sword / Killer

🔪 System tamper detector for USB, Bluetooth, AC, Battery, Disk Tray, and Ethernet.
https://pypi.org/project/killer/
GNU Affero General Public License v3.0
71 stars 11 forks source link

Power is incorrectly parsed #66

Closed Lvl4Sword closed 2 years ago

Lvl4Sword commented 2 years ago

Due to the following code, located at https://github.com/Lvl4Sword/Killer/blob/main/killer/posix/power.py#L68

def _get_property(device_path: Union[Path, str], property_name: str) -> str:
    """Gets the given property for a device."""
    with open(str(Path(device_path, property_name))) as file:
        return file.readline().strip()

online/present will return as a string, and thus bool() will count them as True regardless. This issue is being created for transparency sake, and to inform that it's known and will be fixed in the new branch.

Lvl4Sword commented 2 years ago

This is fixed in the new branch, closing