aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
Diffstat (limited to 'applets')
-rw-r--r--applets/applets.c18
-rw-r--r--applets/busybox.c20
2 files changed, 19 insertions, 19 deletions
diff --git a/applets/applets.c b/applets/applets.c
index 9f69da185..1b69ade92 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -78,7 +78,7 @@ static struct BB_suid_config *suid_config;
78 78
79 79
80 80
81extern void show_usage(void) 81extern void bb_show_usage(void)
82{ 82{
83 const char *format_string; 83 const char *format_string;
84 const char *usage_string = usage_messages; 84 const char *usage_string = usage_messages;
@@ -93,7 +93,7 @@ extern void show_usage(void)
93 format_string = "%s\n\nUsage: %s %s\n\n"; 93 format_string = "%s\n\nUsage: %s %s\n\n";
94 if(*usage_string == '\b') 94 if(*usage_string == '\b')
95 format_string = "%s\n\nNo help available.\n\n"; 95 format_string = "%s\n\nNo help available.\n\n";
96 fprintf(stderr, format_string, full_version, applet_using->name, usage_string); 96 fprintf(stderr, format_string, bb_msg_full_version, applet_using->name, usage_string);
97 97
98 exit(EXIT_FAILURE); 98 exit(EXIT_FAILURE);
99} 99}
@@ -127,7 +127,7 @@ void run_applet_by_name(const char *name, int argc, char **argv)
127 recurse_level++; 127 recurse_level++;
128 /* Do a binary search to find the applet entry given the name. */ 128 /* Do a binary search to find the applet entry given the name. */
129 if ((applet_using = find_applet_by_name(name)) != NULL) { 129 if ((applet_using = find_applet_by_name(name)) != NULL) {
130 applet_name = applet_using->name; 130 bb_applet_name = applet_using->name;
131 if (argv[1] && strcmp(argv[1], "--help") == 0) { 131 if (argv[1] && strcmp(argv[1], "--help") == 0) {
132 if (strcmp(applet_using->name, "busybox")==0) { 132 if (strcmp(applet_using->name, "busybox")==0) {
133 if(argv[2]) 133 if(argv[2])
@@ -136,7 +136,7 @@ void run_applet_by_name(const char *name, int argc, char **argv)
136 applet_using = NULL; 136 applet_using = NULL;
137 } 137 }
138 if(applet_using) 138 if(applet_using)
139 show_usage(); 139 bb_show_usage();
140 been_there_done_that=1; 140 been_there_done_that=1;
141 busybox_main(0, NULL); 141 busybox_main(0, NULL);
142 } 142 }
@@ -201,18 +201,18 @@ void check_suid ( struct BB_applet *applet )
201 m >>= 3; 201 m >>= 3;
202 202
203 if (!( m & S_IXOTH )) /* is x bit not set ? */ 203 if (!( m & S_IXOTH )) /* is x bit not set ? */
204 error_msg_and_die ( "You have no permission to run this applet!" ); 204 bb_error_msg_and_die ( "You have no permission to run this applet!" );
205 205
206 if (( sct-> m_mode & ( S_ISGID | S_IXGRP )) == ( S_ISGID | S_IXGRP )) { /* *both* have to be set for sgid */ 206 if (( sct-> m_mode & ( S_ISGID | S_IXGRP )) == ( S_ISGID | S_IXGRP )) { /* *both* have to be set for sgid */
207 if ( setegid ( sct-> m_gid )) 207 if ( setegid ( sct-> m_gid ))
208 error_msg_and_die ( "BusyBox binary has insufficient rights to set proper GID for applet!" ); 208 bb_error_msg_and_die ( "BusyBox binary has insufficient rights to set proper GID for applet!" );
209 } 209 }
210 else 210 else
211 setgid ( rgid ); /* no sgid -> drop */ 211 setgid ( rgid ); /* no sgid -> drop */
212 212
213 if ( sct-> m_mode & S_ISUID ) { 213 if ( sct-> m_mode & S_ISUID ) {
214 if ( seteuid ( sct-> m_uid )) 214 if ( seteuid ( sct-> m_uid ))
215 error_msg_and_die ( "BusyBox binary has insufficient rights to set proper UID for applet!" ); 215 bb_error_msg_and_die ( "BusyBox binary has insufficient rights to set proper UID for applet!" );
216 } 216 }
217 else 217 else
218 setuid ( ruid ); /* no suid -> drop */ 218 setuid ( ruid ); /* no suid -> drop */
@@ -237,7 +237,7 @@ void check_suid ( struct BB_applet *applet )
237 237
238 if ( applet-> need_suid == _BB_SUID_ALWAYS ) { 238 if ( applet-> need_suid == _BB_SUID_ALWAYS ) {
239 if ( geteuid ( ) != 0 ) 239 if ( geteuid ( ) != 0 )
240 error_msg_and_die ( "This applet requires root priviledges!" ); 240 bb_error_msg_and_die ( "This applet requires root priviledges!" );
241 } 241 }
242 else if ( applet-> need_suid == _BB_SUID_NEVER ) { 242 else if ( applet-> need_suid == _BB_SUID_NEVER ) {
243 setgid ( rgid ); /* drop all priviledges */ 243 setgid ( rgid ); /* drop all priviledges */
@@ -280,7 +280,7 @@ int parse_config_file ( void )
280 p = strchr ( buffer, '#' ); 280 p = strchr ( buffer, '#' );
281 if ( p ) 281 if ( p )
282 *p = 0; 282 *p = 0;
283 p = buffer + xstrlen ( buffer ); 283 p = buffer + bb_strlen ( buffer );
284 while (( p > buffer ) && isspace ( *--p )) 284 while (( p > buffer ) && isspace ( *--p ))
285 *p = 0; 285 *p = 0;
286 286
diff --git a/applets/busybox.c b/applets/busybox.c
index 4f1ef2661..457a85a68 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -10,7 +10,7 @@
10#endif 10#endif
11 11
12int been_there_done_that = 0; /* Also used in applets.c */ 12int been_there_done_that = 0; /* Also used in applets.c */
13const char *applet_name; 13const char *bb_applet_name;
14 14
15#ifdef CONFIG_FEATURE_INSTALLER 15#ifdef CONFIG_FEATURE_INSTALLER
16/* 16/*
@@ -60,7 +60,7 @@ static void install_links(const char *busybox, int use_symbolic_links)
60 install_dir[applets[i].location], applets[i].name); 60 install_dir[applets[i].location], applets[i].name);
61 rc = Link(busybox, fpc); 61 rc = Link(busybox, fpc);
62 if (rc!=0 && errno!=EEXIST) { 62 if (rc!=0 && errno!=EEXIST) {
63 perror_msg("%s", fpc); 63 bb_perror_msg("%s", fpc);
64 } 64 }
65 free(fpc); 65 free(fpc);
66 } 66 }
@@ -72,14 +72,14 @@ int main(int argc, char **argv)
72{ 72{
73 const char *s; 73 const char *s;
74 74
75 applet_name = argv[0]; 75 bb_applet_name = argv[0];
76 76
77 if (applet_name[0] == '-') 77 if (bb_applet_name[0] == '-')
78 applet_name++; 78 bb_applet_name++;
79 79
80 for (s = applet_name; *s != '\0';) { 80 for (s = bb_applet_name; *s != '\0';) {
81 if (*s++ == '/') 81 if (*s++ == '/')
82 applet_name = s; 82 bb_applet_name = s;
83 } 83 }
84 84
85#ifdef CONFIG_LOCALE_SUPPORT 85#ifdef CONFIG_LOCALE_SUPPORT
@@ -91,8 +91,8 @@ int main(int argc, char **argv)
91 } 91 }
92#endif 92#endif
93 93
94 run_applet_by_name(applet_name, argc, argv); 94 run_applet_by_name(bb_applet_name, argc, argv);
95 error_msg_and_die("applet not found"); 95 bb_error_msg_and_die("applet not found");
96} 96}
97 97
98 98
@@ -143,7 +143,7 @@ int busybox_main(int argc, char **argv)
143 "\tutilities into a single executable. Most people will create a\n" 143 "\tutilities into a single executable. Most people will create a\n"
144 "\tlink to busybox for each function they wish to use, and BusyBox\n" 144 "\tlink to busybox for each function they wish to use, and BusyBox\n"
145 "\twill act like whatever it was invoked as.\n" 145 "\twill act like whatever it was invoked as.\n"
146 "\nCurrently defined functions:\n", full_version); 146 "\nCurrently defined functions:\n", bb_msg_full_version);
147 147
148 while (a->name != 0) { 148 while (a->name != 0) {
149 col += 149 col +=