mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-21 20:40:42 +01:00

When running test-runner as non-root the environment variables SUDO_GID/SUDO_UID were unset, causing atoi to segfault. This replaces atoi with strtol, and checks the existance of SUDO_GID/SUDO_UID before trying to turn it into an integer. This patch also allows the uid/gid to be read from the user if running as non-root. Note: running as non-root does require the users permissions to be setup properly. Directories and files are created when running with logging, so if the user running test-runner does not have these permissions the creation of these files will fail.