aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.src.h681
-rw-r--r--include/busybox.h20
-rw-r--r--include/libbb.h51
-rw-r--r--include/platform.h49
-rw-r--r--include/shadow_.h5
-rw-r--r--include/unicode.h4
-rw-r--r--include/usage.src.h51
7 files changed, 425 insertions, 436 deletions
diff --git a/include/applets.src.h b/include/applets.src.h
index 261ef2333..fa7d0cc55 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -12,12 +12,14 @@ name2 - applet name, converted to C (ether-wake: name2 = 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:
15 _BB_SUID_REQUIRE: will complain if busybox isn't suid 15 BB_SUID_REQUIRE: will complain if busybox isn't suid
16 and is run by non-root (applet_main() will not be called at all) 16 and is run by non-root (applet_main() will not be called at all)
17 _BB_SUID_DROP: will drop suid prior to applet_main() 17 BB_SUID_DROP: will drop suid prior to applet_main()
18 _BB_SUID_MAYBE: neither of the above 18 BB_SUID_MAYBE: neither of the above
19 (every instance of _BB_SUID_REQUIRE and _BB_SUID_MAYBE 19 (every instance of BB_SUID_REQUIRE and BB_SUID_MAYBE
20 needs to be justified in comment) 20 needs to be justified in comment)
21 NB: please update FEATURE_SUID help text whenever you add/remove
22 BB_SUID_REQUIRE or BB_SUID_MAYBE applet.
21*/ 23*/
22 24
23#if defined(PROTOTYPES) 25#if defined(PROTOTYPES)
@@ -59,366 +61,363 @@ s - suid type:
59#endif 61#endif
60 62
61#if ENABLE_INSTALL_NO_USR 63#if ENABLE_INSTALL_NO_USR
62# define _BB_DIR_USR_BIN _BB_DIR_BIN 64# define BB_DIR_USR_BIN BB_DIR_BIN
63# define _BB_DIR_USR_SBIN _BB_DIR_SBIN 65# define BB_DIR_USR_SBIN BB_DIR_SBIN
64#endif 66#endif
65 67
66 68
67INSERT 69INSERT
68IF_TEST(APPLET_NOFORK([, test, _BB_DIR_USR_BIN, _BB_SUID_DROP, test)) 70IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test))
69IF_TEST(APPLET_NOFORK([[, test, _BB_DIR_USR_BIN, _BB_SUID_DROP, test)) 71IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test))
70IF_ACPID(APPLET(acpid, _BB_DIR_SBIN, _BB_SUID_DROP)) 72IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP))
71IF_ADDGROUP(APPLET(addgroup, _BB_DIR_BIN, _BB_SUID_DROP)) 73IF_ADDGROUP(APPLET(addgroup, BB_DIR_BIN, BB_SUID_DROP))
72IF_ADDUSER(APPLET(adduser, _BB_DIR_BIN, _BB_SUID_DROP)) 74IF_ADDUSER(APPLET(adduser, BB_DIR_BIN, BB_SUID_DROP))
73IF_ADJTIMEX(APPLET(adjtimex, _BB_DIR_SBIN, _BB_SUID_DROP)) 75IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP))
74IF_AR(APPLET(ar, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 76IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP))
75IF_ARP(APPLET(arp, _BB_DIR_SBIN, _BB_SUID_DROP)) 77IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP))
76IF_ARPING(APPLET(arping, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 78IF_ARPING(APPLET(arping, BB_DIR_USR_BIN, BB_SUID_DROP))
77IF_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_DROP, awk)) 79IF_AWK(APPLET_NOEXEC(awk, awk, BB_DIR_USR_BIN, BB_SUID_DROP, awk))
78IF_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_DROP, basename)) 80IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename))
79IF_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_DROP)) 81IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP))
80IF_BEEP(APPLET(beep, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 82IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP))
81IF_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_DROP)) 83IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP))
82IF_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 84IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP))
83IF_BZIP2(APPLET(bzip2, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 85IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
84IF_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 86IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP))
85IF_CAT(APPLET_NOFORK(cat, cat, _BB_DIR_BIN, _BB_SUID_DROP, cat)) 87IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat))
86IF_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_DROP)) 88IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP))
87IF_CHAT(APPLET(chat, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 89IF_CHAT(APPLET(chat, BB_DIR_USR_BIN, BB_SUID_DROP))
88IF_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_DROP)) 90IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP))
89IF_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 91IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP))
90IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, _BB_DIR_BIN, _BB_SUID_DROP, chgrp)) 92IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp))
91IF_CHMOD(APPLET_NOEXEC(chmod, chmod, _BB_DIR_BIN, _BB_SUID_DROP, chmod)) 93IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod))
92IF_CHOWN(APPLET_NOEXEC(chown, chown, _BB_DIR_BIN, _BB_SUID_DROP, chown)) 94IF_CHOWN(APPLET_NOEXEC(chown, chown, BB_DIR_BIN, BB_SUID_DROP, chown))
93IF_CHPASSWD(APPLET(chpasswd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 95IF_CHPASSWD(APPLET(chpasswd, BB_DIR_USR_SBIN, BB_SUID_DROP))
94IF_CHPST(APPLET(chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 96IF_CHPST(APPLET(chpst, BB_DIR_USR_BIN, BB_SUID_DROP))
95IF_CHROOT(APPLET(chroot, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 97IF_CHROOT(APPLET(chroot, BB_DIR_USR_SBIN, BB_SUID_DROP))
96IF_CHRT(APPLET(chrt, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 98IF_CHRT(APPLET(chrt, BB_DIR_USR_BIN, BB_SUID_DROP))
97IF_CHVT(APPLET(chvt, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 99IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP))
98IF_CKSUM(APPLET_NOEXEC(cksum, cksum, _BB_DIR_USR_BIN, _BB_SUID_DROP, cksum)) 100IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum))
99IF_CLEAR(APPLET(clear, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 101IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP))
100IF_CMP(APPLET(cmp, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 102IF_CMP(APPLET(cmp, BB_DIR_USR_BIN, BB_SUID_DROP))
101IF_COMM(APPLET(comm, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 103IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP))
102IF_CP(APPLET_NOEXEC(cp, cp, _BB_DIR_BIN, _BB_SUID_DROP, cp)) 104IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp))
103IF_CPIO(APPLET(cpio, _BB_DIR_BIN, _BB_SUID_DROP)) 105IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP))
104IF_CROND(APPLET(crond, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 106IF_CROND(APPLET(crond, BB_DIR_USR_SBIN, BB_SUID_DROP))
105/* 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: */
106IF_CRONTAB(APPLET(crontab, _BB_DIR_USR_BIN, _BB_SUID_REQUIRE)) 108IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
107IF_CRYPTPW(APPLET(cryptpw, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 109IF_CRYPTPW(APPLET(cryptpw, BB_DIR_USR_BIN, BB_SUID_DROP))
108IF_CUT(APPLET_NOEXEC(cut, cut, _BB_DIR_USR_BIN, _BB_SUID_DROP, cut)) 110IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut))
109IF_DC(APPLET(dc, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 111IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP))
110IF_DD(APPLET_NOEXEC(dd, dd, _BB_DIR_BIN, _BB_SUID_DROP, dd)) 112IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd))
111IF_DEALLOCVT(APPLET(deallocvt, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 113IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP))
112IF_DELGROUP(APPLET_ODDNAME(delgroup, deluser, _BB_DIR_BIN, _BB_SUID_DROP, delgroup)) 114IF_DELGROUP(APPLET_ODDNAME(delgroup, deluser, BB_DIR_BIN, BB_SUID_DROP, delgroup))
113IF_DELUSER(APPLET(deluser, _BB_DIR_BIN, _BB_SUID_DROP)) 115IF_DELUSER(APPLET(deluser, BB_DIR_BIN, BB_SUID_DROP))
114IF_DEVFSD(APPLET(devfsd, _BB_DIR_SBIN, _BB_SUID_DROP)) 116IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP))
115IF_DEVMEM(APPLET(devmem, _BB_DIR_SBIN, _BB_SUID_DROP)) 117IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP))
116IF_DF(APPLET(df, _BB_DIR_BIN, _BB_SUID_DROP)) 118IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP))
117IF_DHCPRELAY(APPLET(dhcprelay, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 119IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP))
118IF_DIFF(APPLET(diff, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 120IF_DIFF(APPLET(diff, BB_DIR_USR_BIN, BB_SUID_DROP))
119IF_DIRNAME(APPLET_NOFORK(dirname, dirname, _BB_DIR_USR_BIN, _BB_SUID_DROP, dirname)) 121IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname))
120IF_DMESG(APPLET(dmesg, _BB_DIR_BIN, _BB_SUID_DROP)) 122IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP))
121/* Why _BB_SUID_REQUIRE? */ 123IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP))
122IF_DNSD(APPLET(dnsd, _BB_DIR_USR_SBIN, _BB_SUID_REQUIRE)) 124IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname))
123IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, _BB_DIR_BIN, _BB_SUID_DROP, dnsdomainname)) 125IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix))
124IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, _BB_DIR_USR_BIN, _BB_SUID_DROP, dos2unix)) 126IF_DPKG(APPLET(dpkg, BB_DIR_USR_BIN, BB_SUID_DROP))
125IF_DPKG(APPLET(dpkg, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 127IF_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, BB_DIR_USR_BIN, BB_SUID_DROP, dpkg_deb))
126IF_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, _BB_DIR_USR_BIN, _BB_SUID_DROP, dpkg_deb)) 128IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP))
127IF_DU(APPLET(du, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 129IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP))
128IF_DUMPKMAP(APPLET(dumpkmap, _BB_DIR_BIN, _BB_SUID_DROP)) 130IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP))
129IF_DUMPLEASES(APPLET(dumpleases, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 131//IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP))
130//IF_E2FSCK(APPLET(e2fsck, _BB_DIR_SBIN, _BB_SUID_DROP)) 132//IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label))
131//IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, _BB_DIR_SBIN, _BB_SUID_DROP, e2label)) 133IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo))
132IF_ECHO(APPLET_NOFORK(echo, echo, _BB_DIR_BIN, _BB_SUID_DROP, echo)) 134IF_ED(APPLET(ed, BB_DIR_BIN, BB_SUID_DROP))
133IF_ED(APPLET(ed, _BB_DIR_BIN, _BB_SUID_DROP)) 135IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP))
134IF_EJECT(APPLET(eject, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 136IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env))
135IF_ENV(APPLET_NOEXEC(env, env, _BB_DIR_USR_BIN, _BB_SUID_DROP, env)) 137IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir))
136IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP, envdir)) 138IF_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envuidgid))
137IF_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP, envuidgid)) 139IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_BIN, BB_SUID_DROP, ether_wake))
138IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, _BB_DIR_USR_BIN, _BB_SUID_DROP, ether_wake)) 140IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP))
139IF_EXPAND(APPLET(expand, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 141IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP))
140IF_EXPR(APPLET(expr, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 142IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP))
141IF_FAKEIDENTD(APPLET(fakeidentd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 143IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false))
142IF_FALSE(APPLET_NOFORK(false, false, _BB_DIR_BIN, _BB_SUID_DROP, false)) 144IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP))
143IF_FBSET(APPLET(fbset, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 145IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP))
144IF_FBSPLASH(APPLET(fbsplash, _BB_DIR_SBIN, _BB_SUID_DROP)) 146IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush))
145IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, _BB_DIR_BIN, _BB_SUID_DROP, fdflush)) 147IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_BIN, BB_SUID_DROP))
146IF_FDFORMAT(APPLET(fdformat, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 148IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP))
147IF_FDISK(APPLET(fdisk, _BB_DIR_SBIN, _BB_SUID_DROP)) 149IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP))
148IF_FGCONSOLE(APPLET(fgconsole, _BB_DIR_USR_BIN, _BB_SUID_DROP))
149/* Benefits from suid root: better access to /dev/BLOCKDEVs: */ 150/* Benefits from suid root: better access to /dev/BLOCKDEVs: */
150IF_FINDFS(APPLET(findfs, _BB_DIR_SBIN, _BB_SUID_MAYBE)) 151IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE))
151IF_FLASH_ERASEALL(APPLET(flash_eraseall, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 152IF_FLASH_ERASEALL(APPLET(flash_eraseall, BB_DIR_USR_SBIN, BB_SUID_DROP))
152IF_FLASH_LOCK(APPLET_ODDNAME(flash_lock, flash_lock_unlock, _BB_DIR_USR_SBIN, _BB_SUID_DROP, flash_lock)) 153IF_FLASH_LOCK(APPLET_ODDNAME(flash_lock, flash_lock_unlock, BB_DIR_USR_SBIN, BB_SUID_DROP, flash_lock))
153IF_FLASH_UNLOCK(APPLET_ODDNAME(flash_unlock, flash_lock_unlock, _BB_DIR_USR_SBIN, _BB_SUID_DROP, flash_unlock)) 154IF_FLASH_UNLOCK(APPLET_ODDNAME(flash_unlock, flash_lock_unlock, BB_DIR_USR_SBIN, BB_SUID_DROP, flash_unlock))
154IF_FLASHCP(APPLET(flashcp, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 155IF_FLASHCP(APPLET(flashcp, BB_DIR_USR_SBIN, BB_SUID_DROP))
155IF_FLOCK(APPLET(flock, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 156IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP))
156IF_FOLD(APPLET_NOEXEC(fold, fold, _BB_DIR_USR_BIN, _BB_SUID_DROP, fold)) 157IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold))
157IF_FREE(APPLET(free, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 158IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP))
158IF_FREERAMDISK(APPLET(freeramdisk, _BB_DIR_SBIN, _BB_SUID_DROP)) 159IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP))
159IF_FSCK(APPLET(fsck, _BB_DIR_SBIN, _BB_SUID_DROP)) 160IF_FSCK(APPLET(fsck, BB_DIR_SBIN, BB_SUID_DROP))
160//IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, _BB_DIR_SBIN, _BB_SUID_DROP, fsck_ext2)) 161//IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2))
161//IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, _BB_DIR_SBIN, _BB_SUID_DROP, fsck_ext3)) 162//IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3))
162IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, _BB_DIR_SBIN, _BB_SUID_DROP, fsck_minix)) 163IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix))
163IF_FSYNC(APPLET_NOFORK(fsync, fsync, _BB_DIR_BIN, _BB_SUID_DROP, fsync)) 164IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync))
164IF_FTPD(APPLET(ftpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 165IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
165IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_DROP, ftpget)) 166IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget))
166IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, _BB_DIR_USR_BIN, _BB_SUID_DROP, ftpput)) 167IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput))
167IF_FUSER(APPLET(fuser, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 168IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP))
168IF_GETENFORCE(APPLET(getenforce, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 169IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP))
169IF_GETOPT(APPLET(getopt, _BB_DIR_BIN, _BB_SUID_DROP)) 170IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP))
170IF_GETSEBOOL(APPLET(getsebool, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 171IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP))
171IF_GETTY(APPLET(getty, _BB_DIR_SBIN, _BB_SUID_DROP)) 172IF_GETTY(APPLET(getty, BB_DIR_SBIN, BB_SUID_DROP))
172IF_GUNZIP(APPLET(gunzip, _BB_DIR_BIN, _BB_SUID_DROP)) 173IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP))
173IF_GZIP(APPLET(gzip, _BB_DIR_BIN, _BB_SUID_DROP)) 174IF_GZIP(APPLET(gzip, BB_DIR_BIN, BB_SUID_DROP))
174IF_HD(APPLET_NOEXEC(hd, hexdump, _BB_DIR_USR_BIN, _BB_SUID_DROP, hd)) 175IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd))
175IF_HDPARM(APPLET(hdparm, _BB_DIR_SBIN, _BB_SUID_DROP)) 176IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP))
176IF_HEAD(APPLET_NOEXEC(head, head, _BB_DIR_USR_BIN, _BB_SUID_DROP, head)) 177IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head))
177IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, _BB_DIR_USR_BIN, _BB_SUID_DROP, hexdump)) 178IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump))
178IF_HOSTID(APPLET_NOFORK(hostid, hostid, _BB_DIR_USR_BIN, _BB_SUID_DROP, hostid)) 179IF_HOSTID(APPLET_NOFORK(hostid, hostid, BB_DIR_USR_BIN, BB_SUID_DROP, hostid))
179IF_HOSTNAME(APPLET(hostname, _BB_DIR_BIN, _BB_SUID_DROP)) 180IF_HOSTNAME(APPLET(hostname, BB_DIR_BIN, BB_SUID_DROP))
180IF_HTTPD(APPLET(httpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 181IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
181IF_HWCLOCK(APPLET(hwclock, _BB_DIR_SBIN, _BB_SUID_DROP)) 182IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP))
182IF_ID(APPLET_NOEXEC(id, id, _BB_DIR_USR_BIN, _BB_SUID_DROP, id)) 183IF_ID(APPLET_NOEXEC(id, id, BB_DIR_USR_BIN, BB_SUID_DROP, id))
183IF_IFCONFIG(APPLET(ifconfig, _BB_DIR_SBIN, _BB_SUID_DROP)) 184IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP))
184IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, _BB_DIR_SBIN, _BB_SUID_DROP, ifdown)) 185IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown))
185IF_IFENSLAVE(APPLET(ifenslave, _BB_DIR_SBIN, _BB_SUID_DROP)) 186IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP))
186IF_IFPLUGD(APPLET(ifplugd, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 187IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_BIN, BB_SUID_DROP))
187IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, _BB_DIR_SBIN, _BB_SUID_DROP, ifup)) 188IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup))
188IF_INETD(APPLET(inetd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 189IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP))
189IF_INOTIFYD(APPLET(inotifyd, _BB_DIR_SBIN, _BB_SUID_DROP)) 190IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP))
190IF_INSTALL(APPLET(install, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 191IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP))
191IF_IONICE(APPLET(ionice, _BB_DIR_BIN, _BB_SUID_DROP)) 192IF_IONICE(APPLET(ionice, BB_DIR_BIN, BB_SUID_DROP))
192#if ENABLE_FEATURE_IP_ADDRESS \ 193#if ENABLE_FEATURE_IP_ADDRESS \
193 || ENABLE_FEATURE_IP_ROUTE \ 194 || ENABLE_FEATURE_IP_ROUTE \
194 || ENABLE_FEATURE_IP_LINK \ 195 || ENABLE_FEATURE_IP_LINK \
195 || ENABLE_FEATURE_IP_TUNNEL \ 196 || ENABLE_FEATURE_IP_TUNNEL \
196 || ENABLE_FEATURE_IP_RULE 197 || ENABLE_FEATURE_IP_RULE
197IF_IP(APPLET(ip, _BB_DIR_BIN, _BB_SUID_DROP)) 198IF_IP(APPLET(ip, BB_DIR_BIN, BB_SUID_DROP))
198#endif 199#endif
199IF_IPADDR(APPLET(ipaddr, _BB_DIR_BIN, _BB_SUID_DROP)) 200IF_IPADDR(APPLET(ipaddr, BB_DIR_BIN, BB_SUID_DROP))
200IF_IPCALC(APPLET(ipcalc, _BB_DIR_BIN, _BB_SUID_DROP)) 201IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP))
201/* Why _BB_SUID_REQUIRE? On Fedora, it isn't suid root */ 202IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP))
202IF_IPCRM(APPLET(ipcrm, _BB_DIR_USR_BIN, _BB_SUID_REQUIRE)) 203IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP))
203/* Why _BB_SUID_REQUIRE? On Fedora, it isn't suid root */ 204IF_IPLINK(APPLET(iplink, BB_DIR_BIN, BB_SUID_DROP))
204IF_IPCS(APPLET(ipcs, _BB_DIR_USR_BIN, _BB_SUID_REQUIRE)) 205IF_IPROUTE(APPLET(iproute, BB_DIR_BIN, BB_SUID_DROP))
205IF_IPLINK(APPLET(iplink, _BB_DIR_BIN, _BB_SUID_DROP)) 206IF_IPRULE(APPLET(iprule, BB_DIR_BIN, BB_SUID_DROP))
206IF_IPROUTE(APPLET(iproute, _BB_DIR_BIN, _BB_SUID_DROP)) 207IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_BIN, BB_SUID_DROP))
207IF_IPRULE(APPLET(iprule, _BB_DIR_BIN, _BB_SUID_DROP)) 208IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_USR_BIN, BB_SUID_DROP))
208IF_IPTUNNEL(APPLET(iptunnel, _BB_DIR_BIN, _BB_SUID_DROP)) 209IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP))
209IF_KBD_MODE(APPLET(kbd_mode, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 210IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall))
210IF_KILL(APPLET(kill, _BB_DIR_BIN, _BB_SUID_DROP)) 211IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall5))
211IF_KILLALL(APPLET_ODDNAME(killall, kill, _BB_DIR_USR_BIN, _BB_SUID_DROP, killall)) 212IF_KLOGD(APPLET(klogd, BB_DIR_SBIN, BB_SUID_DROP))
212IF_KILLALL5(APPLET_ODDNAME(killall5, kill, _BB_DIR_USR_BIN, _BB_SUID_DROP, killall5)) 213IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP))
213IF_KLOGD(APPLET(klogd, _BB_DIR_SBIN, _BB_SUID_DROP)) 214IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length))
214IF_LAST(APPLET(last, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 215IF_LESS(APPLET(less, BB_DIR_USR_BIN, BB_SUID_DROP))
215IF_LENGTH(APPLET_NOFORK(length, length, _BB_DIR_USR_BIN, _BB_SUID_DROP, length)) 216IF_SETARCH(APPLET_ODDNAME(linux32, setarch, BB_DIR_BIN, BB_SUID_DROP, linux32))
216IF_LESS(APPLET(less, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 217IF_SETARCH(APPLET_ODDNAME(linux64, setarch, BB_DIR_BIN, BB_SUID_DROP, linux64))
217IF_SETARCH(APPLET_ODDNAME(linux32, setarch, _BB_DIR_BIN, _BB_SUID_DROP, linux32)) 218IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln))
218IF_SETARCH(APPLET_ODDNAME(linux64, setarch, _BB_DIR_BIN, _BB_SUID_DROP, linux64)) 219IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP))
219IF_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN, _BB_SUID_DROP, ln)) 220IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
220IF_LOAD_POLICY(APPLET(load_policy, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 221IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP))
221IF_LOADFONT(APPLET(loadfont, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 222IF_LOGGER(APPLET(logger, BB_DIR_USR_BIN, BB_SUID_DROP))
222IF_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_DROP))
223IF_LOGGER(APPLET(logger, _BB_DIR_USR_BIN, _BB_SUID_DROP))
224/* Needs to be run by root or be suid root - needs to change uid and gid: */ 223/* Needs to be run by root or be suid root - needs to change uid and gid: */
225IF_LOGIN(APPLET(login, _BB_DIR_BIN, _BB_SUID_REQUIRE)) 224IF_LOGIN(APPLET(login, BB_DIR_BIN, BB_SUID_REQUIRE))
226IF_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_DROP, logname)) 225IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname))
227IF_LOGREAD(APPLET(logread, _BB_DIR_SBIN, _BB_SUID_DROP)) 226IF_LOGREAD(APPLET(logread, BB_DIR_SBIN, BB_SUID_DROP))
228IF_LOSETUP(APPLET(losetup, _BB_DIR_SBIN, _BB_SUID_DROP)) 227IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP))
229IF_LPD(APPLET(lpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 228IF_LPD(APPLET(lpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
230IF_LPQ(APPLET_ODDNAME(lpq, lpqr, _BB_DIR_USR_BIN, _BB_SUID_DROP, lpq)) 229IF_LPQ(APPLET_ODDNAME(lpq, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpq))
231IF_LPR(APPLET_ODDNAME(lpr, lpqr, _BB_DIR_USR_BIN, _BB_SUID_DROP, lpr)) 230IF_LPR(APPLET_ODDNAME(lpr, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpr))
232IF_LS(APPLET_NOEXEC(ls, ls, _BB_DIR_BIN, _BB_SUID_DROP, ls)) 231IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls))
233IF_LSATTR(APPLET(lsattr, _BB_DIR_BIN, _BB_SUID_DROP)) 232IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP))
234IF_LSPCI(APPLET(lspci, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 233IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP))
235IF_LSUSB(APPLET(lsusb, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 234IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP))
236IF_UNLZMA(APPLET_ODDNAME(lzcat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzcat)) 235IF_UNLZMA(APPLET_ODDNAME(lzcat, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzcat))
237IF_LZMA(APPLET_ODDNAME(lzma, unlzma, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzma)) 236IF_LZMA(APPLET_ODDNAME(lzma, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzma))
238IF_LZOP(APPLET(lzop, _BB_DIR_BIN, _BB_SUID_DROP)) 237IF_LZOP(APPLET(lzop, BB_DIR_BIN, BB_SUID_DROP))
239IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, _BB_DIR_USR_BIN, _BB_SUID_DROP, lzopcat)) 238IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, lzopcat))
240IF_MAKEDEVS(APPLET(makedevs, _BB_DIR_SBIN, _BB_SUID_DROP)) 239IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP))
241IF_MAKEMIME(APPLET(makemime, _BB_DIR_BIN, _BB_SUID_DROP)) 240IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP))
242IF_MAN(APPLET(man, _BB_DIR_SBIN, _BB_SUID_DROP)) 241IF_MAN(APPLET(man, BB_DIR_SBIN, BB_SUID_DROP))
243IF_MATCHPATHCON(APPLET(matchpathcon, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 242IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP))
244IF_MD5SUM(APPLET_NOEXEC(md5sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, md5sum)) 243IF_MD5SUM(APPLET_NOEXEC(md5sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, md5sum))
245IF_MDEV(APPLET(mdev, _BB_DIR_SBIN, _BB_SUID_DROP)) 244IF_MDEV(APPLET(mdev, BB_DIR_SBIN, BB_SUID_DROP))
246IF_MICROCOM(APPLET(microcom, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 245IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP))
247IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, _BB_DIR_BIN, _BB_SUID_DROP, mkdir)) 246IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir))
248IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_vfat)) 247IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat))
249IF_MKFS_EXT2(APPLET_ODDNAME(mke2fs, mkfs_ext2, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_ext2)) 248IF_MKFS_EXT2(APPLET_ODDNAME(mke2fs, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2))
250IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, _BB_DIR_USR_BIN, _BB_SUID_DROP, mkfifo)) 249IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo))
251IF_MKFS_EXT2(APPLET_ODDNAME(mkfs.ext2, mkfs_ext2, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_ext2)) 250IF_MKFS_EXT2(APPLET_ODDNAME(mkfs.ext2, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2))
252//IF_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_ext3)) 251//IF_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext3))
253IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_minix)) 252IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix))
254IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_reiser)) 253IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser))
255IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, _BB_DIR_SBIN, _BB_SUID_DROP, mkfs_vfat)) 254IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat))
256IF_MKNOD(APPLET_NOEXEC(mknod, mknod, _BB_DIR_BIN, _BB_SUID_DROP, mknod)) 255IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod))
257IF_CRYPTPW(APPLET_ODDNAME(mkpasswd, cryptpw, _BB_DIR_USR_BIN, _BB_SUID_DROP, mkpasswd)) 256IF_CRYPTPW(APPLET_ODDNAME(mkpasswd, cryptpw, BB_DIR_USR_BIN, BB_SUID_DROP, mkpasswd))
258IF_MKSWAP(APPLET(mkswap, _BB_DIR_SBIN, _BB_SUID_DROP)) 257IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP))
259IF_MKTEMP(APPLET(mktemp, _BB_DIR_BIN, _BB_SUID_DROP)) 258IF_MKTEMP(APPLET(mktemp, BB_DIR_BIN, BB_SUID_DROP))
260IF_MORE(APPLET(more, _BB_DIR_BIN, _BB_SUID_DROP)) 259IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP))
261/* On full-blown systems, requires suid for user mounts. 260/* On full-blown systems, requires suid for user mounts.
262 * But it's not unthinkable to have it available in non-suid flavor on some systems, 261 * But it's not unthinkable to have it available in non-suid flavor on some systems,
263 * for viewing mount table. 262 * for viewing mount table.
264 * Therefore we use _BB_SUID_MAYBE instead of _BB_SUID_REQUIRE: */ 263 * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */
265IF_MOUNT(APPLET(mount, _BB_DIR_BIN, IF_DESKTOP(_BB_SUID_MAYBE) IF_NOT_DESKTOP(_BB_SUID_DROP))) 264IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP)))
266IF_MOUNTPOINT(APPLET(mountpoint, _BB_DIR_BIN, _BB_SUID_DROP)) 265IF_MOUNTPOINT(APPLET(mountpoint, BB_DIR_BIN, BB_SUID_DROP))
267IF_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_DROP)) 266IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DROP))
268IF_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_DROP)) 267IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP))
269IF_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_DROP)) 268IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP))
270IF_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 269IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP))
271IF_NETSTAT(APPLET(netstat, _BB_DIR_BIN, _BB_SUID_DROP)) 270IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP))
272IF_NICE(APPLET(nice, _BB_DIR_BIN, _BB_SUID_DROP)) 271IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP))
273IF_NOHUP(APPLET(nohup, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 272IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP))
274IF_NSLOOKUP(APPLET(nslookup, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 273IF_NSLOOKUP(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP))
275IF_NTPD(APPLET(ntpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 274IF_NTPD(APPLET(ntpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
276IF_OD(APPLET(od, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 275IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP))
277IF_OPENVT(APPLET(openvt, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 276IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP))
278//IF_PARSE(APPLET(parse, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 277//IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP))
279/* Needs to be run by root or be suid root - needs to change /etc/{passwd,shadow}: */ 278/* Needs to be run by root or be suid root - needs to change /etc/{passwd,shadow}: */
280IF_PASSWD(APPLET(passwd, _BB_DIR_USR_BIN, _BB_SUID_REQUIRE)) 279IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
281IF_PGREP(APPLET(pgrep, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 280IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP))
282IF_PIDOF(APPLET(pidof, _BB_DIR_BIN, _BB_SUID_DROP)) 281IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP))
283IF_PIPE_PROGRESS(APPLET(pipe_progress, _BB_DIR_BIN, _BB_SUID_DROP)) 282IF_PIPE_PROGRESS(APPLET(pipe_progress, BB_DIR_BIN, BB_SUID_DROP))
284IF_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_DROP)) 283IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP))
285IF_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_DROP, pkill)) 284IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill))
286IF_POPMAILDIR(APPLET(popmaildir, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 285IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP))
287IF_PRINTENV(APPLET_NOFORK(printenv, printenv, _BB_DIR_BIN, _BB_SUID_DROP, printenv)) 286IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv))
288IF_PRINTF(APPLET_NOFORK(printf, printf, _BB_DIR_USR_BIN, _BB_SUID_DROP, printf)) 287IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf))
289IF_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_DROP)) 288IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP))
290IF_PSCAN(APPLET(pscan, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 289IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP))
291IF_PWD(APPLET_NOFORK(pwd, pwd, _BB_DIR_BIN, _BB_SUID_DROP, pwd)) 290IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd))
292IF_RAIDAUTORUN(APPLET(raidautorun, _BB_DIR_SBIN, _BB_SUID_DROP)) 291IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP))
293IF_RDATE(APPLET(rdate, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 292IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP))
294IF_RDEV(APPLET(rdev, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 293IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP))
295IF_READAHEAD(APPLET(readahead, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 294IF_READAHEAD(APPLET(readahead, BB_DIR_USR_BIN, BB_SUID_DROP))
296IF_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 295IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP))
297IF_READPROFILE(APPLET(readprofile, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 296IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP))
298IF_REALPATH(APPLET(realpath, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 297IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP))
299IF_REFORMIME(APPLET(reformime, _BB_DIR_BIN, _BB_SUID_DROP)) 298IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP))
300IF_RENICE(APPLET(renice, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 299IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP))
301IF_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 300IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP))
302IF_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 301IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP))
303IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, _BB_DIR_SBIN, _BB_SUID_DROP, restorecon)) 302IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon))
304IF_RFKILL(APPLET(rfkill, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 303IF_RFKILL(APPLET(rfkill, BB_DIR_USR_SBIN, BB_SUID_DROP))
305IF_RM(APPLET_NOFORK(rm, rm, _BB_DIR_BIN, _BB_SUID_DROP, rm)) 304IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm))
306IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, _BB_DIR_BIN, _BB_SUID_DROP, rmdir)) 305IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir))
307IF_ROUTE(APPLET(route, _BB_DIR_SBIN, _BB_SUID_DROP)) 306IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP))
308IF_RPM(APPLET(rpm, _BB_DIR_BIN, _BB_SUID_DROP)) 307IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP))
309IF_RPM2CPIO(APPLET(rpm2cpio, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 308IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
310IF_RTCWAKE(APPLET(rtcwake, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 309IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_BIN, BB_SUID_DROP))
311IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, _BB_DIR_BIN, _BB_SUID_DROP, run_parts)) 310IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts))
312IF_RUNCON(APPLET(runcon, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 311IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP))
313IF_RUNLEVEL(APPLET(runlevel, _BB_DIR_SBIN, _BB_SUID_DROP)) 312IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP))
314IF_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 313IF_RUNSV(APPLET(runsv, BB_DIR_USR_BIN, BB_SUID_DROP))
315IF_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 314IF_RUNSVDIR(APPLET(runsvdir, BB_DIR_USR_BIN, BB_SUID_DROP))
316IF_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 315IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP))
317IF_SCRIPT(APPLET(script, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 316IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP))
318IF_SCRIPTREPLAY(APPLET(scriptreplay, _BB_DIR_BIN, _BB_SUID_DROP)) 317IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP))
319IF_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_DROP)) 318IF_SED(APPLET(sed, BB_DIR_BIN, BB_SUID_DROP))
320IF_SELINUXENABLED(APPLET(selinuxenabled, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 319IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP))
321IF_SENDMAIL(APPLET(sendmail, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 320IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP))
322IF_SEQ(APPLET_NOFORK(seq, seq, _BB_DIR_USR_BIN, _BB_SUID_DROP, seq)) 321IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq))
323IF_SESTATUS(APPLET(sestatus, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 322IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP))
324IF_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_DROP)) 323IF_SETARCH(APPLET(setarch, BB_DIR_BIN, BB_SUID_DROP))
325IF_SETCONSOLE(APPLET(setconsole, _BB_DIR_SBIN, _BB_SUID_DROP)) 324IF_SETCONSOLE(APPLET(setconsole, BB_DIR_SBIN, BB_SUID_DROP))
326IF_SETENFORCE(APPLET(setenforce, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 325IF_SETENFORCE(APPLET(setenforce, BB_DIR_USR_SBIN, BB_SUID_DROP))
327IF_SETFILES(APPLET(setfiles, _BB_DIR_SBIN, _BB_SUID_DROP)) 326IF_SETFILES(APPLET(setfiles, BB_DIR_SBIN, BB_SUID_DROP))
328IF_SETFONT(APPLET(setfont, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 327IF_SETFONT(APPLET(setfont, BB_DIR_USR_SBIN, BB_SUID_DROP))
329IF_SETKEYCODES(APPLET(setkeycodes, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 328IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP))
330IF_SETLOGCONS(APPLET(setlogcons, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 329IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP))
331IF_SETSEBOOL(APPLET(setsebool, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 330IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP))
332IF_SETSID(APPLET(setsid, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 331IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP))
333IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP, setuidgid)) 332IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid))
334IF_SHA1SUM(APPLET_NOEXEC(sha1sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha1sum)) 333IF_SHA1SUM(APPLET_NOEXEC(sha1sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha1sum))
335IF_SHA256SUM(APPLET_NOEXEC(sha256sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha256sum)) 334IF_SHA256SUM(APPLET_NOEXEC(sha256sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha256sum))
336IF_SHA512SUM(APPLET_NOEXEC(sha512sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_DROP, sha512sum)) 335IF_SHA512SUM(APPLET_NOEXEC(sha512sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha512sum))
337IF_SHOWKEY(APPLET(showkey, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 336IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP))
338IF_SLATTACH(APPLET(slattach, _BB_DIR_SBIN, _BB_SUID_DROP)) 337IF_SLATTACH(APPLET(slattach, BB_DIR_SBIN, BB_SUID_DROP))
339/* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells: */ 338/* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells: */
340IF_SLEEP(APPLET(sleep, _BB_DIR_BIN, _BB_SUID_DROP)) 339IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP))
341IF_SOFTLIMIT(APPLET_ODDNAME(softlimit, chpst, _BB_DIR_USR_BIN, _BB_SUID_DROP, softlimit)) 340IF_SOFTLIMIT(APPLET_ODDNAME(softlimit, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, softlimit))
342IF_SORT(APPLET_NOEXEC(sort, sort, _BB_DIR_USR_BIN, _BB_SUID_DROP, sort)) 341IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort))
343IF_SPLIT(APPLET(split, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 342IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP))
344IF_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, _BB_DIR_SBIN, _BB_SUID_DROP, start_stop_daemon)) 343IF_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, BB_DIR_SBIN, BB_SUID_DROP, start_stop_daemon))
345IF_STAT(APPLET(stat, _BB_DIR_BIN, _BB_SUID_DROP)) 344IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP))
346IF_STRINGS(APPLET(strings, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 345IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP))
347IF_STTY(APPLET(stty, _BB_DIR_BIN, _BB_SUID_DROP)) 346IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP))
348/* Needs to be run by root or be suid root - needs to change uid and gid: */ 347/* Needs to be run by root or be suid root - needs to change uid and gid: */
349IF_SU(APPLET(su, _BB_DIR_BIN, _BB_SUID_REQUIRE)) 348IF_SU(APPLET(su, BB_DIR_BIN, BB_SUID_REQUIRE))
350IF_SULOGIN(APPLET(sulogin, _BB_DIR_SBIN, _BB_SUID_DROP)) 349IF_SULOGIN(APPLET(sulogin, BB_DIR_SBIN, BB_SUID_DROP))
351IF_SUM(APPLET(sum, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 350IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP))
352IF_SV(APPLET(sv, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 351IF_SV(APPLET(sv, BB_DIR_USR_BIN, BB_SUID_DROP))
353IF_SVLOGD(APPLET(svlogd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 352IF_SVLOGD(APPLET(svlogd, BB_DIR_USR_SBIN, BB_SUID_DROP))
354IF_SWAPONOFF(APPLET_ODDNAME(swapoff, swap_on_off, _BB_DIR_SBIN, _BB_SUID_DROP, swapoff)) 353IF_SWAPONOFF(APPLET_ODDNAME(swapoff, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapoff))
355IF_SWAPONOFF(APPLET_ODDNAME(swapon, swap_on_off, _BB_DIR_SBIN, _BB_SUID_DROP, swapon)) 354IF_SWAPONOFF(APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon))
356IF_SWITCH_ROOT(APPLET(switch_root, _BB_DIR_SBIN, _BB_SUID_DROP)) 355IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP))
357IF_SYNC(APPLET_NOFORK(sync, sync, _BB_DIR_BIN, _BB_SUID_DROP, sync)) 356IF_SYNC(APPLET_NOFORK(sync, sync, BB_DIR_BIN, BB_SUID_DROP, sync))
358IF_BB_SYSCTL(APPLET(sysctl, _BB_DIR_SBIN, _BB_SUID_DROP)) 357IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP))
359IF_SYSLOGD(APPLET(syslogd, _BB_DIR_SBIN, _BB_SUID_DROP)) 358IF_SYSLOGD(APPLET(syslogd, BB_DIR_SBIN, BB_SUID_DROP))
360IF_TAC(APPLET_NOEXEC(tac, tac, _BB_DIR_USR_BIN, _BB_SUID_DROP, tac)) 359IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac))
361IF_TAIL(APPLET(tail, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 360IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP))
362IF_TAR(APPLET(tar, _BB_DIR_BIN, _BB_SUID_DROP)) 361IF_TAR(APPLET(tar, BB_DIR_BIN, BB_SUID_DROP))
363IF_TASKSET(APPLET(taskset, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 362IF_TASKSET(APPLET(taskset, BB_DIR_USR_BIN, BB_SUID_DROP))
364/* IF_TC(APPLET(tc, _BB_DIR_SBIN, _BB_SUID_DROP)) */ 363/* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */
365IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_DROP, tcpsvd)) 364IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd))
366IF_TEE(APPLET(tee, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 365IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP))
367IF_TELNET(APPLET(telnet, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 366IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP))
368IF_TELNETD(APPLET(telnetd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 367IF_TELNETD(APPLET(telnetd, BB_DIR_USR_SBIN, BB_SUID_DROP))
369IF_TEST(APPLET_NOFORK(test, test, _BB_DIR_USR_BIN, _BB_SUID_DROP, test)) 368IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test))
370#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT 369#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
371IF_TFTP(APPLET(tftp, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 370IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP))
372IF_TFTPD(APPLET(tftpd, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 371IF_TFTPD(APPLET(tftpd, BB_DIR_USR_BIN, BB_SUID_DROP))
373#endif 372#endif
374IF_TIME(APPLET(time, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 373IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP))
375IF_TIMEOUT(APPLET(timeout, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 374IF_TIMEOUT(APPLET(timeout, BB_DIR_USR_BIN, BB_SUID_DROP))
376IF_TOP(APPLET(top, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 375IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP))
377IF_TR(APPLET(tr, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 376IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP))
378/* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore _BB_SUID_MAYBE: */ 377/* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */
379IF_TRACEROUTE(APPLET(traceroute, _BB_DIR_USR_BIN, _BB_SUID_MAYBE)) 378IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE))
380IF_TRACEROUTE6(APPLET(traceroute6, _BB_DIR_USR_BIN, _BB_SUID_MAYBE)) 379IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE))
381IF_TRUE(APPLET_NOFORK(true, true, _BB_DIR_BIN, _BB_SUID_DROP, true)) 380IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true))
382IF_TTY(APPLET(tty, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 381IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP))
383IF_TTYSIZE(APPLET(ttysize, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 382IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP))
384IF_TUNCTL(APPLET(tunctl, _BB_DIR_SBIN, _BB_SUID_DROP)) 383IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP))
385IF_TUNE2FS(APPLET(tune2fs, _BB_DIR_SBIN, _BB_SUID_DROP)) 384IF_TUNE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP))
386IF_UDHCPC(APPLET(udhcpc, _BB_DIR_SBIN, _BB_SUID_DROP)) 385IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP))
387IF_UDHCPD(APPLET(udhcpd, _BB_DIR_USR_SBIN, _BB_SUID_DROP)) 386IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
388IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_DROP, udpsvd)) 387IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd))
389IF_UMOUNT(APPLET(umount, _BB_DIR_BIN, _BB_SUID_DROP)) 388IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP))
390IF_UNAME(APPLET(uname, _BB_DIR_BIN, _BB_SUID_DROP)) 389IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP))
391IF_UNCOMPRESS(APPLET(uncompress, _BB_DIR_BIN, _BB_SUID_DROP)) 390IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP))
392IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, _BB_DIR_USR_BIN, _BB_SUID_DROP, unexpand)) 391IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand))
393IF_UNIQ(APPLET(uniq, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 392IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP))
394IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, _BB_DIR_USR_BIN, _BB_SUID_DROP, unix2dos)) 393IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos))
395IF_UNXZ(APPLET(unxz, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 394IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP))
396IF_UNLZMA(APPLET(unlzma, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 395IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP))
397IF_LZOP(APPLET_ODDNAME(unlzop, lzop, _BB_DIR_USR_BIN, _BB_SUID_DROP, unlzop)) 396IF_LZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop))
398IF_UNZIP(APPLET(unzip, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 397IF_UNZIP(APPLET(unzip, BB_DIR_USR_BIN, BB_SUID_DROP))
399IF_UPTIME(APPLET(uptime, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 398IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP))
400IF_USLEEP(APPLET_NOFORK(usleep, usleep, _BB_DIR_BIN, _BB_SUID_DROP, usleep)) 399IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep))
401IF_UUDECODE(APPLET(uudecode, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 400IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP))
402IF_UUENCODE(APPLET(uuencode, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 401IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP))
403IF_VCONFIG(APPLET(vconfig, _BB_DIR_SBIN, _BB_SUID_DROP)) 402IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP))
404IF_VI(APPLET(vi, _BB_DIR_BIN, _BB_SUID_DROP)) 403IF_VI(APPLET(vi, BB_DIR_BIN, BB_SUID_DROP))
405/* Needs to be run by root or be suid root - needs to change uid and gid: */ 404/* Needs to be run by root or be suid root - needs to change uid and gid: */
406IF_VLOCK(APPLET(vlock, _BB_DIR_USR_BIN, _BB_SUID_REQUIRE)) 405IF_VLOCK(APPLET(vlock, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
407IF_VOLNAME(APPLET(volname, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 406IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP))
408/* Needs to be run by root or be suid root - needs to write to /dev/TTY: */ 407/* Needs to be run by root or be suid root - needs to write to /dev/TTY: */
409IF_WALL(APPLET(wall, _BB_DIR_USR_BIN, _BB_SUID_REQUIRE)) 408IF_WALL(APPLET(wall, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
410IF_WATCH(APPLET(watch, _BB_DIR_BIN, _BB_SUID_DROP)) 409IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP))
411IF_WATCHDOG(APPLET(watchdog, _BB_DIR_SBIN, _BB_SUID_DROP)) 410IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP))
412IF_WC(APPLET(wc, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 411IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP))
413IF_WGET(APPLET(wget, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 412IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP))
414IF_WHICH(APPLET(which, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 413IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP))
415IF_WHO(APPLET(who, _BB_DIR_USR_BIN, _BB_SUID_DROP)) 414IF_WHO(APPLET(who, BB_DIR_USR_BIN, BB_SUID_DROP))
416IF_WHOAMI(APPLET_NOFORK(whoami, whoami, _BB_DIR_USR_BIN, _BB_SUID_DROP, whoami)) 415IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
417IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, _BB_DIR_USR_BIN, _BB_SUID_DROP, xzcat)) 416IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat))
418IF_XZ(APPLET_ODDNAME(xz, unxz, _BB_DIR_USR_BIN, _BB_SUID_DROP, xz)) 417IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz))
419IF_YES(APPLET_NOFORK(yes, yes, _BB_DIR_USR_BIN, _BB_SUID_DROP, yes)) 418IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
420IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, _BB_DIR_BIN, _BB_SUID_DROP, zcat)) 419IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat))
421IF_ZCIP(APPLET(zcip, _BB_DIR_SBIN, _BB_SUID_DROP)) 420IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP))
422 421
423#if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE) 422#if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE)
424}; 423};
diff --git a/include/busybox.h b/include/busybox.h
index 757317fc7..be06817e3 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -13,22 +13,22 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
13 13
14/* order matters: used as index into "install_dir[]" in appletlib.c */ 14/* order matters: used as index into "install_dir[]" in appletlib.c */
15typedef enum bb_install_loc_t { 15typedef enum bb_install_loc_t {
16 _BB_DIR_ROOT = 0, 16 BB_DIR_ROOT = 0,
17 _BB_DIR_BIN, 17 BB_DIR_BIN,
18 _BB_DIR_SBIN, 18 BB_DIR_SBIN,
19#if ENABLE_INSTALL_NO_USR 19#if ENABLE_INSTALL_NO_USR
20 _BB_DIR_USR_BIN = _BB_DIR_BIN, 20 BB_DIR_USR_BIN = BB_DIR_BIN,
21 _BB_DIR_USR_SBIN = _BB_DIR_SBIN, 21 BB_DIR_USR_SBIN = BB_DIR_SBIN,
22#else 22#else
23 _BB_DIR_USR_BIN, 23 BB_DIR_USR_BIN,
24 _BB_DIR_USR_SBIN, 24 BB_DIR_USR_SBIN,
25#endif 25#endif
26} bb_install_loc_t; 26} bb_install_loc_t;
27 27
28typedef enum bb_suid_t { 28typedef enum bb_suid_t {
29 _BB_SUID_DROP = 0, 29 BB_SUID_DROP = 0,
30 _BB_SUID_MAYBE, 30 BB_SUID_MAYBE,
31 _BB_SUID_REQUIRE 31 BB_SUID_REQUIRE
32} bb_suid_t; 32} bb_suid_t;
33 33
34 34
diff --git a/include/libbb.h b/include/libbb.h
index 5fa62da3a..7efa32349 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -50,6 +50,9 @@
50# include <selinux/flask.h> 50# include <selinux/flask.h>
51# include <selinux/av_permissions.h> 51# include <selinux/av_permissions.h>
52#endif 52#endif
53#if ENABLE_FEATURE_UTMP
54# include <utmp.h>
55#endif
53#if ENABLE_LOCALE_SUPPORT 56#if ENABLE_LOCALE_SUPPORT
54# include <locale.h> 57# include <locale.h>
55#else 58#else
@@ -68,6 +71,19 @@
68# include <shadow.h> 71# include <shadow.h>
69# endif 72# endif
70#endif 73#endif
74/* Just in case libc doesn't define some of these... */
75#ifndef _PATH_PASSWD
76#define _PATH_PASSWD "/etc/passwd"
77#endif
78#ifndef _PATH_GROUP
79#define _PATH_GROUP "/etc/group"
80#endif
81#ifndef _PATH_SHADOW
82#define _PATH_SHADOW "/etc/shadow"
83#endif
84#ifndef _PATH_GSHADOW
85#define _PATH_GSHADOW "/etc/gshadow"
86#endif
71#if defined __FreeBSD__ || defined __OpenBSD__ 87#if defined __FreeBSD__ || defined __OpenBSD__
72# include <netinet/in.h> 88# include <netinet/in.h>
73# include <arpa/inet.h> 89# include <arpa/inet.h>
@@ -91,6 +107,15 @@
91 typedef unsigned socklen_t; 107 typedef unsigned socklen_t;
92# endif 108# endif
93#endif 109#endif
110#ifndef HAVE_CLEARENV
111# define clearenv() do { if (environ) environ[0] = NULL; } while (0)
112#endif
113#ifndef HAVE_FDATASYNC
114# define fdatasync fsync
115#endif
116#ifndef HAVE_XTABS
117# define XTABS TAB3
118#endif
94 119
95 120
96/* Some libc's forget to declare these, do it ourself */ 121/* Some libc's forget to declare these, do it ourself */
@@ -348,9 +373,9 @@ extern char *bb_get_last_path_component_strip(char *path) FAST_FUNC;
348/* "abc/def/" -> "" and it never modifies 'path' */ 373/* "abc/def/" -> "" and it never modifies 'path' */
349extern char *bb_get_last_path_component_nostrip(const char *path) FAST_FUNC; 374extern char *bb_get_last_path_component_nostrip(const char *path) FAST_FUNC;
350 375
351int ndelay_on(int fd) FAST_FUNC; 376void ndelay_on(int fd) FAST_FUNC;
352int ndelay_off(int fd) FAST_FUNC; 377void ndelay_off(int fd) FAST_FUNC;
353int close_on_exec_on(int fd) FAST_FUNC; 378void close_on_exec_on(int fd) FAST_FUNC;
354void xdup2(int, int) FAST_FUNC; 379void xdup2(int, int) FAST_FUNC;
355void xmove_fd(int, int) FAST_FUNC; 380void xmove_fd(int, int) FAST_FUNC;
356 381
@@ -674,6 +699,8 @@ extern char *xmalloc_reads(int fd, char *pfx, size_t *maxsz_p) FAST_FUNC;
674extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 699extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
675/* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */ 700/* Returns NULL if file can't be opened (default max size: INT_MAX - 4095) */
676extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 701extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
702/* Never returns NULL */
703extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
677/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */ 704/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */
678#if ENABLE_FEATURE_SEAMLESS_LZMA \ 705#if ENABLE_FEATURE_SEAMLESS_LZMA \
679 || ENABLE_FEATURE_SEAMLESS_BZ2 \ 706 || ENABLE_FEATURE_SEAMLESS_BZ2 \
@@ -686,8 +713,6 @@ extern void setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) FAST_FUNC;
686/* Autodetects .gz etc */ 713/* Autodetects .gz etc */
687extern int open_zipped(const char *fname) FAST_FUNC; 714extern int open_zipped(const char *fname) FAST_FUNC;
688extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC; 715extern void *xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
689/* Never returns NULL */
690extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
691 716
692extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC; 717extern ssize_t safe_write(int fd, const void *buf, size_t count) FAST_FUNC;
693// NB: will return short write on error, not -1, 718// NB: will return short write on error, not -1,
@@ -1211,6 +1236,12 @@ extern void selinux_preserve_fcontext(int fdesc) FAST_FUNC;
1211#endif 1236#endif
1212extern void selinux_or_die(void) FAST_FUNC; 1237extern void selinux_or_die(void) FAST_FUNC;
1213 1238
1239
1240/* systemd support */
1241#define SD_LISTEN_FDS_START 3
1242int sd_listen_fds(void);
1243
1244
1214/* setup_environment: 1245/* setup_environment:
1215 * if chdir pw->pw_dir: ok: else if to_tmp == 1: goto /tmp else: goto / or die 1246 * if chdir pw->pw_dir: ok: else if to_tmp == 1: goto /tmp else: goto / or die
1216 * if clear_env = 1: cd(pw->pw_dir), clear environment, then set 1247 * if clear_env = 1: cd(pw->pw_dir), clear environment, then set
@@ -1291,7 +1322,7 @@ void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST
1291void reset_ino_dev_hashtable(void) FAST_FUNC; 1322void reset_ino_dev_hashtable(void) FAST_FUNC;
1292#ifdef __GLIBC__ 1323#ifdef __GLIBC__
1293/* At least glibc has horrendously large inline for this, so wrap it */ 1324/* At least glibc has horrendously large inline for this, so wrap it */
1294unsigned long long bb_makedev(unsigned int major, unsigned int minor) FAST_FUNC; 1325unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC;
1295#undef makedev 1326#undef makedev
1296#define makedev(a,b) bb_makedev(a,b) 1327#define makedev(a,b) bb_makedev(a,b)
1297#endif 1328#endif
@@ -1628,10 +1659,10 @@ extern const char bb_busybox_exec_path[];
1628 * get the list of currently mounted filesystems */ 1659 * get the list of currently mounted filesystems */
1629#define bb_path_mtab_file IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts") 1660#define bb_path_mtab_file IF_FEATURE_MTAB_SUPPORT("/etc/mtab")IF_NOT_FEATURE_MTAB_SUPPORT("/proc/mounts")
1630 1661
1631#define bb_path_passwd_file "/etc/passwd" 1662#define bb_path_passwd_file _PATH_PASSWD
1632#define bb_path_shadow_file "/etc/shadow" 1663#define bb_path_group_file _PATH_GROUP
1633#define bb_path_gshadow_file "/etc/gshadow" 1664#define bb_path_shadow_file _PATH_SHADOW
1634#define bb_path_group_file "/etc/group" 1665#define bb_path_gshadow_file _PATH_GSHADOW
1635 1666
1636#define bb_path_motd_file "/etc/motd" 1667#define bb_path_motd_file "/etc/motd"
1637 1668
diff --git a/include/platform.h b/include/platform.h
index 5f49deb41..c272fbb05 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -20,10 +20,14 @@
20/* Assume all these functions exist by default. Platforms where it is not 20/* Assume all these functions exist by default. Platforms where it is not
21 * true will #undef them below. 21 * true will #undef them below.
22 */ 22 */
23#define HAVE_CLEARENV 1
24#define HAVE_FDATASYNC 1
23#define HAVE_FDPRINTF 1 25#define HAVE_FDPRINTF 1
24#define HAVE_MEMRCHR 1 26#define HAVE_MEMRCHR 1
25#define HAVE_MKDTEMP 1 27#define HAVE_MKDTEMP 1
28#define HAVE_PTSNAME_R 1
26#define HAVE_SETBIT 1 29#define HAVE_SETBIT 1
30#define HAVE_SIGHANDLER_T 1
27#define HAVE_STRCASESTR 1 31#define HAVE_STRCASESTR 1
28#define HAVE_STRCHRNUL 1 32#define HAVE_STRCHRNUL 1
29#define HAVE_STRSEP 1 33#define HAVE_STRSEP 1
@@ -235,14 +239,15 @@
235 239
236/* ---- Unaligned access ------------------------------------ */ 240/* ---- Unaligned access ------------------------------------ */
237 241
242#include <stdint.h>
243typedef int bb__aliased_int FIX_ALIASING;
244typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
245typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
246
238/* NB: unaligned parameter should be a pointer, aligned one - 247/* NB: unaligned parameter should be a pointer, aligned one -
239 * a lvalue. This makes it more likely to not swap them by mistake 248 * a lvalue. This makes it more likely to not swap them by mistake
240 */ 249 */
241#if defined(i386) || defined(__x86_64__) || defined(__powerpc__) 250#if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
242# include <stdint.h>
243typedef int bb__aliased_int FIX_ALIASING;
244typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
245typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
246# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) 251# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
247# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) 252# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
248# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) 253# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))
@@ -268,13 +273,19 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
268 273
269#if (defined __digital__ && defined __unix__) \ 274#if (defined __digital__ && defined __unix__) \
270 || defined __APPLE__ \ 275 || defined __APPLE__ \
271 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__ \ 276 || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
272 || ENABLE_PLATFORM_MINGW32 277# undef HAVE_CLEARENV
278# undef HAVE_FDATASYNC
273# undef HAVE_MNTENT_H 279# undef HAVE_MNTENT_H
280# undef HAVE_PTSNAME_R
274# undef HAVE_SYS_STATFS_H 281# undef HAVE_SYS_STATFS_H
282# undef HAVE_SIGHANDLER_T
283# undef HAVE_XTABS
284# undef HAVE_FDPRINTF
275#else 285#else
276# define HAVE_MNTENT_H 1 286# define HAVE_MNTENT_H 1
277# define HAVE_SYS_STATFS_H 1 287# define HAVE_SYS_STATFS_H 1
288# define HAVE_XTABS 1
278#endif 289#endif
279 290
280/*----- Kernel versioning ------------------------------------*/ 291/*----- Kernel versioning ------------------------------------*/
@@ -378,14 +389,16 @@ typedef unsigned smalluint;
378#endif 389#endif
379 390
380#if ENABLE_PLATFORM_MINGW32 391#if ENABLE_PLATFORM_MINGW32
381# undef HAVE_FDPRINTF 392# undef HAVE_FDPRINTF
382# undef HAVE_MEMRCHR 393# undef HAVE_MEMRCHR
383# undef HAVE_MKDTEMP 394# undef HAVE_MKDTEMP
384# undef HAVE_SETBIT 395# undef HAVE_SETBIT
385# undef HAVE_STRCASESTR 396# undef HAVE_STRCASESTR
386# undef HAVE_STRCHRNUL 397# undef HAVE_STRCHRNUL
387# undef HAVE_STRSIGNAL 398# undef HAVE_STRSIGNAL
388# undef HAVE_VASPRINTF 399# undef HAVE_VASPRINTF
400# undef HAVE_MNTENT_H
401# undef HAVE_SYS_STATFS_H
389#endif 402#endif
390 403
391#if defined(__WATCOMC__) 404#if defined(__WATCOMC__)
@@ -427,6 +440,10 @@ extern char *mkdtemp(char *template) FAST_FUNC;
427# define clrbit(a, b) ((a)[(b) >> 3] &= ~(1 << ((b) & 7))) 440# define clrbit(a, b) ((a)[(b) >> 3] &= ~(1 << ((b) & 7)))
428#endif 441#endif
429 442
443#ifndef HAVE_SIGHANDLER_T
444typedef void (*sighandler_t)(int);
445#endif
446
430#ifndef HAVE_STRCASESTR 447#ifndef HAVE_STRCASESTR
431extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC; 448extern char *strcasestr(const char *s, const char *pattern) FAST_FUNC;
432#endif 449#endif
@@ -445,9 +462,7 @@ extern char *strsep(char **stringp, const char *delim) FAST_FUNC;
445#endif 462#endif
446 463
447#ifndef HAVE_VASPRINTF 464#ifndef HAVE_VASPRINTF
448# if ENABLE_PLATFORM_MINGW32 465# include <stdarg.h>
449# include <stdarg.h>
450# endif
451extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC; 466extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC;
452#endif 467#endif
453 468
diff --git a/include/shadow_.h b/include/shadow_.h
index de126ddec..648a62ab3 100644
--- a/include/shadow_.h
+++ b/include/shadow_.h
@@ -37,11 +37,6 @@ struct spwd {
37 unsigned long sp_flag; /* Reserved */ 37 unsigned long sp_flag; /* Reserved */
38}; 38};
39 39
40/* Paths to the user database files */
41#ifndef _PATH_SHADOW
42#define _PATH_SHADOW "/etc/shadow"
43#endif
44
45#define setspent bb_internal_setspent 40#define setspent bb_internal_setspent
46#define endspent bb_internal_endspent 41#define endspent bb_internal_endspent
47#define getspent bb_internal_getspent 42#define getspent bb_internal_getspent
diff --git a/include/unicode.h b/include/unicode.h
index 1dd55e67d..dee02e777 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -60,8 +60,8 @@ enum {
60//UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src); 60//UNUSED: unsigned FAST_FUNC unicode_padding_to_width(unsigned width, const char *src);
61//UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags); 61//UNUSED: char* FAST_FUNC unicode_conv_to_printable2(uni_stat_t *stats, const char *src, unsigned width, int flags);
62char* FAST_FUNC unicode_conv_to_printable(uni_stat_t *stats, const char *src); 62char* FAST_FUNC unicode_conv_to_printable(uni_stat_t *stats, const char *src);
63char* FAST_FUNC unicode_conv_to_printable_maxwidth(uni_stat_t *stats, const char *src, unsigned maxwidth); 63//UNUSED: char* FAST_FUNC unicode_conv_to_printable_maxwidth(uni_stat_t *stats, const char *src, unsigned maxwidth);
64char* FAST_FUNC unicode_conv_to_printable_fixedwidth(uni_stat_t *stats, const char *src, unsigned width); 64char* FAST_FUNC unicode_conv_to_printable_fixedwidth(/*uni_stat_t *stats,*/ const char *src, unsigned width);
65 65
66# if ENABLE_UNICODE_USING_LOCALE 66# if ENABLE_UNICODE_USING_LOCALE
67 67
diff --git a/include/usage.src.h b/include/usage.src.h
index ea0e6a452..ebe80f8e1 100644
--- a/include/usage.src.h
+++ b/include/usage.src.h
@@ -1394,23 +1394,6 @@ INSERT
1394#define getsebool_full_usage "\n\n" \ 1394#define getsebool_full_usage "\n\n" \
1395 " -a Show all selinux booleans" 1395 " -a Show all selinux booleans"
1396 1396
1397#define getty_trivial_usage \
1398 "[OPTIONS] BAUD_RATE TTY [TERMTYPE]"
1399#define getty_full_usage "\n\n" \
1400 "Open a tty, prompt for a login name, then invoke /bin/login\n" \
1401 "\nOptions:" \
1402 "\n -h Enable hardware (RTS/CTS) flow control" \
1403 "\n -i Don't display /etc/issue before running login" \
1404 "\n -L Local line, don't do carrier detect" \
1405 "\n -m Get baud rate from modem's CONNECT status message" \
1406 "\n -w Wait for a CR or LF before sending /etc/issue" \
1407 "\n -n Don't prompt the user for a login name" \
1408 "\n -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue" \
1409 "\n -l LOGIN Invoke LOGIN instead of /bin/login" \
1410 "\n -t SEC Terminate after SEC if no username is read" \
1411 "\n -I INITSTR Send INITSTR before anything else" \
1412 "\n -H HOST Log HOST into the utmp file as the hostname" \
1413
1414#define gunzip_trivial_usage \ 1397#define gunzip_trivial_usage \
1415 "[-cft] [FILE]..." 1398 "[-cft] [FILE]..."
1416#define gunzip_full_usage "\n\n" \ 1399#define gunzip_full_usage "\n\n" \
@@ -1612,25 +1595,6 @@ INSERT
1612 "\n -e STRING HTML encode STRING" \ 1595 "\n -e STRING HTML encode STRING" \
1613 "\n -d STRING URL decode STRING" \ 1596 "\n -d STRING URL decode STRING" \
1614 1597
1615#define hwclock_trivial_usage \
1616 IF_FEATURE_HWCLOCK_LONG_OPTIONS( \
1617 "[-r|--show] [-s|--hctosys] [-w|--systohc]" \
1618 " [-l|--localtime] [-u|--utc]" \
1619 " [-f FILE]" \
1620 ) \
1621 IF_NOT_FEATURE_HWCLOCK_LONG_OPTIONS( \
1622 "[-r] [-s] [-w] [-l] [-u] [-f FILE]" \
1623 )
1624#define hwclock_full_usage "\n\n" \
1625 "Query and set hardware clock (RTC)\n" \
1626 "\nOptions:" \
1627 "\n -r Show hardware clock time" \
1628 "\n -s Set system time from hardware clock" \
1629 "\n -w Set hardware clock to system time" \
1630 "\n -u Hardware clock is in UTC" \
1631 "\n -l Hardware clock is in local time" \
1632 "\n -f FILE Use specified device (e.g. /dev/rtc2)" \
1633
1634#define id_trivial_usage \ 1598#define id_trivial_usage \
1635 "[OPTIONS] [USER]" 1599 "[OPTIONS] [USER]"
1636#define id_full_usage "\n\n" \ 1600#define id_full_usage "\n\n" \
@@ -3555,13 +3519,6 @@ INSERT
3555 "pause, cont, hup, alarm, interrupt, quit, 1, 2, term, kill: send\n" \ 3519 "pause, cont, hup, alarm, interrupt, quit, 1, 2, term, kill: send\n" \
3556 "STOP, CONT, HUP, ALRM, INT, QUIT, USR1, USR2, TERM, KILL signal to service" \ 3520 "STOP, CONT, HUP, ALRM, INT, QUIT, USR1, USR2, TERM, KILL signal to service" \
3557 3521
3558#define svlogd_trivial_usage \
3559 "[-ttv] [-r C] [-R CHARS] [-l MATCHLEN] [-b BUFLEN] DIR..."
3560#define svlogd_full_usage "\n\n" \
3561 "Continuously read log data from stdin, optionally\n" \
3562 "filter log messages, and write the data to one or more automatically\n" \
3563 "rotated logs" \
3564
3565#define swapoff_trivial_usage \ 3522#define swapoff_trivial_usage \
3566 "[-a] [DEVICE]" 3523 "[-a] [DEVICE]"
3567#define swapoff_full_usage "\n\n" \ 3524#define swapoff_full_usage "\n\n" \
@@ -3843,14 +3800,6 @@ INSERT
3843 "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n" \ 3800 "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n" \
3844 "Defaults: SECS: 10, SIG: TERM." \ 3801 "Defaults: SECS: 10, SIG: TERM." \
3845 3802
3846#define top_trivial_usage \
3847 "[-b] [-nCOUNT] [-dSECONDS]" IF_FEATURE_TOPMEM(" [-m]")
3848#define top_full_usage "\n\n" \
3849 "Provide a view of process activity in real time.\n" \
3850 "Read the status of all processes from /proc each SECONDS\n" \
3851 "and display a screenful of them." \
3852//TODO: add options and keyboard commands
3853
3854#define tr_trivial_usage \ 3803#define tr_trivial_usage \
3855 "[-cds] STRING1 [STRING2]" 3804 "[-cds] STRING1 [STRING2]"
3856#define tr_full_usage "\n\n" \ 3805#define tr_full_usage "\n\n" \