summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorManuel Novoa III2003-03-19 09:13:01 +0000
committerManuel Novoa III2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /applets
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip
busybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
Major coreutils update.
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 9f69da1..1b69ade 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -78,7 +78,7 @@ static struct BB_suid_config *suid_config;
-extern void show_usage(void)
+extern void bb_show_usage(void)
{
const char *format_string;
const char *usage_string = usage_messages;
@@ -93,7 +93,7 @@ extern void show_usage(void)
format_string = "%s\n\nUsage: %s %s\n\n";
if(*usage_string == '\b')
format_string = "%s\n\nNo help available.\n\n";
- fprintf(stderr, format_string, full_version, applet_using->name, usage_string);
+ fprintf(stderr, format_string, bb_msg_full_version, applet_using->name, usage_string);
exit(EXIT_FAILURE);
}
@@ -127,7 +127,7 @@ void run_applet_by_name(const char *name, int argc, char **argv)
recurse_level++;
/* Do a binary search to find the applet entry given the name. */
if ((applet_using = find_applet_by_name(name)) != NULL) {
- applet_name = applet_using->name;
+ bb_applet_name = applet_using->name;
if (argv[1] && strcmp(argv[1], "--help") == 0) {
if (strcmp(applet_using->name, "busybox")==0) {
if(argv[2])
@@ -136,7 +136,7 @@ void run_applet_by_name(const char *name, int argc, char **argv)
applet_using = NULL;
}
if(applet_using)
- show_usage();
+ bb_show_usage();
been_there_done_that=1;
busybox_main(0, NULL);
}
@@ -201,18 +201,18 @@ void check_suid ( struct BB_applet *applet )
m >>= 3;
if (!( m & S_IXOTH )) /* is x bit not set ? */
- error_msg_and_die ( "You have no permission to run this applet!" );
+ bb_error_msg_and_die ( "You have no permission to run this applet!" );
if (( sct-> m_mode & ( S_ISGID | S_IXGRP )) == ( S_ISGID | S_IXGRP )) { /* *both* have to be set for sgid */
if ( setegid ( sct-> m_gid ))
- error_msg_and_die ( "BusyBox binary has insufficient rights to set proper GID for applet!" );
+ bb_error_msg_and_die ( "BusyBox binary has insufficient rights to set proper GID for applet!" );
}
else
setgid ( rgid ); /* no sgid -> drop */
if ( sct-> m_mode & S_ISUID ) {
if ( seteuid ( sct-> m_uid ))
- error_msg_and_die ( "BusyBox binary has insufficient rights to set proper UID for applet!" );
+ bb_error_msg_and_die ( "BusyBox binary has insufficient rights to set proper UID for applet!" );
}
else
setuid ( ruid ); /* no suid -> drop */
@@ -237,7 +237,7 @@ void check_suid ( struct BB_applet *applet )
if ( applet-> need_suid == _BB_SUID_ALWAYS ) {
if ( geteuid ( ) != 0 )
- error_msg_and_die ( "This applet requires root priviledges!" );
+ bb_error_msg_and_die ( "This applet requires root priviledges!" );
}
else if ( applet-> need_suid == _BB_SUID_NEVER ) {
setgid ( rgid ); /* drop all priviledges */
@@ -280,7 +280,7 @@ int parse_config_file ( void )
p = strchr ( buffer, '#' );
if ( p )
*p = 0;
- p = buffer + xstrlen ( buffer );
+ p = buffer + bb_strlen ( buffer );
while (( p > buffer ) && isspace ( *--p ))
*p = 0;
diff --git a/applets/busybox.c b/applets/busybox.c
index 4f1ef26..457a85a 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -10,7 +10,7 @@
#endif
int been_there_done_that = 0; /* Also used in applets.c */
-const char *applet_name;
+const char *bb_applet_name;
#ifdef CONFIG_FEATURE_INSTALLER
/*
@@ -60,7 +60,7 @@ static void install_links(const char *busybox, int use_symbolic_links)
install_dir[applets[i].location], applets[i].name);
rc = Link(busybox, fpc);
if (rc!=0 && errno!=EEXIST) {
- perror_msg("%s", fpc);
+ bb_perror_msg("%s", fpc);
}
free(fpc);
}
@@ -72,14 +72,14 @@ int main(int argc, char **argv)
{
const char *s;
- applet_name = argv[0];
+ bb_applet_name = argv[0];
- if (applet_name[0] == '-')
- applet_name++;
+ if (bb_applet_name[0] == '-')
+ bb_applet_name++;
- for (s = applet_name; *s != '\0';) {
+ for (s = bb_applet_name; *s != '\0';) {
if (*s++ == '/')
- applet_name = s;
+ bb_applet_name = s;
}
#ifdef CONFIG_LOCALE_SUPPORT
@@ -91,8 +91,8 @@ int main(int argc, char **argv)
}
#endif
- run_applet_by_name(applet_name, argc, argv);
- error_msg_and_die("applet not found");
+ run_applet_by_name(bb_applet_name, argc, argv);
+ bb_error_msg_and_die("applet not found");
}
@@ -143,7 +143,7 @@ int busybox_main(int argc, char **argv)
"\tutilities into a single executable. Most people will create a\n"
"\tlink to busybox for each function they wish to use, and BusyBox\n"
"\twill act like whatever it was invoked as.\n"
- "\nCurrently defined functions:\n", full_version);
+ "\nCurrently defined functions:\n", bb_msg_full_version);
while (a->name != 0) {
col +=