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-w32-e45930e8903cd80de149d6e92f05b8a3f80669cf.tar.gz
busybox-w32-e45930e8903cd80de149d6e92f05b8a3f80669cf.tar.bz2
busybox-w32-e45930e8903cd80de149d6e92f05b8a3f80669cf.zip
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))
252//USE_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_ext3)) 252//USE_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_ext3))
253USE_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix)) 253USE_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_NEVER, mkfs_minix))
254USE_MKNOD(APPLET(mknod, _BB_DIR_BIN, _BB_SUID_NEVER)) 254USE_MKNOD(APPLET(mknod, _BB_DIR_BIN, _BB_SUID_NEVER))
255USE_MKPASSWD(APPLET(mkpasswd, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 255USE_CRYPTPW(APPLET_ODDNAME(mkpasswd, cryptpw, _BB_DIR_USR_BIN, _BB_SUID_NEVER, mkpasswd))
256USE_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_NEVER)) 256USE_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_NEVER))
257USE_MKTEMP(APPLET(mktemp, _BB_DIR_BIN, _BB_SUID_NEVER)) 257USE_MKTEMP(APPLET(mktemp, _BB_DIR_BIN, _BB_SUID_NEVER))
258USE_MODPROBE(APPLET(modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER)) 258USE_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 @@
573 "\n -r Delete crontab" \ 573 "\n -r Delete crontab" \
574 "\n FILE Replace crontab by FILE ('-': stdin)" \ 574 "\n FILE Replace crontab by FILE ('-': stdin)" \
575 575
576#if !ENABLE_USE_BB_CRYPT || ENABLE_USE_BB_CRYPT_SHA
577#define cryptpw_trivial_usage \ 576#define cryptpw_trivial_usage \
578 "[-a des|md5|sha256/512] [string]" 577 "[OPTIONS] [PASSWORD] [SALT]"
579#else 578/* We do support -s, we just don't mention it */
580#define cryptpw_trivial_usage \
581 "[-a des|md5] [string]"
582#endif
583#define cryptpw_full_usage "\n\n" \ 579#define cryptpw_full_usage "\n\n" \
584 "Output crypted string.\n" \ 580 "Crypt the PASSWORD using crypt(3)\n" \
585 "If string isn't supplied on cmdline, read it from stdin.\n" \
586 "\nOptions:" \ 581 "\nOptions:" \
587 "\n -a Algorithm to use (default: md5)" \ 582 USE_GETOPT_LONG( \
583 "\n -P,--password-fd=NUM Read password from fd NUM" \
584/* "\n -s,--stdin Use stdin; like -P0" */ \
585 "\n -m,--method=TYPE Encryption method TYPE" \
586 "\n -S,--salt=SALT" \
587 ) \
588 SKIP_GETOPT_LONG( \
589 "\n -P NUM Read password from fd NUM" \
590/* "\n -s Use stdin; like -P0" */ \
591 "\n -m TYPE Encryption method TYPE" \
592 "\n -S SALT" \
593 ) \
594
595/* mkpasswd is an alias to cryptpw */
596
597#define mkpasswd_trivial_usage \
598 "[OPTIONS] [PASSWORD] [SALT]"
599/* We do support -s, we just don't mention it */
600#define mkpasswd_full_usage "\n\n" \
601 "Crypt the PASSWORD using crypt(3)\n" \
602 "\nOptions:" \
603 USE_GETOPT_LONG( \
604 "\n -P,--password-fd=NUM Read password from fd NUM" \
605/* "\n -s,--stdin Use stdin; like -P0" */ \
606 "\n -m,--method=TYPE Encryption method TYPE" \
607 "\n -S,--salt=SALT" \
608 ) \
609 SKIP_GETOPT_LONG( \
610 "\n -P NUM Read password from fd NUM" \
611/* "\n -s Use stdin; like -P0" */ \
612 "\n -m TYPE Encryption method TYPE" \
613 "\n -S SALT" \
614 ) \
588 615
589#define cttyhack_trivial_usage NOUSAGE_STR 616#define cttyhack_trivial_usage NOUSAGE_STR
590#define cttyhack_full_usage "" 617#define cttyhack_full_usage ""
@@ -2618,20 +2645,6 @@
2618 "$ mknod /dev/fd0 b 2 0\n" \ 2645 "$ mknod /dev/fd0 b 2 0\n" \
2619 "$ mknod -m 644 /tmp/pipe p\n" 2646 "$ mknod -m 644 /tmp/pipe p\n"
2620 2647
2621#define mkpasswd_trivial_usage \
2622 "[OPTIONS] [PASSWORD]"
2623#define mkpasswd_full_usage "\n\n" \
2624 "Crypts the PASSWORD using crypt(3)\n" \
2625 "\nOptions:" \
2626 "\n\t-P"USE_GETOPT_LONG(", --password-fd=")"NUM\tread password from fd NUM" \
2627 "\n\t-s"USE_GETOPT_LONG(", --stdin")"\t\tuse stdin; like -P0" \
2628 "\n\t-m"USE_GETOPT_LONG(", --method=")"TYPE\tEncryption method TYPE" \
2629 "\n\t-S"USE_GETOPT_LONG(", --salt=")"SALT\t\tuse SALT"
2630
2631#define mkpasswd_example_usage \
2632 "$ mkpasswd -m md5\n" \
2633 "$ mkpasswd -l 12\n"
2634
2635#define mkswap_trivial_usage \ 2648#define mkswap_trivial_usage \
2636 "DEVICE" 2649 "DEVICE"
2637#define mkswap_full_usage "\n\n" \ 2650#define mkswap_full_usage "\n\n" \