diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.src.h | 30 | ||||
-rw-r--r-- | include/libbb.h | 28 | ||||
-rw-r--r-- | include/platform.h | 2 |
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)) | |||
79 | IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 79 | IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
80 | IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 80 | IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
81 | IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) | 81 | IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) |
82 | IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
83 | IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) | 82 | IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) |
84 | IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 83 | IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
85 | IF_AWK(APPLET_NOEXEC(awk, awk, BB_DIR_USR_BIN, BB_SUID_DROP, awk)) | ||
86 | IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) | 84 | IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) |
87 | IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) | 85 | IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) |
88 | IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP)) | 86 | IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP)) |
89 | IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) | 87 | IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) |
90 | IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 88 | IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
91 | IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
92 | IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) | 89 | IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) |
93 | IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) | 90 | IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) |
94 | IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) | 91 | IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) |
@@ -105,10 +102,8 @@ IF_CHRT(APPLET(chrt, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
105 | IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP)) | 102 | IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP)) |
106 | IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) | 103 | IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) |
107 | IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) | 104 | IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) |
108 | IF_CMP(APPLET(cmp, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
109 | IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) | 105 | IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) |
110 | IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) | 106 | IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) |
111 | IF_CPIO(APPLET(cpio, BB_DIR_BIN, BB_SUID_DROP)) | ||
112 | IF_CROND(APPLET(crond, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 107 | IF_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: */ |
114 | IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) | 109 | IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) |
@@ -123,21 +118,17 @@ IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP)) | |||
123 | IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) | 118 | IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) |
124 | IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) | 119 | IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) |
125 | IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 120 | IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
126 | IF_DIFF(APPLET(diff, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
127 | IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) | 121 | IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) |
128 | IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) | 122 | IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) |
129 | IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 123 | IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
130 | IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) | 124 | IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) |
131 | IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) | 125 | IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) |
132 | IF_DPKG(APPLET(dpkg, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
133 | IF_DPKG_DEB(APPLET_ODDNAME(dpkg-deb, dpkg_deb, BB_DIR_USR_BIN, BB_SUID_DROP, dpkg_deb)) | ||
134 | IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) | 126 | IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) |
135 | IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) | 127 | IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) |
136 | IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) | 128 | IF_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)) |
139 | IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) | 131 | IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) |
140 | IF_ED(APPLET(ed, BB_DIR_BIN, BB_SUID_DROP)) | ||
141 | IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP)) | 132 | IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP)) |
142 | IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) | 133 | IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) |
143 | IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir)) | 134 | IF_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)) | |||
176 | IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) | 167 | IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) |
177 | IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 168 | IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
178 | IF_GETTY(APPLET(getty, BB_DIR_SBIN, BB_SUID_DROP)) | 169 | IF_GETTY(APPLET(getty, BB_DIR_SBIN, BB_SUID_DROP)) |
179 | IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP)) | ||
180 | IF_GZIP(APPLET(gzip, BB_DIR_BIN, BB_SUID_DROP)) | ||
181 | IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) | 170 | IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) |
182 | IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP)) | 171 | IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP)) |
183 | IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) | 172 | IF_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)) | |||
236 | IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP)) | 225 | IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP)) |
237 | IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) | 226 | IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) |
238 | IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) | 227 | IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) |
239 | IF_UNLZMA(APPLET_ODDNAME(lzcat, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzcat)) | ||
240 | IF_LZMA(APPLET_ODDNAME(lzma, unlzma, BB_DIR_USR_BIN, BB_SUID_DROP, lzma)) | ||
241 | IF_LZOP(APPLET(lzop, BB_DIR_BIN, BB_SUID_DROP)) | ||
242 | IF_LZOP(APPLET_ODDNAME(lzopcat, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, lzopcat)) | ||
243 | IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) | 228 | IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) |
244 | IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP)) | 229 | IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP)) |
245 | IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP)) | 230 | IF_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)) | |||
303 | IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) | 288 | IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) |
304 | IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) | 289 | IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) |
305 | IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) | 290 | IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) |
306 | IF_RFKILL(APPLET(rfkill, BB_DIR_USR_SBIN, BB_SUID_DROP)) | ||
307 | IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) | 291 | IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) |
308 | IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) | 292 | IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) |
309 | IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) | 293 | IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) |
310 | IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP)) | ||
311 | IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
312 | IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 294 | IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
313 | IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) | 295 | IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) |
314 | IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) | 296 | IF_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)) | |||
318 | IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) | 300 | IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) |
319 | IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) | 301 | IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) |
320 | IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) | 302 | IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) |
321 | IF_SED(APPLET(sed, BB_DIR_BIN, BB_SUID_DROP)) | ||
322 | IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 303 | IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
323 | IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 304 | IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
324 | IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) | 305 | IF_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)) | |||
362 | IF_SYSLOGD(APPLET(syslogd, BB_DIR_SBIN, BB_SUID_DROP)) | 343 | IF_SYSLOGD(APPLET(syslogd, BB_DIR_SBIN, BB_SUID_DROP)) |
363 | IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) | 344 | IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) |
364 | IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) | 345 | IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) |
365 | IF_TAR(APPLET(tar, BB_DIR_BIN, BB_SUID_DROP)) | ||
366 | IF_TASKSET(APPLET(taskset, BB_DIR_USR_BIN, BB_SUID_DROP)) | 346 | IF_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)) */ |
368 | IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd)) | 348 | IF_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)) | |||
391 | IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) | 371 | IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) |
392 | IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) | 372 | IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) |
393 | IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) | 373 | IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) |
394 | IF_UNCOMPRESS(APPLET(uncompress, BB_DIR_BIN, BB_SUID_DROP)) | ||
395 | IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) | 374 | IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) |
396 | IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) | 375 | IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) |
397 | IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) | 376 | IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) |
398 | IF_UNXZ(APPLET(unxz, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
399 | IF_UNLZMA(APPLET(unlzma, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
400 | IF_LZOP(APPLET_ODDNAME(unlzop, lzop, BB_DIR_USR_BIN, BB_SUID_DROP, unlzop)) | ||
401 | IF_UNZIP(APPLET(unzip, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
402 | IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP)) | 377 | IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP)) |
403 | IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) | 378 | IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) |
404 | IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) | 379 | IF_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: */ |
408 | IF_VLOCK(APPLET(vlock, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) | 383 | IF_VLOCK(APPLET(vlock, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) |
409 | IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP)) | 384 | IF_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: */ | ||
411 | IF_WALL(APPLET(wall, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) | ||
412 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) | 385 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) |
413 | IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) | 386 | IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) |
414 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) | 387 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) |
415 | IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP)) | 388 | IF_WGET(APPLET(wget, BB_DIR_USR_BIN, BB_SUID_DROP)) |
416 | IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) | 389 | IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) |
417 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) | 390 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) |
418 | IF_UNXZ(APPLET_ODDNAME(xzcat, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xzcat)) | ||
419 | IF_XZ(APPLET_ODDNAME(xz, unxz, BB_DIR_USR_BIN, BB_SUID_DROP, xz)) | ||
420 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) | 391 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) |
421 | IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat)) | ||
422 | IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) | 392 | IF_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 | ||
475 | void xsetgid(gid_t gid) FAST_FUNC; | 475 | void xsetgid(gid_t gid) FAST_FUNC; |
476 | void xsetuid(uid_t uid) FAST_FUNC; | 476 | void xsetuid(uid_t uid) FAST_FUNC; |
477 | void xsetegid(gid_t egid) FAST_FUNC; | ||
478 | void xseteuid(uid_t euid) FAST_FUNC; | ||
477 | void xchdir(const char *path) FAST_FUNC; | 479 | void xchdir(const char *path) FAST_FUNC; |
478 | void xchroot(const char *path) FAST_FUNC; | 480 | void xchroot(const char *path) FAST_FUNC; |
479 | void xsetenv(const char *key, const char *value) FAST_FUNC; | 481 | void xsetenv(const char *key, const char *value) FAST_FUNC; |
@@ -482,11 +484,12 @@ void bb_unsetenv_and_free(char *key) FAST_FUNC; | |||
482 | void xunlink(const char *pathname) FAST_FUNC; | 484 | void xunlink(const char *pathname) FAST_FUNC; |
483 | void xstat(const char *pathname, struct stat *buf) FAST_FUNC; | 485 | void xstat(const char *pathname, struct stat *buf) FAST_FUNC; |
484 | void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; | 486 | void xfstat(int fd, struct stat *buf, const char *errmsg) FAST_FUNC; |
487 | int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; | ||
488 | int open_or_warn(const char *pathname, int flags) FAST_FUNC; | ||
489 | int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; | ||
485 | int xopen(const char *pathname, int flags) FAST_FUNC; | 490 | int xopen(const char *pathname, int flags) FAST_FUNC; |
486 | int xopen_nonblocking(const char *pathname) FAST_FUNC; | 491 | int xopen_nonblocking(const char *pathname) FAST_FUNC; |
487 | int xopen3(const char *pathname, int flags, int mode) FAST_FUNC; | 492 | int xopen_as_uid_gid(const char *pathname, int flags, uid_t u, gid_t g) FAST_FUNC; |
488 | int open_or_warn(const char *pathname, int flags) FAST_FUNC; | ||
489 | int open3_or_warn(const char *pathname, int flags, int mode) FAST_FUNC; | ||
490 | int open_or_warn_stdin(const char *pathname) FAST_FUNC; | 493 | int open_or_warn_stdin(const char *pathname) FAST_FUNC; |
491 | int xopen_stdin(const char *pathname) FAST_FUNC; | 494 | int xopen_stdin(const char *pathname) FAST_FUNC; |
492 | void xrename(const char *oldpath, const char *newpath) FAST_FUNC; | 495 | void xrename(const char *oldpath, const char *newpath) FAST_FUNC; |
@@ -831,8 +834,8 @@ char *itoa(int n) FAST_FUNC; | |||
831 | char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; | 834 | char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; |
832 | char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC; | 835 | char *itoa_to_buf(int n, char *buf, unsigned buflen) FAST_FUNC; |
833 | /* Intelligent formatters of bignums */ | 836 | /* Intelligent formatters of bignums */ |
834 | void smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC; | 837 | char *smart_ulltoa4(unsigned long long ul, char buf[4], const char *scale) FAST_FUNC; |
835 | void smart_ulltoa5(unsigned long long ul, char buf[5], const char *scale) FAST_FUNC; | 838 | char *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) |
1316 | extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; | 1319 | void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; |
1317 | extern int correct_password(const struct passwd *pw) FAST_FUNC; | 1320 | void nuke_str(char *str) FAST_FUNC; |
1321 | int ask_and_check_password_extended(const struct passwd *pw, int timeout, const char *prompt) FAST_FUNC; | ||
1322 | int 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 | ||