aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-04 12:05:26 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-04 12:05:26 +0000
commite45930e8903cd80de149d6e92f05b8a3f80669cf (patch)
tree2363a354db9f2bafb4f3119684daf0b81417326b /include
parent196a953f21b14add828c2cc0e40b4bf8e76b1873 (diff)
downloadbusybox-e45930e8903cd80de149d6e92f05b8a3f80669cf.tar.gz
Fold mkpasswd applet into cryptpw.
mkpasswd is in Debian, OTOH cryptpw was added to busybox earlier. Trying to make both camps happy by making those two applets just aliases. They are command-line compatible. We can decide whether we want to drop one (and which one) later. function old new delta cryptpw_main 183 314 +131 static.methods 21 - -21 packed_usage 25707 25648 -59 mkpasswd_main 307 - -307 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 1/1 up/down: 131/-387) Total: -256 bytes
Diffstat (limited to 'include')
-rw-r--r--include/applets.h2
-rw-r--r--include/usage.h59
2 files changed, 37 insertions, 24 deletions
diff --git a/include/applets.h b/include/applets.h
index 9c844eeae..8d9d2a23b 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -252,7 +252,7 @@ USE_MKFIFO(APPLET(mkfifo, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
//USE_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_ext3))
USE_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix))
USE_MKNOD(APPLET(mknod, _BB_DIR_BIN, _BB_SUID_NEVER))
-USE_MKPASSWD(APPLET(mkpasswd, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+USE_CRYPTPW(APPLET_ODDNAME(mkpasswd, cryptpw, _BB_DIR_USR_BIN, _BB_SUID_NEVER, mkpasswd))
USE_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MKTEMP(APPLET(mktemp, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_MODPROBE(APPLET(modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER))
diff --git a/include/usage.h b/include/usage.h
index 8a1d3fa11..90dde95f0 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -573,18 +573,45 @@
"\n -r Delete crontab" \
"\n FILE Replace crontab by FILE ('-': stdin)" \
-#if !ENABLE_USE_BB_CRYPT || ENABLE_USE_BB_CRYPT_SHA
#define cryptpw_trivial_usage \
- "[-a des|md5|sha256/512] [string]"
-#else
-#define cryptpw_trivial_usage \
- "[-a des|md5] [string]"
-#endif
+ "[OPTIONS] [PASSWORD] [SALT]"
+/* We do support -s, we just don't mention it */
#define cryptpw_full_usage "\n\n" \
- "Output crypted string.\n" \
- "If string isn't supplied on cmdline, read it from stdin.\n" \
+ "Crypt the PASSWORD using crypt(3)\n" \
"\nOptions:" \
- "\n -a Algorithm to use (default: md5)" \
+ USE_GETOPT_LONG( \
+ "\n -P,--password-fd=NUM Read password from fd NUM" \
+/* "\n -s,--stdin Use stdin; like -P0" */ \
+ "\n -m,--method=TYPE Encryption method TYPE" \
+ "\n -S,--salt=SALT" \
+ ) \
+ SKIP_GETOPT_LONG( \
+ "\n -P NUM Read password from fd NUM" \
+/* "\n -s Use stdin; like -P0" */ \
+ "\n -m TYPE Encryption method TYPE" \
+ "\n -S SALT" \
+ ) \
+
+/* mkpasswd is an alias to cryptpw */
+
+#define mkpasswd_trivial_usage \
+ "[OPTIONS] [PASSWORD] [SALT]"
+/* We do support -s, we just don't mention it */
+#define mkpasswd_full_usage "\n\n" \
+ "Crypt the PASSWORD using crypt(3)\n" \
+ "\nOptions:" \
+ USE_GETOPT_LONG( \
+ "\n -P,--password-fd=NUM Read password from fd NUM" \
+/* "\n -s,--stdin Use stdin; like -P0" */ \
+ "\n -m,--method=TYPE Encryption method TYPE" \
+ "\n -S,--salt=SALT" \
+ ) \
+ SKIP_GETOPT_LONG( \
+ "\n -P NUM Read password from fd NUM" \
+/* "\n -s Use stdin; like -P0" */ \
+ "\n -m TYPE Encryption method TYPE" \
+ "\n -S SALT" \
+ ) \
#define cttyhack_trivial_usage NOUSAGE_STR
#define cttyhack_full_usage ""
@@ -2618,20 +2645,6 @@
"$ mknod /dev/fd0 b 2 0\n" \
"$ mknod -m 644 /tmp/pipe p\n"
-#define mkpasswd_trivial_usage \
- "[OPTIONS] [PASSWORD]"
-#define mkpasswd_full_usage "\n\n" \
- "Crypts the PASSWORD using crypt(3)\n" \
- "\nOptions:" \
- "\n\t-P"USE_GETOPT_LONG(", --password-fd=")"NUM\tread password from fd NUM" \
- "\n\t-s"USE_GETOPT_LONG(", --stdin")"\t\tuse stdin; like -P0" \
- "\n\t-m"USE_GETOPT_LONG(", --method=")"TYPE\tEncryption method TYPE" \
- "\n\t-S"USE_GETOPT_LONG(", --salt=")"SALT\t\tuse SALT"
-
-#define mkpasswd_example_usage \
- "$ mkpasswd -m md5\n" \
- "$ mkpasswd -l 12\n"
-
#define mkswap_trivial_usage \
"DEVICE"
#define mkswap_full_usage "\n\n" \