Commit 4423ab7b authored by Natanael Copa's avatar Natanael Copa

abuild-sudo: also look for adduser/group in /usr/sbin

seems like it moved in recent busybox. we need to support both variants
parent 38ab58a5
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
static const char* valid_cmds[] = { static const char* valid_cmds[] = {
"/bin/adduser", "/bin/adduser",
"/usr/sbin/adduser",
"/bin/addgroup", "/bin/addgroup",
"/usr/sbin/addgroup",
"/sbin/apk", "/sbin/apk",
NULL NULL
}; };
...@@ -24,6 +26,8 @@ const char *get_command_path(const char *cmd) ...@@ -24,6 +26,8 @@ const char *get_command_path(const char *cmd)
const char *p; const char *p;
int i; int i;
for (i = 0; valid_cmds[i] != NULL; i++) { for (i = 0; valid_cmds[i] != NULL; i++) {
if (access(valid_cmds[i], F_OK) == -1)
continue;
p = strrchr(valid_cmds[i], '/') + 1; p = strrchr(valid_cmds[i], '/') + 1;
if (strcmp(p, cmd) == 0) if (strcmp(p, cmd) == 0)
return valid_cmds[i]; return valid_cmds[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment