mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-22 07:00:28 +00:00
abuild-sudo: also look for adduser/group in /usr/sbin
seems like it moved in recent busybox. we need to support both variants
This commit is contained in:
parent
38ab58a5d6
commit
4423ab7b51
@ -14,7 +14,9 @@
|
||||
|
||||
static const char* valid_cmds[] = {
|
||||
"/bin/adduser",
|
||||
"/usr/sbin/adduser",
|
||||
"/bin/addgroup",
|
||||
"/usr/sbin/addgroup",
|
||||
"/sbin/apk",
|
||||
NULL
|
||||
};
|
||||
@ -24,6 +26,8 @@ const char *get_command_path(const char *cmd)
|
||||
const char *p;
|
||||
int i;
|
||||
for (i = 0; valid_cmds[i] != NULL; i++) {
|
||||
if (access(valid_cmds[i], F_OK) == -1)
|
||||
continue;
|
||||
p = strrchr(valid_cmds[i], '/') + 1;
|
||||
if (strcmp(p, cmd) == 0)
|
||||
return valid_cmds[i];
|
||||
|
Loading…
Reference in New Issue
Block a user