aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-03-12 06:08:28 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-03-12 06:08:28 +0100
commit5c942713b7369d239b1303c0cfc7049d898564d4 (patch)
treed81670baa8f214eb50b525016a8ec50bc7c7bbd5
parent9ac5596a5154d789964150737a784dc4db98265b (diff)
downloadbusybox-5c942713b7369d239b1303c0cfc7049d898564d4.tar.gz
busybox: fail if --install is not given an absolute path
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/appletlib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 69cac2e9a..fc84d36ec 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -721,10 +721,9 @@ static int busybox_main(char **argv)
* In such case, better use argv[0] as symlink target
* if it is a full path name.
*/
- if (argv[0][0] == '/')
- busybox = argv[0];
- else
- busybox = bb_busybox_exec_path;
+ if (argv[0][0] != '/')
+ bb_error_msg_and_die("'%s' is not an absolute path", argv[0]);
+ busybox = argv[0];
}
/* busybox --install [-s] [DIR]:
* -s: make symlinks