From: Denis Vlasenko Date: Wed, 20 Aug 2008 22:19:27 +0000 (-0000) Subject: envdir: fix "envdir with no params" case X-Git-Tag: 1_12_0~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b9c262b0296de501c387539abd67d324e33ddcea;p=oweals%2Fbusybox.git envdir: fix "envdir with no params" case --- diff --git a/runit/chpst.c b/runit/chpst.c index 43e8d5f3e..82a81f549 100644 --- a/runit/chpst.c +++ b/runit/chpst.c @@ -213,6 +213,8 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) } else { option_mask32 = opt = 0; argv++; + if (!*argv) + bb_show_usage(); } // envdir? @@ -222,7 +224,7 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) } // setuidgid? - if (ENABLE_SETUIDGID && applet_name[0] == 's') { + if (ENABLE_SETUIDGID && applet_name[1] == 'e') { set_user = *argv++; opt |= OPT_u; }