aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0001-loginutils-use-sha512.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-05-23 09:22:51 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-05-23 09:22:51 +0000
commit92877b05d2d48265112d26bfd747d523dab2a9ae (patch)
tree55207f7df2715ffb1545e9dc780d57b8dec9726a /main/busybox/0001-loginutils-use-sha512.patch
parent6721d09700d85e17dcaf03d9bb5b4cc9b4bd2020 (diff)
downloadaports-92877b05d2d48265112d26bfd747d523dab2a9ae.tar.bz2
aports-92877b05d2d48265112d26bfd747d523dab2a9ae.tar.xz
main/busybox: upgrade to 1.20.0
Diffstat (limited to 'main/busybox/0001-loginutils-use-sha512.patch')
-rw-r--r--main/busybox/0001-loginutils-use-sha512.patch106
1 files changed, 0 insertions, 106 deletions
diff --git a/main/busybox/0001-loginutils-use-sha512.patch b/main/busybox/0001-loginutils-use-sha512.patch
deleted file mode 100644
index c4c1cf34be..0000000000
--- a/main/busybox/0001-loginutils-use-sha512.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From 253a5e60f5917b29da687b802f56a8503ff9b29a Mon Sep 17 00:00:00 2001
-From: Natanael Copa <natanael.copa@gmail.com>
-Date: Fri, 21 Oct 2011 14:04:01 +0000
-Subject: [PATCH] loginutils: use sha512
-
----
- libbb/pw_encrypt.c | 2 +-
- loginutils/chpasswd.c | 23 +++++++++++++++--------
- loginutils/passwd.c | 2 +-
- 3 files changed, 17 insertions(+), 10 deletions(-)
-
-diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
-index 39ffa08..dcf6ca5 100644
---- a/libbb/pw_encrypt.c
-+++ b/libbb/pw_encrypt.c
-@@ -59,7 +59,7 @@ char* FAST_FUNC crypt_make_pw_salt(char salt[MAX_PW_SALT_LEN], const char *algo)
- *salt_ptr++ = '$';
- #if !ENABLE_USE_BB_CRYPT || ENABLE_USE_BB_CRYPT_SHA
- if (algo[0] == 's') { /* sha */
-- salt[1] = '5' + (strcmp(algo, "sha512") == 0);
-+ salt[1] = '6' + (strcmp(algo, "sha512") == 0);
- len = 16/2;
- }
- #endif
-diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
-index b7df57e..029ddfa 100644
---- a/loginutils/chpasswd.c
-+++ b/loginutils/chpasswd.c
-@@ -13,22 +13,26 @@
- //usage: "Read user:password from stdin and update /etc/passwd\n"
- //usage: IF_LONG_OPTS(
- //usage: "\n -e,--encrypted Supplied passwords are in encrypted form"
--//usage: "\n -m,--md5 Use MD5 encryption instead of DES"
-+//usage: "\n -m,--md5 Use MD5 encryption instead of SHA512"
-+//usage: "\n -d,--des Use DES encryption instead of SHA512"
- //usage: )
- //usage: IF_NOT_LONG_OPTS(
- //usage: "\n -e Supplied passwords are in encrypted form"
--//usage: "\n -m Use MD5 encryption instead of DES"
-+//usage: "\n -m Use MD5 encryption instead of SHA512"
-+//usage: "\n -d Use DES encryption instead of SHA512"
- //usage: )
-
- #if ENABLE_LONG_OPTS
- static const char chpasswd_longopts[] ALIGN1 =
- "encrypted\0" No_argument "e"
- "md5\0" No_argument "m"
-+ "des\0" No_argument "d"
- ;
- #endif
-
- #define OPT_ENC 1
- #define OPT_MD5 2
-+#define OPT_DES 4
-
- int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int chpasswd_main(int argc UNUSED_PARAM, char **argv)
-@@ -39,9 +43,9 @@ int chpasswd_main(int argc UNUSED_PARAM, char **argv)
- if (getuid() != 0)
- bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
-
-- opt_complementary = "m--e:e--m";
-+ opt_complementary = "m--e:e--m:d--e:e--d:m--d:d--m";
- IF_LONG_OPTS(applet_long_options = chpasswd_longopts;)
-- opt = getopt32(argv, "em");
-+ opt = getopt32(argv, "emd");
-
- while ((name = xmalloc_fgetline(stdin)) != NULL) {
- char *free_me;
-@@ -59,13 +63,16 @@ int chpasswd_main(int argc UNUSED_PARAM, char **argv)
- if (!(opt & OPT_ENC)) {
- char salt[sizeof("$N$XXXXXXXX")];
-
-- crypt_make_salt(salt, 1);
-+ crypt_make_salt(salt + 3, 4);
-+ salt[0] = '$';
-+ salt[1] = '6';
-+ salt[2] = '$';
- if (opt & OPT_MD5) {
-- salt[0] = '$';
- salt[1] = '1';
-- salt[2] = '$';
-- crypt_make_salt(salt + 3, 4);
-+ } else if (opt & OPT_DES) {
-+ crypt_make_salt(salt, 1);
- }
-+
- free_me = pass = pw_encrypt(pass, salt, 0);
- }
-
-diff --git a/loginutils/passwd.c b/loginutils/passwd.c
-index 1cfafae..f29d66c 100644
---- a/loginutils/passwd.c
-+++ b/loginutils/passwd.c
-@@ -94,7 +94,7 @@ int passwd_main(int argc UNUSED_PARAM, char **argv)
- };
- unsigned opt;
- int rc;
-- const char *opt_a = "d"; /* des */
-+ const char *opt_a = "s"; /* sha512 */
- const char *filename;
- char *myname;
- char *name;
---
-1.7.7
-