diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-13 12:27:17 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-13 12:27:17 +0000 |
commit | ca525b4f24a1a27ffe5dfc8d04c55227ca335ba0 (patch) | |
tree | 8ccf1f528aafeeb00368c41be74900db86d43d14 | |
parent | b51fd3525e48c79ef9e854dd357a9cdfdfeef72b (diff) | |
download | busybox-w32-ca525b4f24a1a27ffe5dfc8d04c55227ca335ba0.tar.gz busybox-w32-ca525b4f24a1a27ffe5dfc8d04c55227ca335ba0.tar.bz2 busybox-w32-ca525b4f24a1a27ffe5dfc8d04c55227ca335ba0.zip |
*: BB_BANNER -> bb_banner (it is not a const or #define)!
correct_password: explain in detail why it is ok to use bb_banner
fsck_minix: make it print bb version, not it's own (outdated/irrelevant) one
Marginal size difference:
text data bss dec hex filename
679119 2700 15632 697451 aa46b busybox_old
679091 2700 15632 697423 aa44f busybox_unstripped
-rw-r--r-- | applets/applets.c | 14 | ||||
-rw-r--r-- | include/libbb.h | 5 | ||||
-rw-r--r-- | init/init.c | 2 | ||||
-rw-r--r-- | libbb/correct_password.c | 11 | ||||
-rw-r--r-- | libbb/messages.c | 3 | ||||
-rw-r--r-- | shell/ash.c | 10 | ||||
-rw-r--r-- | shell/hush.c | 2 | ||||
-rw-r--r-- | shell/lash.c | 4 | ||||
-rw-r--r-- | shell/msh.c | 6 | ||||
-rw-r--r-- | sysklogd/klogd.c | 2 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 3 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 2 |
12 files changed, 33 insertions, 31 deletions
diff --git a/applets/applets.c b/applets/applets.c index f34124252..cff792fb7 100644 --- a/applets/applets.c +++ b/applets/applets.c | |||
@@ -467,11 +467,11 @@ void bb_show_usage(void) | |||
467 | i--; | 467 | i--; |
468 | } | 468 | } |
469 | 469 | ||
470 | format_string = "%s\n\nUsage: %s %s\n\n"; | 470 | fprintf(stderr, "%s multi-call binary\n", bb_banner); |
471 | format_string = "\nUsage: %s %s\n\n"; | ||
471 | if (*p == '\b') | 472 | if (*p == '\b') |
472 | format_string = "%s\n\nNo help available.\n\n"; | 473 | format_string = "\nNo help available.\n\n"; |
473 | fprintf(stderr, format_string, bb_msg_full_version, | 474 | fprintf(stderr, format_string, applet_name, p); |
474 | applet_name, p); | ||
475 | dealloc_usage_messages((char*)usage_string); | 475 | dealloc_usage_messages((char*)usage_string); |
476 | } | 476 | } |
477 | xfunc_die(); | 477 | xfunc_die(); |
@@ -550,8 +550,8 @@ static int busybox_main(char **argv) | |||
550 | /* leading tab and room to wrap */ | 550 | /* leading tab and room to wrap */ |
551 | output_width -= sizeof("start-stop-daemon, ") + 8; | 551 | output_width -= sizeof("start-stop-daemon, ") + 8; |
552 | 552 | ||
553 | printf("%s\n" | 553 | printf("%s multi-call binary\n", bb_banner); /* reuse const string... */ |
554 | "Copyright (C) 1998-2006 Erik Andersen, Rob Landley, and others.\n" | 554 | printf("Copyright (C) 1998-2006 Erik Andersen, Rob Landley, and others.\n" |
555 | "Licensed under GPLv2. See source distribution for full notice.\n" | 555 | "Licensed under GPLv2. See source distribution for full notice.\n" |
556 | "\n" | 556 | "\n" |
557 | "Usage: busybox [function] [arguments]...\n" | 557 | "Usage: busybox [function] [arguments]...\n" |
@@ -561,7 +561,7 @@ static int busybox_main(char **argv) | |||
561 | "\tutilities into a single executable. Most people will create a\n" | 561 | "\tutilities into a single executable. Most people will create a\n" |
562 | "\tlink to busybox for each function they wish to use and BusyBox\n" | 562 | "\tlink to busybox for each function they wish to use and BusyBox\n" |
563 | "\twill act like whatever it was invoked as!\n" | 563 | "\twill act like whatever it was invoked as!\n" |
564 | "\nCurrently defined functions:\n", bb_msg_full_version); | 564 | "\nCurrently defined functions:\n"); |
565 | col = 0; | 565 | col = 0; |
566 | a = applets; | 566 | a = applets; |
567 | while (a->name) { | 567 | while (a->name) { |
diff --git a/include/libbb.h b/include/libbb.h index 5aa95ea88..c0c417c95 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -927,9 +927,8 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ | |||
927 | #define FILEUTILS_CP_OPTSTR "pdRfils" USE_SELINUX("c") | 927 | #define FILEUTILS_CP_OPTSTR "pdRfils" USE_SELINUX("c") |
928 | extern const struct bb_applet *current_applet; | 928 | extern const struct bb_applet *current_applet; |
929 | extern const char *applet_name; | 929 | extern const char *applet_name; |
930 | extern const char BB_BANNER[]; | 930 | /* "BusyBox vN.N.N (timestamp or extra_vestion)" */ |
931 | 931 | extern const char bb_banner[]; | |
932 | extern const char bb_msg_full_version[]; | ||
933 | extern const char bb_msg_memory_exhausted[]; | 932 | extern const char bb_msg_memory_exhausted[]; |
934 | extern const char bb_msg_invalid_date[]; | 933 | extern const char bb_msg_invalid_date[]; |
935 | extern const char bb_msg_read_error[]; | 934 | extern const char bb_msg_read_error[]; |
diff --git a/init/init.c b/init/init.c index 6fcdc03c1..da79d101d 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -934,7 +934,7 @@ int init_main(int argc, char **argv) | |||
934 | if (argc > 1) setenv("RUNLEVEL", argv[1], 1); | 934 | if (argc > 1) setenv("RUNLEVEL", argv[1], 1); |
935 | 935 | ||
936 | /* Hello world */ | 936 | /* Hello world */ |
937 | message(MAYBE_CONSOLE | L_LOG, "init started: %s", bb_msg_full_version); | 937 | message(MAYBE_CONSOLE | L_LOG, "init started: %s", bb_banner); |
938 | 938 | ||
939 | /* Make sure there is enough memory to do something useful. */ | 939 | /* Make sure there is enough memory to do something useful. */ |
940 | if (ENABLE_SWAPONOFF) { | 940 | if (ENABLE_SWAPONOFF) { |
diff --git a/libbb/correct_password.c b/libbb/correct_password.c index 6255f7e65..d0f68c0cd 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c | |||
@@ -47,9 +47,14 @@ int correct_password(const struct passwd *pw) | |||
47 | char buffer[256]; | 47 | char buffer[256]; |
48 | #endif | 48 | #endif |
49 | 49 | ||
50 | correct = bb_msg_full_version; /* fake salt. crypt() can choke otherwise */ | 50 | /* fake salt. crypt() can choke otherwise. |
51 | if (!pw) | 51 | * (bb_banner's first two chars are letters and thus are valid salt) */ |
52 | goto fake_it; /* The content of 'correct' will never match */ | 52 | correct = bb_banner; |
53 | if (!pw) { | ||
54 | /* bb_banner will never match, it contains () which is never | ||
55 | * generated in valid encrypted passwords. */ | ||
56 | goto fake_it; | ||
57 | } | ||
53 | correct = pw->pw_passwd; | 58 | correct = pw->pw_passwd; |
54 | #if ENABLE_FEATURE_SHADOWPASSWDS | 59 | #if ENABLE_FEATURE_SHADOWPASSWDS |
55 | if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) { | 60 | if (LONE_CHAR(pw->pw_passwd, 'x') || LONE_CHAR(pw->pw_passwd, '*')) { |
diff --git a/libbb/messages.c b/libbb/messages.c index 56cccaf2c..8cab2dcc8 100644 --- a/libbb/messages.c +++ b/libbb/messages.c | |||
@@ -12,8 +12,7 @@ | |||
12 | #else | 12 | #else |
13 | #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" | 13 | #define BANNER "BusyBox v" BB_VER " (" BB_EXTRA_VERSION ")" |
14 | #endif | 14 | #endif |
15 | const char BB_BANNER[] = BANNER; | 15 | const char bb_banner[] = BANNER; |
16 | const char bb_msg_full_version[] = BANNER " multi-call binary"; | ||
17 | 16 | ||
18 | const char bb_msg_memory_exhausted[] = "memory exhausted"; | 17 | const char bb_msg_memory_exhausted[] = "memory exhausted"; |
19 | const char bb_msg_invalid_date[] = "invalid date '%s'"; | 18 | const char bb_msg_invalid_date[] = "invalid date '%s'"; |
diff --git a/shell/ash.c b/shell/ash.c index 173beb195..35eec42a7 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -7737,16 +7737,16 @@ setinteractive(int on) | |||
7737 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET | 7737 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET |
7738 | if (is_interactive > 1) { | 7738 | if (is_interactive > 1) { |
7739 | /* Looks like they want an interactive shell */ | 7739 | /* Looks like they want an interactive shell */ |
7740 | static smallint do_banner; | 7740 | static smallint did_banner; |
7741 | 7741 | ||
7742 | if (!do_banner) { | 7742 | if (!did_banner) { |
7743 | out1fmt( | 7743 | out1fmt( |
7744 | "\n\n" | 7744 | "\n\n" |
7745 | "%s Built-in shell (ash)\n" | 7745 | "%s built-in shell (ash)\n" |
7746 | "Enter 'help' for a list of built-in commands." | 7746 | "Enter 'help' for a list of built-in commands." |
7747 | "\n\n", | 7747 | "\n\n", |
7748 | BB_BANNER); | 7748 | bb_banner); |
7749 | do_banner = 1; | 7749 | did_banner = 1; |
7750 | } | 7750 | } |
7751 | } | 7751 | } |
7752 | #endif | 7752 | #endif |
diff --git a/shell/hush.c b/shell/hush.c index e6fa3d9a5..a446bbeb2 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -3787,7 +3787,7 @@ int hush_main(int argc, char **argv) | |||
3787 | hush_exit(xfunc_error_retval); | 3787 | hush_exit(xfunc_error_retval); |
3788 | } | 3788 | } |
3789 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET | 3789 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET |
3790 | printf("\n\n%s hush - the humble shell v"HUSH_VER_STR"\n", BB_BANNER); | 3790 | printf("\n\n%s hush - the humble shell v"HUSH_VER_STR"\n", bb_banner); |
3791 | printf("Enter 'help' for a list of built-in commands.\n\n"); | 3791 | printf("Enter 'help' for a list of built-in commands.\n\n"); |
3792 | #endif | 3792 | #endif |
3793 | } | 3793 | } |
diff --git a/shell/lash.c b/shell/lash.c index 21c95fb1b..4e8b23776 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -1548,9 +1548,9 @@ int lash_main(int argc_l, char **argv_l) | |||
1548 | if (opt & LASH_OPT_i) { | 1548 | if (opt & LASH_OPT_i) { |
1549 | /* Looks like they want an interactive shell */ | 1549 | /* Looks like they want an interactive shell */ |
1550 | if (!ENABLE_FEATURE_SH_EXTRA_QUIET) { | 1550 | if (!ENABLE_FEATURE_SH_EXTRA_QUIET) { |
1551 | printf("\n\n%s Built-in shell (lash)\n" | 1551 | printf("\n\n%s built-in shell (lash)\n" |
1552 | "Enter 'help' for a list of built-in commands.\n\n", | 1552 | "Enter 'help' for a list of built-in commands.\n\n", |
1553 | BB_BANNER); | 1553 | bb_banner); |
1554 | } | 1554 | } |
1555 | } else if (!local_pending_command && argv[optind]) { | 1555 | } else if (!local_pending_command && argv[optind]) { |
1556 | //printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]); | 1556 | //printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]); |
diff --git a/shell/msh.c b/shell/msh.c index dc2fa9c16..2328e0734 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -36,7 +36,7 @@ | |||
36 | # define bb_dev_null "/dev/null" | 36 | # define bb_dev_null "/dev/null" |
37 | # define DEFAULT_SHELL "/proc/self/exe" | 37 | # define DEFAULT_SHELL "/proc/self/exe" |
38 | # define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe" | 38 | # define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe" |
39 | # define BB_BANNER "busybox standalone" | 39 | # define bb_banner "busybox standalone" |
40 | # define ENABLE_FEATURE_SH_STANDALONE 0 | 40 | # define ENABLE_FEATURE_SH_STANDALONE 0 |
41 | # define bb_msg_memory_exhausted "memory exhausted" | 41 | # define bb_msg_memory_exhausted "memory exhausted" |
42 | # define xmalloc(size) malloc(size) | 42 | # define xmalloc(size) malloc(size) |
@@ -5315,9 +5315,9 @@ int msh_main(int argc, char **argv) | |||
5315 | interactive++; | 5315 | interactive++; |
5316 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET | 5316 | #if !ENABLE_FEATURE_SH_EXTRA_QUIET |
5317 | #ifdef MSHDEBUG | 5317 | #ifdef MSHDEBUG |
5318 | printf("\n\n%s Built-in shell (msh with debug)\n", BB_BANNER); | 5318 | printf("\n\n%s built-in shell (msh with debug)\n", bb_banner); |
5319 | #else | 5319 | #else |
5320 | printf("\n\n%s Built-in shell (msh)\n", BB_BANNER); | 5320 | printf("\n\n%s built-in shell (msh)\n", bb_banner); |
5321 | #endif | 5321 | #endif |
5322 | printf("Enter 'help' for a list of built-in commands.\n\n"); | 5322 | printf("Enter 'help' for a list of built-in commands.\n\n"); |
5323 | #endif | 5323 | #endif |
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index 5beec14db..fcc574686 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c | |||
@@ -68,7 +68,7 @@ int klogd_main(int argc, char **argv) | |||
68 | if (option_mask32 & OPT_LEVEL) | 68 | if (option_mask32 & OPT_LEVEL) |
69 | klogctl(8, NULL, i); | 69 | klogctl(8, NULL, i); |
70 | 70 | ||
71 | syslog(LOG_NOTICE, "klogd started: %s", BB_BANNER); | 71 | syslog(LOG_NOTICE, "klogd started: %s", bb_banner); |
72 | 72 | ||
73 | /* Note: this code does not detect incomplete messages | 73 | /* Note: this code does not detect incomplete messages |
74 | * (messages not ending with '\n' or just when kernel | 74 | * (messages not ending with '\n' or just when kernel |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 955d66f23..74cccf671 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -114,7 +114,6 @@ static smallint version2; | |||
114 | enum { version2 = 0 }; | 114 | enum { version2 = 0 }; |
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | #define PROGRAM_VERSION "1.2 - 11/11/96" | ||
118 | static smallint repair, automatic, verbose, list, show, warn_mode, force; | 117 | static smallint repair, automatic, verbose, list, show, warn_mode, force; |
119 | static smallint changed; /* is filesystem modified? */ | 118 | static smallint changed; /* is filesystem modified? */ |
120 | static smallint errors_uncorrected; /* flag if some error was not corrected */ | 119 | static smallint errors_uncorrected; /* flag if some error was not corrected */ |
@@ -1315,7 +1314,7 @@ int fsck_minix_main(int argc, char **argv) | |||
1315 | * flags and whether or not the -f switch was specified on the | 1314 | * flags and whether or not the -f switch was specified on the |
1316 | * command line. | 1315 | * command line. |
1317 | */ | 1316 | */ |
1318 | printf("%s, "PROGRAM_VERSION"\n", applet_name); | 1317 | printf("%s: %s\n", applet_name, bb_banner); |
1319 | 1318 | ||
1320 | if (!(Super.s_state & MINIX_ERROR_FS) | 1319 | if (!(Super.s_state & MINIX_ERROR_FS) |
1321 | && (Super.s_state & MINIX_VALID_FS) && !force | 1320 | && (Super.s_state & MINIX_VALID_FS) && !force |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index ffdb2141e..92d640407 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -94,7 +94,7 @@ struct globals { | |||
94 | int dev_fd; | 94 | int dev_fd; |
95 | 95 | ||
96 | #if ENABLE_FEATURE_MINIX2 | 96 | #if ENABLE_FEATURE_MINIX2 |
97 | int version2; | 97 | smallint version2; |
98 | #define version2 G.version2 | 98 | #define version2 G.version2 |
99 | #endif | 99 | #endif |
100 | char *device_name; | 100 | char *device_name; |