aboutsummaryrefslogtreecommitdiff
path: root/applets/applets.c
diff options
context:
space:
mode:
Diffstat (limited to 'applets/applets.c')
-rw-r--r--applets/applets.c18
1 files changed, 9 insertions, 9 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