From 4423ab7b51aaf385106d1c46fe3984fa2e6e2c48 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 29 May 2013 15:07:27 +0200 Subject: [PATCH] abuild-sudo: also look for adduser/group in /usr/sbin seems like it moved in recent busybox. we need to support both variants --- abuild-sudo.c | 4 ++++ 1 file changed, 4 insertions(+) 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];