aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.src.h30
-rw-r--r--include/libbb.h28
-rw-r--r--include/platform.h2
3 files changed, 20 insertions, 40 deletions
diff --git a/include/applets.src.h b/include/applets.src.h
index aa319bbc9..7dbd4c7f3 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -79,16 +79,13 @@ IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP))
79IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP)) 79IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP))
80IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP)) 80IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP))
81IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) 81IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP))
82IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP))
83IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) 82IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP))
84IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) 83IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP))
85IF_AWK(APPLET_NOEXEC(awk, awk, BB_DIR_USR_BIN, BB_SUID_DROP, awk))
86IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) 84IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename))
87IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) 85IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP))
88IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP)) 86IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP))
89IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) 87IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP))
90IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) 88IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP))
91IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
92IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) 89IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP))
93IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) 90IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat))
94IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) 91IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP))
@@ -105,10 +102,8 @@ IF_CHRT(APPLET(chrt, BB_DIR_USR_BIN, BB_SUID_DROP))
105IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP)) 102IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP))
106IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) 103IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum))
107IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) 104IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP))
108IF_CMP(APPLET(cmp, BB_DIR_USR_BIN, BB_SUID_DROP))
109IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) 105IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP))
110IF_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))
111IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP))
112IF_CROND(APPLET(crond, BB_DIR_USR_SBIN, BB_SUID_DROP)) 107IF_CROND(APPLET(crond, BB_DIR_USR_SBIN, BB_SUID_DROP))
113/* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */ 108/* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */
114IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) 109IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
@@ -123,21 +118,17 @@ IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP))
123IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) 118IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP))
124IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) 119IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP))
125IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) 120IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP))
126IF_DIFF(APPLET(diff, BB_DIR_USR_BIN, BB_SUID_DROP))
127IF_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))
128IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) 122IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP))
129IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) 123IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP))
130IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) 124IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname))
131IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) 125IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix))
132IF_DPKG(APPLET(dpkg, BB_DIR_USR_BIN, BB_SUID_DROP))
133IF_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, BB_DIR_USR_BIN, BB_SUID_DROP, dpkg_deb))
134IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) 126IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP))
135IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) 127IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP))
136IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) 128IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP))
137//IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) 129//IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP))
138//IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) 130//IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label))
139IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) 131IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo))
140IF_ED(APPLET(ed, BB_DIR_BIN, BB_SUID_DROP))
141IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP)) 132IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP))
142IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) 133IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env))
143IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir)) 134IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir))
@@ -176,8 +167,6 @@ IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP))
176IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) 167IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP))
177IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) 168IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP))
178IF_GETTY(APPLET(getty, BB_DIR_SBIN, BB_SUID_DROP)) 169IF_GETTY(APPLET(getty, BB_DIR_SBIN, BB_SUID_DROP))
179IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP))
180IF_GZIP(APPLET(gzip, BB_DIR_BIN, BB_SUID_DROP))
181IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) 170IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd))
182IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP)) 171IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP))
183IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) 172IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head))
@@ -236,10 +225,6 @@ IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls))
236IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP)) 225IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP))
237IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) 226IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP))
238IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) 227IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP))
239IF_UNLZMA(APPLET_ODDNAME(lzcat, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzcat))
240IF_LZMA(APPLET_ODDNAME(lzma, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzma))
241IF_LZOP(APPLET(lzop, BB_DIR_BIN, BB_SUID_DROP))
242IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, lzopcat))
243IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) 228IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP))
244IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP)) 229IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP))
245IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP)) 230IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -303,12 +288,9 @@ IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP))
303IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) 288IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP))
304IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) 289IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP))
305IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) 290IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon))
306IF_RFKILL(APPLET(rfkill, BB_DIR_USR_SBIN, BB_SUID_DROP))
307IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) 291IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm))
308IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) 292IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir))
309IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) 293IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP))
310IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP))
311IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
312IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) 294IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP))
313IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) 295IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts))
314IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) 296IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -318,7 +300,6 @@ IF_RUNSVDIR(APPLET(runsvdir, BB_DIR_USR_BIN, BB_SUID_DROP))
318IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) 300IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP))
319IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) 301IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP))
320IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) 302IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP))
321IF_SED(APPLET(sed, BB_DIR_BIN, BB_SUID_DROP))
322IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) 303IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP))
323IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP)) 304IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP))
324IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) 305IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq))
@@ -362,7 +343,6 @@ IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP))
362IF_SYSLOGD(APPLET(syslogd, BB_DIR_SBIN, BB_SUID_DROP)) 343IF_SYSLOGD(APPLET(syslogd, BB_DIR_SBIN, BB_SUID_DROP))
363IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) 344IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac))
364IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) 345IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP))
365IF_TAR(APPLET(tar, BB_DIR_BIN, BB_SUID_DROP))
366IF_TASKSET(APPLET(taskset, BB_DIR_USR_BIN, BB_SUID_DROP)) 346IF_TASKSET(APPLET(taskset, BB_DIR_USR_BIN, BB_SUID_DROP))
367/* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */ 347/* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */
368IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd)) 348IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd))
@@ -391,14 +371,9 @@ IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
391IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) 371IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd))
392IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) 372IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP))
393IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) 373IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP))
394IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP))
395IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) 374IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand))
396IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) 375IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP))
397IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) 376IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos))
398IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP))
399IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP))
400IF_LZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop))
401IF_UNZIP(APPLET(unzip, BB_DIR_USR_BIN, BB_SUID_DROP))
402IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP)) 377IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP))
403IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) 378IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep))
404IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) 379IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP))
@@ -407,18 +382,13 @@ IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP))
407/* Needs to be run by root or be suid root - needs to change uid and gid: */ 382/* Needs to be run by root or be suid root - needs to change uid and gid: */
408IF_VLOCK(APPLET(vlock, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) 383IF_VLOCK(APPLET(vlock, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
409IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP)) 384IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP))
410/* Needs to be run by root or be suid root - needs to write to /dev/TTY: */
411IF_WALL(APPLET(wall, BB_DIR_USR_BIN, BB_SUID_REQUIRE))
412IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) 385IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP))
413IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) 386IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP))
414IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) 387IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP))
415IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP)) 388IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP))
416IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) 389IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP))
417IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) 390IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami))
418IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat))
419IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz))
420IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) 391IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
421IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat))
422IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) 392IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP))
423 393
424#if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE) \ 394#if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE) \
diff --git a/include/libbb.h b/include/libbb.h
index 9adb037ca..e516f0ee3 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -32,12 +32,12 @@
32#include <stdarg.h> 32#include <stdarg.h>
33#include <stddef.h> 33#include <stddef.h>
34#include <string.h> 34#include <string.h>
35/* There are two incompatible basename's, let not use them! */ 35/* There are two incompatible basename's, let's not use them! */
36/* See the dirname/basename man page for details */ 36/* See the dirname/basename man page for details */
37#include <libgen.h> /* dirname,basename */ 37#include <libgen.h> /* dirname,basename */
38#undef basename 38#undef basename
39#define basename dont_use_basename 39#define basename dont_use_basename
40#include <sys/poll.h> 40#include <poll.h>
41#include <sys/ioctl.h> 41#include <sys/ioctl.h>
42#include <sys/mman.h> 42#include <sys/mman.h>
43#include <sys/socket.h> 43#include <sys/socket.h>
@@ -474,6 +474,8 @@ void record_signo(int signo); /* not FAST_FUNC! */
474 474
475void xsetgid(gid_t gid) FAST_FUNC; 475void xsetgid(gid_t gid) FAST_FUNC;
476void xsetuid(uid_t uid) FAST_FUNC; 476void xsetuid(uid_t uid) FAST_FUNC;
477void xsetegid(gid_t egid) FAST_FUNC;
478void xseteuid(uid_t euid) FAST_FUNC;
477void xchdir(const char *path) FAST_FUNC; 479void xchdir(const char *path) FAST_FUNC;
478void xchroot(const char *path) FAST_FUNC; 480void xchroot(const char *path) FAST_FUNC;
479void xsetenv(const char *key, const char *value) FAST_FUNC; 481void xsetenv(const char *key, const char *value) FAST_FUNC;
@@ -482,11 +484,12 @@ void bb_unsetenv_and_free(char *key) FAST_FUNC;
482void xunlink(const char *pathname) FAST_FUNC; 484void xunlink(const char *pathname) FAST_FUNC;
483void xstat(const char *pathname, struct stat *buf) FAST_FUNC; 485void xstat(const char *pathname, struct stat *buf) FAST_FUNC;
484void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; 486void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC;
487int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC;
488int open_or_warn(const char *pathname, int flags) FAST_FUNC;
489int xopen3(const char *pathname, int flags, int mode) FAST_FUNC;
485int xopen(const char *pathname, int flags) FAST_FUNC; 490int xopen(const char *pathname, int flags) FAST_FUNC;
486int xopen_nonblocking(const char *pathname) FAST_FUNC; 491int xopen_nonblocking(const char *pathname) FAST_FUNC;
487int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; 492int xopen_as_uid_gid(const char *pathname, int flags, uid_t u, gid_t g) FAST_FUNC;
488int open_or_warn(const char *pathname, int flags) FAST_FUNC;
489int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC;
490int open_or_warn_stdin(const char *pathname) FAST_FUNC; 493int open_or_warn_stdin(const char *pathname) FAST_FUNC;
491int xopen_stdin(const char *pathname) FAST_FUNC; 494int xopen_stdin(const char *pathname) FAST_FUNC;
492void xrename(const char *oldpath, const char *newpath) FAST_FUNC; 495void xrename(const char *oldpath, const char *newpath) FAST_FUNC;
@@ -831,8 +834,8 @@ char *itoa(int n) FAST_FUNC;
831char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; 834char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC;
832char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC; 835char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC;
833/* Intelligent formatters of bignums */ 836/* Intelligent formatters of bignums */
834void smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC; 837char *smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC;
835void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; 838char *smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC;
836/* If block_size == 0, display size without fractional part, 839/* If block_size == 0, display size without fractional part,
837 * else display (size * block_size) with one decimal digit. 840 * else display (size * block_size) with one decimal digit.
838 * If display_unit == 0, show value no bigger than 1024 with suffix (K,M,G...), 841 * If display_unit == 0, show value no bigger than 1024 with suffix (K,M,G...),
@@ -1313,8 +1316,10 @@ int sd_listen_fds(void);
1313#define SETUP_ENV_CLEARENV (1 << 1) 1316#define SETUP_ENV_CLEARENV (1 << 1)
1314#define SETUP_ENV_TO_TMP (1 << 2) 1317#define SETUP_ENV_TO_TMP (1 << 2)
1315#define SETUP_ENV_NO_CHDIR (1 << 4) 1318#define SETUP_ENV_NO_CHDIR (1 << 4)
1316extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; 1319void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC;
1317extern int correct_password(const struct passwd *pw) FAST_FUNC; 1320void nuke_str(char *str) FAST_FUNC;
1321int ask_and_check_password_extended(const struct passwd *pw, int timeout, const char *prompt) FAST_FUNC;
1322int ask_and_check_password(const struct passwd *pw) FAST_FUNC;
1318/* Returns a malloced string */ 1323/* Returns a malloced string */
1319#if !ENABLE_USE_BB_CRYPT 1324#if !ENABLE_USE_BB_CRYPT
1320#define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt) 1325#define pw_encrypt(clear, salt, cleanup) pw_encrypt(clear, salt)
@@ -1793,6 +1798,11 @@ extern struct globals *const ptr_to_globals;
1793 (*(struct globals**)&ptr_to_globals) = (void*)(x); \ 1798 (*(struct globals**)&ptr_to_globals) = (void*)(x); \
1794 barrier(); \ 1799 barrier(); \
1795} while (0) 1800} while (0)
1801#define FREE_PTR_TO_GLOBALS() do { \
1802 if (ENABLE_FEATURE_CLEAN_UP) { \
1803 free(ptr_to_globals); \
1804 } \
1805} while (0)
1796 1806
1797/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, 1807/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
1798 * use bb_default_login_shell and following defines. 1808 * use bb_default_login_shell and following defines.
diff --git a/include/platform.h b/include/platform.h
index f18d5b74e..66615b400 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -469,7 +469,7 @@ typedef unsigned smalluint;
469# undef HAVE_UNLOCKED_LINE_OPS 469# undef HAVE_UNLOCKED_LINE_OPS
470#endif 470#endif
471 471
472#if defined(__FreeBSD__) 472#if defined(__FreeBSD__) || defined(__APPLE__)
473# undef HAVE_STRCHRNUL 473# undef HAVE_STRCHRNUL
474#endif 474#endif
475 475