static void passwd_wrapper(const char *login_name)
{
BB_EXECLP("passwd", "passwd", "--", login_name, NULL);
- bb_error_msg_and_die("can't execute passwd, you must set password manually");
+ bb_simple_error_msg_and_die("can't execute passwd, you must set password manually");
}
//FIXME: upstream adduser has no short options! NOT COMPATIBLE!
/* got root? */
if (geteuid()) {
- bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
+ bb_simple_error_msg_and_die(bb_msg_perm_denied_are_you_root);
}
pw.pw_gecos = (char *)"Linux User,,,";
/* We assume that newly created users "inherit" root's shell setting */
- pw.pw_shell = (char *)get_shell_name();
+ pw.pw_shell = xstrdup(get_shell_name()); /* might come from getpwnam(), need to make a copy */
pw.pw_dir = NULL;
- /* at least one and at most two non-option args */
- /* disable interactive passwd for system accounts */
- opt_complementary = "-1:?2:SD";
- opts = getopt32long(argv, "h:g:s:G:DSHu:k:", adduser_longopts,
+ opts = getopt32long(argv, "^"
+ "h:g:s:G:DSHu:k:"
+ /* at least one and at most two non-option args */
+ /* disable interactive passwd for system accounts */
+ "\0" "-1:?2:SD",
+ adduser_longopts,
&pw.pw_dir, &pw.pw_gecos, &pw.pw_shell,
- &usegroup, &uid, &skel);
+ &usegroup, &uid, &skel
+ );
if (opts & OPT_UID)
pw.pw_uid = xatou_range(uid, 0, CONFIG_LAST_ID);