aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.h1
-rw-r--r--include/libbb.h14
-rw-r--r--include/usage.h89
3 files changed, 63 insertions, 41 deletions
diff --git a/include/applets.h b/include/applets.h
index 90af4f4c3..a05f74abd 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -89,6 +89,7 @@ USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
89USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp)) 89USE_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_NEVER, chgrp))
90USE_CHMOD(APPLET_NOEXEC(chmod, chmod, _BB_DIR_BIN, _BB_SUID_NEVER, chmod)) 90USE_CHMOD(APPLET_NOEXEC(chmod, chmod, _BB_DIR_BIN, _BB_SUID_NEVER, chmod))
91USE_CHOWN(APPLET_NOEXEC(chown, chown, _BB_DIR_BIN, _BB_SUID_NEVER, chown)) 91USE_CHOWN(APPLET_NOEXEC(chown, chown, _BB_DIR_BIN, _BB_SUID_NEVER, chown))
92USE_CHPASSWD(APPLET(chpasswd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
92USE_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 93USE_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
93USE_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) 94USE_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
94USE_CHRT(APPLET(chrt, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 95USE_CHRT(APPLET(chrt, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
diff --git a/include/libbb.h b/include/libbb.h
index 46860c614..a8b9b5bcf 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -769,6 +769,7 @@ extern void selinux_or_die(void);
769extern int restricted_shell(const char *shell); 769extern int restricted_shell(const char *shell);
770extern void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw); 770extern void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw);
771extern int correct_password(const struct passwd *pw); 771extern int correct_password(const struct passwd *pw);
772/* Returns a ptr to static storage */
772extern char *pw_encrypt(const char *clear, const char *salt); 773extern char *pw_encrypt(const char *clear, const char *salt);
773extern int obscure(const char *old, const char *newval, const struct passwd *pwdp); 774extern int obscure(const char *old, const char *newval, const struct passwd *pwdp);
774extern int index_in_str_array(const char * const string_array[], const char *key); 775extern int index_in_str_array(const char * const string_array[], const char *key);
@@ -776,7 +777,18 @@ extern int index_in_substr_array(const char * const string_array[], const char *
776extern void print_login_issue(const char *issue_file, const char *tty); 777extern void print_login_issue(const char *issue_file, const char *tty);
777extern void print_login_prompt(void); 778extern void print_login_prompt(void);
778 779
779extern void crypt_make_salt(char *p, int cnt); 780/* rnd is additional random input. New one is returned.
781 * Useful if you call crypt_make_salt many times in a row:
782 * rnd = crypt_make_salt(buf1, 4, 0);
783 * rnd = crypt_make_salt(buf2, 4, rnd);
784 * rnd = crypt_make_salt(buf3, 4, rnd);
785 * (otherwise we risk having same salt generated)
786 */
787extern int crypt_make_salt(char *p, int cnt, int rnd);
788
789/* Returns number of lines changed, or -1 on error */
790extern int update_passwd(const char *filename, const char *username,
791 const char *new_pw);
780 792
781int get_terminal_width_height(const int fd, int *width, int *height); 793int get_terminal_width_height(const int fd, int *width, int *height);
782 794
diff --git a/include/usage.h b/include/usage.h
index 29a4991fb..9c77c70d8 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -452,7 +452,7 @@
452 " F Input from file" 452 " F Input from file"
453 453
454#define crond_trivial_usage \ 454#define crond_trivial_usage \
455 "-d[#] -c <crondir> -f -b" 455 "-d[#] -c crondir -f -b"
456#define crond_full_usage \ 456#define crond_full_usage \
457 " -d [#] -l [#] -S -L logfile -f -b -c dir\n" \ 457 " -d [#] -l [#] -S -L logfile -f -b -c dir\n" \
458 " -d num Debug level\n" \ 458 " -d num Debug level\n" \
@@ -466,8 +466,8 @@
466#define crontab_trivial_usage \ 466#define crontab_trivial_usage \
467 "[-c dir] {file|-}|[-u|-l|-e|-d user]" 467 "[-c dir] {file|-}|[-u|-l|-e|-d user]"
468#define crontab_full_usage \ 468#define crontab_full_usage \
469 " file <opts> Replace crontab from file\n" \ 469 " file [opts] Replace crontab from file\n" \
470 " - <opts> Replace crontab from stdin\n" \ 470 " - [opts] Replace crontab from stdin\n" \
471 " -u user Specify user\n" \ 471 " -u user Specify user\n" \
472 " -l [user] List crontab for user\n" \ 472 " -l [user] List crontab for user\n" \
473 " -e [user] Edit crontab for user\n" \ 473 " -e [user] Edit crontab for user\n" \
@@ -1216,7 +1216,7 @@
1216 "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" 1216 "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
1217 1217
1218#define halt_trivial_usage \ 1218#define halt_trivial_usage \
1219 "[-d<delay>] [-n<nosync>] [-f<force>]" 1219 "[-d delay] [-n] [-f]"
1220#define halt_full_usage \ 1220#define halt_full_usage \
1221 "Halt the system" \ 1221 "Halt the system" \
1222 "\n\nOptions:\n" \ 1222 "\n\nOptions:\n" \
@@ -1332,14 +1332,14 @@
1332 "sage\n" 1332 "sage\n"
1333 1333
1334#define httpd_trivial_usage \ 1334#define httpd_trivial_usage \
1335 "[-c <conf file>]" \ 1335 "[-c conffile]" \
1336 " [-p <port>]" \ 1336 " [-p port]" \
1337 " [-i] [-f]" \ 1337 " [-i] [-f]" \
1338 USE_FEATURE_HTTPD_SETUID(" [-u user[:grp]]") \ 1338 USE_FEATURE_HTTPD_SETUID(" [-u user[:grp]]") \
1339 USE_FEATURE_HTTPD_BASIC_AUTH(" [-r <realm>]") \ 1339 USE_FEATURE_HTTPD_BASIC_AUTH(" [-r realm]") \
1340 USE_FEATURE_HTTPD_AUTH_MD5(" [-m pass]") \ 1340 USE_FEATURE_HTTPD_AUTH_MD5(" [-m pass]") \
1341 " [-h home]" \ 1341 " [-h home]" \
1342 " [-d/-e <string>]" 1342 " [-d/-e string]"
1343#define httpd_full_usage \ 1343#define httpd_full_usage \
1344 "Listen for incoming http server requests" \ 1344 "Listen for incoming http server requests" \
1345 "\n\nOptions:\n" \ 1345 "\n\nOptions:\n" \
@@ -1388,27 +1388,27 @@
1388 "uid=1000(andersen) gid=1000(andersen)\n" 1388 "uid=1000(andersen) gid=1000(andersen)\n"
1389 1389
1390#define ifconfig_trivial_usage \ 1390#define ifconfig_trivial_usage \
1391 USE_FEATURE_IFCONFIG_STATUS("[-a]") " <interface> [<address>]" 1391 USE_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]"
1392#define ifconfig_full_usage \ 1392#define ifconfig_full_usage \
1393 "Configure a network interface" \ 1393 "Configure a network interface" \
1394 "\n\nOptions:\n" \ 1394 "\n\nOptions:\n" \
1395 USE_FEATURE_IPV6( \ 1395 USE_FEATURE_IPV6( \
1396 " [add <address>[/<prefixlen>]]\n") \ 1396 " [add ADDRESS[/PREFIXLEN]]\n") \
1397 USE_FEATURE_IPV6( \ 1397 USE_FEATURE_IPV6( \
1398 " [del <address>[/<prefixlen>]]\n") \ 1398 " [del ADDRESS[/PREFIXLEN]]\n") \
1399 " [[-]broadcast [<address>]] [[-]pointopoint [<address>]]\n" \ 1399 " [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]]\n" \
1400 " [netmask <address>] [dstaddr <address>]\n" \ 1400 " [netmask ADDRESS] [dstaddr ADDRESS]\n" \
1401 USE_FEATURE_IFCONFIG_SLIP( \ 1401 USE_FEATURE_IFCONFIG_SLIP( \
1402 " [outfill <NN>] [keepalive <NN>]\n") \ 1402 " [outfill NN] [keepalive NN]\n") \
1403 " " USE_FEATURE_IFCONFIG_HW("[hw ether <address>] ") "[metric <NN>] [mtu <NN>]\n" \ 1403 " " USE_FEATURE_IFCONFIG_HW("[hw ether ADDRESS] ") "[metric NN] [mtu NN]\n" \
1404 " [[-]trailers] [[-]arp] [[-]allmulti]\n" \ 1404 " [[-]trailers] [[-]arp] [[-]allmulti]\n" \
1405 " [multicast] [[-]promisc] [txqueuelen <NN>] [[-]dynamic]\n" \ 1405 " [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic]\n" \
1406 USE_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ( \ 1406 USE_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ( \
1407 " [mem_start <NN>] [io_addr <NN>] [irq <NN>]\n") \ 1407 " [mem_start NN] [io_addr NN] [irq NN]\n") \
1408 " [up|down] ..." 1408 " [up|down] ..."
1409 1409
1410#define ifup_trivial_usage \ 1410#define ifup_trivial_usage \
1411 "<-ahinv> <ifaces...>" 1411 "[-ahinv] ifaces..."
1412#define ifup_full_usage \ 1412#define ifup_full_usage \
1413 "Options:\n" \ 1413 "Options:\n" \
1414 " -a De/configure all interfaces automatically\n" \ 1414 " -a De/configure all interfaces automatically\n" \
@@ -1420,7 +1420,7 @@
1420 " -f Force de/configuration" 1420 " -f Force de/configuration"
1421 1421
1422#define ifdown_trivial_usage \ 1422#define ifdown_trivial_usage \
1423 "<-ahinv> <ifaces...>" 1423 "[-ahinv] ifaces..."
1424#define ifdown_full_usage \ 1424#define ifdown_full_usage \
1425 "Options:\n" \ 1425 "Options:\n" \
1426 " -a De/configure all interfaces automatically\n" \ 1426 " -a De/configure all interfaces automatically\n" \
@@ -1587,7 +1587,7 @@
1587 " -x Do not export externs" 1587 " -x Do not export externs"
1588 1588
1589#define install_trivial_usage \ 1589#define install_trivial_usage \
1590 "[-cgmops] [sources] <dest|directory>" 1590 "[-cgmops] [sources] dest|directory"
1591#define install_full_usage \ 1591#define install_full_usage \
1592 "Copy files and set attributes" \ 1592 "Copy files and set attributes" \
1593 "\n\nOptions:\n" \ 1593 "\n\nOptions:\n" \
@@ -1634,7 +1634,7 @@
1634 " SCOPE-ID := [host | link | global | NUMBER]" 1634 " SCOPE-ID := [host | link | global | NUMBER]"
1635 1635
1636#define ipcalc_trivial_usage \ 1636#define ipcalc_trivial_usage \
1637 "[OPTION]... <ADDRESS>[[/]<NETMASK>] [NETMASK]" 1637 "[OPTION]... ADDRESS[[/]NETMASK] [NETMASK]"
1638#define ipcalc_full_usage \ 1638#define ipcalc_full_usage \
1639 "Calculate IP network settings from a IP address" \ 1639 "Calculate IP network settings from a IP address" \
1640 "\n\nOptions:" \ 1640 "\n\nOptions:" \
@@ -1778,7 +1778,7 @@
1778 " reached" 1778 " reached"
1779 1779
1780#define setarch_trivial_usage \ 1780#define setarch_trivial_usage \
1781 "<personality> <program> [args ...]" 1781 "personality program [args ...]"
1782#define setarch_full_usage \ 1782#define setarch_full_usage \
1783 "Personality may be:\n" \ 1783 "Personality may be:\n" \
1784 " linux32 Set 32bit uname emulation\n" \ 1784 " linux32 Set 32bit uname emulation\n" \
@@ -2502,7 +2502,7 @@
2502 "to standard output. With no FILE, or when FILE is -, read standard input." 2502 "to standard output. With no FILE, or when FILE is -, read standard input."
2503 2503
2504#define openvt_trivial_usage \ 2504#define openvt_trivial_usage \
2505 "<vtnum> <COMMAND> [ARGS...]" 2505 "VTNUM COMMAND [ARGS...]"
2506#define openvt_full_usage \ 2506#define openvt_full_usage \
2507 "Start a command on a new virtual terminal" 2507 "Start a command on a new virtual terminal"
2508#define openvt_example_usage \ 2508#define openvt_example_usage \
@@ -2520,8 +2520,17 @@
2520 " -l Locks (disables) the specified user account\n" \ 2520 " -l Locks (disables) the specified user account\n" \
2521 " -u Unlocks (re-enables) the specified user account" 2521 " -u Unlocks (re-enables) the specified user account"
2522 2522
2523#define chpasswd_trivial_usage \
2524 "[--md5|--encrypt]"
2525#define chpasswd_full_usage \
2526 "Read user:password information from stdin\n" \
2527 "and update /etc/passwd accordingly." \
2528 "\n\nOptions:" \
2529 "\n -e, --encrypt Supplied passwords are in encrypted form" \
2530 "\n -m, --md5 Use MD5 encryption instead of DES"
2531
2523#define patch_trivial_usage \ 2532#define patch_trivial_usage \
2524 "[-p<num>] [-i <diff>]" 2533 "[-p num] [-i diff]"
2525#define patch_full_usage \ 2534#define patch_full_usage \
2526 " -p NUM Strip NUM leading components from file names\n" \ 2535 " -p NUM Strip NUM leading components from file names\n" \
2527 " -i DIFF Read DIFF instead of stdin" 2536 " -i DIFF Read DIFF instead of stdin"
@@ -2612,7 +2621,7 @@
2612 "the new root file system" 2621 "the new root file system"
2613 2622
2614#define poweroff_trivial_usage \ 2623#define poweroff_trivial_usage \
2615 "[-d<delay>] [-n<nosync>] [-f<force>]" 2624 "[-d delay] [-n] [-f]"
2616#define poweroff_full_usage \ 2625#define poweroff_full_usage \
2617 "Halt and shut off power" \ 2626 "Halt and shut off power" \
2618 "\n\nOptions:\n" \ 2627 "\n\nOptions:\n" \
@@ -2729,9 +2738,9 @@
2729 "[OPTIONS]..." 2738 "[OPTIONS]..."
2730#define readprofile_full_usage \ 2739#define readprofile_full_usage \
2731 "Options:\n" \ 2740 "Options:\n" \
2732 " -m <mapfile> (Default: /boot/System.map)\n" \ 2741 " -m mapfile (Default: /boot/System.map)\n" \
2733 " -p <profile> (Default: /proc/profile)\n" \ 2742 " -p profile (Default: /proc/profile)\n" \
2734 " -M <mult> Set the profiling multiplier to <mult>\n" \ 2743 " -M mult Set the profiling multiplier to mult\n" \
2735 " -i Print only info about the sampling step\n" \ 2744 " -i Print only info about the sampling step\n" \
2736 " -v Verbose\n" \ 2745 " -v Verbose\n" \
2737 " -a Print all symbols, even if count is 0\n" \ 2746 " -a Print all symbols, even if count is 0\n" \
@@ -2746,7 +2755,7 @@
2746 "Return the absolute pathnames of given argument" 2755 "Return the absolute pathnames of given argument"
2747 2756
2748#define reboot_trivial_usage \ 2757#define reboot_trivial_usage \
2749 "[-d<delay>] [-n<nosync>] [-f<force>]" 2758 "[-d delay] [-n] [-f]"
2750#define reboot_full_usage \ 2759#define reboot_full_usage \
2751 "Reboot the system" \ 2760 "Reboot the system" \
2752 "\n\nOptions:\n" \ 2761 "\n\nOptions:\n" \
@@ -3083,21 +3092,21 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when
3083 "\n\nOptions:" \ 3092 "\n\nOptions:" \
3084 "\n -S|--start Start" \ 3093 "\n -S|--start Start" \
3085 "\n -K|--stop Stop" \ 3094 "\n -K|--stop Stop" \
3086 "\n -a|--startas <pathname> Starts process specified by pathname" \ 3095 "\n -a|--startas pathname Starts process specified by pathname" \
3087 "\n -b|--background Force process into background" \ 3096 "\n -b|--background Force process into background" \
3088 "\n -u|--user <username>|<uid> Stop this user's processes" \ 3097 "\n -u|--user username|uid Stop this user's processes" \
3089 "\n -x|--exec <executable> Program to either start or check" \ 3098 "\n -x|--exec executable Program to either start or check" \
3090 "\n -m|--make-pidfile Create the -p file and enter pid in it" \ 3099 "\n -m|--make-pidfile Create the -p file and enter pid in it" \
3091 "\n -n|--name <process-name> Stop processes with this name" \ 3100 "\n -n|--name process-name Stop processes with this name" \
3092 "\n -p|--pidfile <pid-file> Save or load pid using a pid-file" \ 3101 "\n -p|--pidfile pid-file Save or load pid using a pid-file" \
3093 "\n -q|--quiet Quiet" \ 3102 "\n -q|--quiet Quiet" \
3094 USE_FEATURE_START_STOP_DAEMON_FANCY( \ 3103 USE_FEATURE_START_STOP_DAEMON_FANCY( \
3095 "\n -o|--oknodo Exit status 0 if nothing done" \ 3104 "\n -o|--oknodo Exit status 0 if nothing done" \
3096 "\n -v|--verbose Verbose" \ 3105 "\n -v|--verbose Verbose" \
3097 "\n -N|--nicelevel <N> Add N to process's nice level" \ 3106 "\n -N|--nicelevel N Add N to process's nice level" \
3098 ) \ 3107 ) \
3099 "\n -s|--signal <signal> Signal to send (default TERM)" \ 3108 "\n -s|--signal signal Signal to send (default TERM)" \
3100 "\n -c|--chuid <user>[:[<group>]] Change to specified user/group" 3109 "\n -c|--chuid user[:[group]] Change to specified user/group"
3101 3110
3102#define stat_trivial_usage \ 3111#define stat_trivial_usage \
3103 "[OPTION] FILE..." 3112 "[OPTION] FILE..."
@@ -3257,7 +3266,7 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when
3257 "sysctl [-n] variable ...\n" \ 3266 "sysctl [-n] variable ...\n" \
3258 "sysctl [-n] -w variable=value ...\n" \ 3267 "sysctl [-n] -w variable=value ...\n" \
3259 "sysctl [-n] -a\n" \ 3268 "sysctl [-n] -a\n" \
3260 "sysctl [-n] -p <file> (default /etc/sysctl.conf)\n" \ 3269 "sysctl [-n] -p file (default /etc/sysctl.conf)\n" \
3261 "sysctl [-n] -A\n" 3270 "sysctl [-n] -A\n"
3262 3271
3263#define syslogd_trivial_usage \ 3272#define syslogd_trivial_usage \
@@ -3747,7 +3756,7 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when
3747 " -a Lock all VTs" 3756 " -a Lock all VTs"
3748 3757
3749#define watch_trivial_usage \ 3758#define watch_trivial_usage \
3750 "[-n <seconds>] [-t] COMMAND..." 3759 "[-n seconds] [-t] COMMAND..."
3751#define watch_full_usage \ 3760#define watch_full_usage \
3752 "Execute a program periodically" \ 3761 "Execute a program periodically" \
3753 "\n\nOptions:\n" \ 3762 "\n\nOptions:\n" \
@@ -3760,7 +3769,7 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when
3760 "Mon Dec 17 10:31:44 GMT 2000" 3769 "Mon Dec 17 10:31:44 GMT 2000"
3761 3770
3762#define watchdog_trivial_usage \ 3771#define watchdog_trivial_usage \
3763 "[-t <seconds>] [-F] DEV" 3772 "[-t seconds] [-F] DEV"
3764#define watchdog_full_usage \ 3773#define watchdog_full_usage \
3765 "Periodically write to watchdog device DEV" \ 3774 "Periodically write to watchdog device DEV" \
3766 "\n\nOptions:\n" \ 3775 "\n\nOptions:\n" \