aboutsummaryrefslogtreecommitdiff
path: root/include/applets.src.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/applets.src.h')
-rw-r--r--include/applets.src.h51
1 files changed, 25 insertions, 26 deletions
diff --git a/include/applets.src.h b/include/applets.src.h
index 7dbd4c7f3..cb36628b5 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -8,7 +8,7 @@
8 8
9/* 9/*
10name - applet name as it is typed on command line 10name - applet name as it is typed on command line
11name2 - applet name, converted to C (ether-wake: name2 = ether_wake) 11help - applet name, converted to C (ether-wake: help = ether_wake)
12main - corresponding <applet>_main to call (bzcat: main = bunzip2) 12main - corresponding <applet>_main to call (bzcat: main = bunzip2)
13l - location to install link to: [/usr]/[s]bin 13l - location to install link to: [/usr]/[s]bin
14s - suid type: 14s - suid type:
@@ -24,46 +24,46 @@ s - suid type:
24 24
25#if defined(PROTOTYPES) 25#if defined(PROTOTYPES)
26# define APPLET(name,l,s) int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 26# define APPLET(name,l,s) int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
27# define APPLET_ODDNAME(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 27# define APPLET_ODDNAME(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
28# define APPLET_NOEXEC(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 28# define APPLET_NOEXEC(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
29# define APPLET_NOFORK(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 29# define APPLET_NOFORK(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
30 30
31#elif defined(NAME_MAIN_CNAME) 31#elif defined(NAME_MAIN)
32# define APPLET(name,l,s) name name##_main name 32# define APPLET(name,l,s) name name##_main
33# define APPLET_ODDNAME(name,main,l,s,name2) name main##_main name2 33# define APPLET_ODDNAME(name,main,l,s,help) name main##_main
34# define APPLET_NOEXEC(name,main,l,s,name2) name main##_main name2 34# define APPLET_NOEXEC(name,main,l,s,help) name main##_main
35# define APPLET_NOFORK(name,main,l,s,name2) name main##_main name2 35# define APPLET_NOFORK(name,main,l,s,help) name main##_main
36 36
37#elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE 37#elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE
38# define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage name##_full_usage) 38# define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage name##_full_usage)
39# define APPLET_ODDNAME(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage name2##_full_usage) 39# define APPLET_ODDNAME(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
40# define APPLET_NOEXEC(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage name2##_full_usage) 40# define APPLET_NOEXEC(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
41# define APPLET_NOFORK(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage name2##_full_usage) 41# define APPLET_NOFORK(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage)
42 42
43#elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE 43#elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE
44# define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage) 44# define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage)
45# define APPLET_ODDNAME(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage) 45# define APPLET_ODDNAME(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
46# define APPLET_NOEXEC(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage) 46# define APPLET_NOEXEC(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
47# define APPLET_NOFORK(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage) 47# define APPLET_NOFORK(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage)
48 48
49#elif defined(MAKE_LINKS) 49#elif defined(MAKE_LINKS)
50# define APPLET(name,l,c) LINK l name 50# define APPLET(name,l,c) LINK l name
51# define APPLET_ODDNAME(name,main,l,s,name2) LINK l name 51# define APPLET_ODDNAME(name,main,l,s,help) LINK l name
52# define APPLET_NOEXEC(name,main,l,s,name2) LINK l name 52# define APPLET_NOEXEC(name,main,l,s,help) LINK l name
53# define APPLET_NOFORK(name,main,l,s,name2) LINK l name 53# define APPLET_NOFORK(name,main,l,s,help) LINK l name
54 54
55#elif defined(MAKE_SUID) 55#elif defined(MAKE_SUID)
56# define APPLET(name,l,s) SUID s l name 56# define APPLET(name,l,s) SUID s l name
57# define APPLET_ODDNAME(name,main,l,s,name2) SUID s l name 57# define APPLET_ODDNAME(name,main,l,s,help) SUID s l name
58# define APPLET_NOEXEC(name,main,l,s,name2) SUID s l name 58# define APPLET_NOEXEC(name,main,l,s,help) SUID s l name
59# define APPLET_NOFORK(name,main,l,s,name2) SUID s l name 59# define APPLET_NOFORK(name,main,l,s,help) SUID s l name
60 60
61#else 61#else
62 static struct bb_applet applets[] = { /* name, main, location, need_suid */ 62 static struct bb_applet applets[] = { /* name, main, location, need_suid */
63# define APPLET(name,l,s) { #name, #name, l, s }, 63# define APPLET(name,l,s) { #name, #name, l, s },
64# define APPLET_ODDNAME(name,main,l,s,name2) { #name, #main, l, s }, 64# define APPLET_ODDNAME(name,main,l,s,help) { #name, #main, l, s },
65# define APPLET_NOEXEC(name,main,l,s,name2) { #name, #main, l, s, 1 }, 65# define APPLET_NOEXEC(name,main,l,s,help) { #name, #main, l, s, 1 },
66# define APPLET_NOFORK(name,main,l,s,name2) { #name, #main, l, s, 1, 1 }, 66# define APPLET_NOFORK(name,main,l,s,help) { #name, #main, l, s, 1, 1 },
67#endif 67#endif
68 68
69#if ENABLE_INSTALL_NO_USR 69#if ENABLE_INSTALL_NO_USR
@@ -104,7 +104,6 @@ IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum))
104IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) 104IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP))
105IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) 105IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP))
106IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) 106IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp))
107IF_CROND(APPLET(crond, BB_DIR_USR_SBIN, BB_SUID_DROP))
108/* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */ 107/* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */
109IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) 108IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
110IF_CRYPTPW(APPLET(cryptpw, BB_DIR_USR_BIN, BB_SUID_DROP)) 109IF_CRYPTPW(APPLET(cryptpw, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -391,7 +390,7 @@ IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
391IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) 390IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
392IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) 391IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP))
393 392
394#if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE) \ 393#if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \
395 && !defined(MAKE_LINKS) && !defined(MAKE_SUID) 394 && !defined(MAKE_LINKS) && !defined(MAKE_SUID)
396}; 395};
397#endif 396#endif