summaryrefslogtreecommitdiff
path: root/abuild-sudo.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-05-29 15:07:27 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2013-05-29 15:07:27 +0200
commit4423ab7b51aaf385106d1c46fe3984fa2e6e2c48 (patch)
treea79275fb80733d57c9c1722cf891be761598fbff /abuild-sudo.c
parent38ab58a5d63d69cf756ea398537e45101690242f (diff)
downloadabuild-4423ab7b51aaf385106d1c46fe3984fa2e6e2c48.tar.gz
abuild-4423ab7b51aaf385106d1c46fe3984fa2e6e2c48.tar.bz2
abuild-4423ab7b51aaf385106d1c46fe3984fa2e6e2c48.tar.xz
abuild-4423ab7b51aaf385106d1c46fe3984fa2e6e2c48.zip
abuild-sudo: also look for adduser/group in /usr/sbin
seems like it moved in recent busybox. we need to support both variants
Diffstat (limited to 'abuild-sudo.c')
-rw-r--r--abuild-sudo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/abuild-sudo.c b/abuild-sudo.c
index 08477dc..3ba48e7 100644
--- a/abuild-sudo.c
+++ b/abuild-sudo.c
@@ -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];