diff options
author | Nicolas Thill <nico@openwrt.org> | 2011-10-21 23:08:45 +0000 |
---|---|---|
committer | Nicolas Thill <nico@openwrt.org> | 2011-10-21 23:08:45 +0000 |
commit | 3af110207d9034668fe9b714eb2074d280a57cce (patch) | |
tree | aeaf726e05602de4a3b53c1a471a8d14de9f5453 /package/busybox/patches/000-upstream-chpasswd.patch | |
parent | a2797eb1a808a7999c0a33f160be5a5648af4a2a (diff) | |
download | master-187ad058-3af110207d9034668fe9b714eb2074d280a57cce.tar.gz master-187ad058-3af110207d9034668fe9b714eb2074d280a57cce.tar.bz2 master-187ad058-3af110207d9034668fe9b714eb2074d280a57cce.zip |
[package] busybox: update to 1.19.2 (thanks to Peter Wagner)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28513 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/busybox/patches/000-upstream-chpasswd.patch')
-rw-r--r-- | package/busybox/patches/000-upstream-chpasswd.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/package/busybox/patches/000-upstream-chpasswd.patch b/package/busybox/patches/000-upstream-chpasswd.patch new file mode 100644 index 0000000000..75b0c4ddde --- /dev/null +++ b/package/busybox/patches/000-upstream-chpasswd.patch @@ -0,0 +1,55 @@ +--- a/loginutils/chpasswd.c ++++ b/loginutils/chpasswd.c +@@ -33,9 +33,8 @@ static const char chpasswd_longopts[] AL + int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int chpasswd_main(int argc UNUSED_PARAM, char **argv) + { +- char *name, *pass; +- char salt[sizeof("$N$XXXXXXXX")]; +- int opt, rc; ++ char *name; ++ int opt; + + if (getuid() != 0) + bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); +@@ -45,6 +44,10 @@ int chpasswd_main(int argc UNUSED_PARAM, + opt = getopt32(argv, "em"); + + while ((name = xmalloc_fgetline(stdin)) != NULL) { ++ char *free_me; ++ char *pass; ++ int rc; ++ + pass = strchr(name, ':'); + if (!pass) + bb_error_msg_and_die("missing new password"); +@@ -52,7 +55,10 @@ int chpasswd_main(int argc UNUSED_PARAM, + + xuname2uid(name); /* dies if there is no such user */ + ++ free_me = NULL; + if (!(opt & OPT_ENC)) { ++ char salt[sizeof("$N$XXXXXXXX")]; ++ + crypt_make_salt(salt, 1); + if (opt & OPT_MD5) { + salt[0] = '$'; +@@ -60,7 +66,7 @@ int chpasswd_main(int argc UNUSED_PARAM, + salt[2] = '$'; + crypt_make_salt(salt + 3, 4); + } +- pass = pw_encrypt(pass, salt, 0); ++ free_me = pass = pw_encrypt(pass, salt, 0); + } + + /* This is rather complex: if user is not found in /etc/shadow, +@@ -81,8 +87,7 @@ int chpasswd_main(int argc UNUSED_PARAM, + bb_info_msg("Password for '%s' changed", name); + logmode = LOGMODE_STDIO; + free(name); +- if (!(opt & OPT_ENC)) +- free(pass); ++ free(free_me); + } + return EXIT_SUCCESS; + } |