diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.src.h | 40 | ||||
-rw-r--r-- | include/bb_archive.h | 1 | ||||
-rw-r--r-- | include/bb_e2fs_defs.h | 63 | ||||
-rw-r--r-- | include/busybox.h | 4 | ||||
-rw-r--r-- | include/libbb.h | 46 | ||||
-rw-r--r-- | include/platform.h | 9 |
6 files changed, 107 insertions, 56 deletions
diff --git a/include/applets.src.h b/include/applets.src.h index 252a060fb..597b1c9a6 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
@@ -70,12 +70,12 @@ INSERT | |||
70 | IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | 70 | IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) |
71 | IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | 71 | IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) |
72 | IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) | 72 | IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) |
73 | IF_ADDGROUP(APPLET(addgroup, BB_DIR_BIN, BB_SUID_DROP)) | 73 | IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
74 | IF_ADDUSER(APPLET(adduser, BB_DIR_BIN, BB_SUID_DROP)) | 74 | IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
75 | IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) | 75 | IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) |
76 | IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP)) | 76 | IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP)) |
77 | IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) | 77 | IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) |
78 | IF_ARPING(APPLET(arping, BB_DIR_USR_BIN, BB_SUID_DROP)) | 78 | IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
79 | IF_AWK(APPLET_NOEXEC(awk, awk, BB_DIR_USR_BIN, BB_SUID_DROP, awk)) | 79 | IF_AWK(APPLET_NOEXEC(awk, awk, BB_DIR_USR_BIN, BB_SUID_DROP, awk)) |
80 | IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) | 80 | IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) |
81 | IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) | 81 | IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) |
@@ -86,7 +86,7 @@ IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
86 | IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) | 86 | IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) |
87 | IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) | 87 | IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) |
88 | IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) | 88 | IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) |
89 | IF_CHAT(APPLET(chat, BB_DIR_USR_BIN, BB_SUID_DROP)) | 89 | IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
90 | IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP)) | 90 | IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP)) |
91 | IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) | 91 | IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) |
92 | IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) | 92 | IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) |
@@ -111,8 +111,8 @@ IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut)) | |||
111 | IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP)) | 111 | IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP)) |
112 | IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) | 112 | IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) |
113 | IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP)) | 113 | IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP)) |
114 | IF_DELGROUP(APPLET_ODDNAME(delgroup, deluser, BB_DIR_BIN, BB_SUID_DROP, delgroup)) | 114 | IF_DELGROUP(APPLET_ODDNAME(delgroup, deluser, BB_DIR_USR_SBIN, BB_SUID_DROP, delgroup)) |
115 | IF_DELUSER(APPLET(deluser, BB_DIR_BIN, BB_SUID_DROP)) | 115 | IF_DELUSER(APPLET(deluser, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
116 | IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP)) | 116 | IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP)) |
117 | IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) | 117 | IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) |
118 | IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) | 118 | IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) |
@@ -136,7 +136,7 @@ IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
136 | IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) | 136 | IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) |
137 | IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir)) | 137 | IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir)) |
138 | IF_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envuidgid)) | 138 | IF_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envuidgid)) |
139 | IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_BIN, BB_SUID_DROP, ether_wake)) | 139 | IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_SBIN, BB_SUID_DROP, ether_wake)) |
140 | IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) | 140 | IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) |
141 | IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) | 141 | IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) |
142 | IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 142 | IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
@@ -144,7 +144,7 @@ IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) | |||
144 | IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 144 | IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
145 | IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP)) | 145 | IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP)) |
146 | IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) | 146 | IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) |
147 | IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_BIN, BB_SUID_DROP)) | 147 | IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
148 | IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) | 148 | IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) |
149 | IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) | 149 | IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) |
150 | /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ | 150 | /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ |
@@ -182,7 +182,7 @@ IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) | |||
182 | IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) | 182 | IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) |
183 | IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown)) | 183 | IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown)) |
184 | IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) | 184 | IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) |
185 | IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_BIN, BB_SUID_DROP)) | 185 | IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
186 | IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup)) | 186 | IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup)) |
187 | IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 187 | IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
188 | IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP)) | 188 | IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP)) |
@@ -193,20 +193,20 @@ IF_IONICE(APPLET(ionice, BB_DIR_BIN, BB_SUID_DROP)) | |||
193 | || ENABLE_FEATURE_IP_LINK \ | 193 | || ENABLE_FEATURE_IP_LINK \ |
194 | || ENABLE_FEATURE_IP_TUNNEL \ | 194 | || ENABLE_FEATURE_IP_TUNNEL \ |
195 | || ENABLE_FEATURE_IP_RULE | 195 | || ENABLE_FEATURE_IP_RULE |
196 | IF_IP(APPLET(ip, BB_DIR_BIN, BB_SUID_DROP)) | 196 | IF_IP(APPLET(ip, BB_DIR_SBIN, BB_SUID_DROP)) |
197 | #endif | 197 | #endif |
198 | IF_IPADDR(APPLET(ipaddr, BB_DIR_BIN, BB_SUID_DROP)) | 198 | IF_IPADDR(APPLET(ipaddr, BB_DIR_SBIN, BB_SUID_DROP)) |
199 | IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) | 199 | IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) |
200 | IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) | 200 | IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) |
201 | IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) | 201 | IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) |
202 | IF_IPLINK(APPLET(iplink, BB_DIR_BIN, BB_SUID_DROP)) | 202 | IF_IPLINK(APPLET(iplink, BB_DIR_SBIN, BB_SUID_DROP)) |
203 | IF_IPROUTE(APPLET(iproute, BB_DIR_BIN, BB_SUID_DROP)) | 203 | IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP)) |
204 | IF_IPRULE(APPLET(iprule, BB_DIR_BIN, BB_SUID_DROP)) | 204 | IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) |
205 | IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_BIN, BB_SUID_DROP)) | 205 | IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) |
206 | IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_USR_BIN, BB_SUID_DROP)) | 206 | IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) |
207 | IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) | 207 | IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) |
208 | IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) | 208 | IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) |
209 | IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall5)) | 209 | IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5)) |
210 | IF_KLOGD(APPLET(klogd, BB_DIR_SBIN, BB_SUID_DROP)) | 210 | IF_KLOGD(APPLET(klogd, BB_DIR_SBIN, BB_SUID_DROP)) |
211 | IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP)) | 211 | IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP)) |
212 | //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) | 212 | //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) |
@@ -288,7 +288,7 @@ IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) | |||
288 | IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP)) | 288 | IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP)) |
289 | IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 289 | IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
290 | IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 290 | IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
291 | IF_READAHEAD(APPLET(readahead, BB_DIR_USR_BIN, BB_SUID_DROP)) | 291 | IF_READAHEAD(APPLET(readahead, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
292 | IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) | 292 | IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) |
293 | IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 293 | IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
294 | IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) | 294 | IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) |
@@ -303,7 +303,7 @@ IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) | |||
303 | IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) | 303 | IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) |
304 | IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP)) | 304 | IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP)) |
305 | IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP)) | 305 | IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP)) |
306 | IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_BIN, BB_SUID_DROP)) | 306 | IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
307 | IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) | 307 | IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) |
308 | IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) | 308 | IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) |
309 | IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) | 309 | IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) |
@@ -365,7 +365,7 @@ IF_TELNETD(APPLET(telnetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | |||
365 | IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | 365 | IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) |
366 | #if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT | 366 | #if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT |
367 | IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) | 367 | IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) |
368 | IF_TFTPD(APPLET(tftpd, BB_DIR_USR_BIN, BB_SUID_DROP)) | 368 | IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
369 | #endif | 369 | #endif |
370 | IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP)) | 370 | IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP)) |
371 | IF_TIMEOUT(APPLET(timeout, BB_DIR_USR_BIN, BB_SUID_DROP)) | 371 | IF_TIMEOUT(APPLET(timeout, BB_DIR_USR_BIN, BB_SUID_DROP)) |
diff --git a/include/bb_archive.h b/include/bb_archive.h index 2043d8570..7bb5615da 100644 --- a/include/bb_archive.h +++ b/include/bb_archive.h | |||
@@ -121,6 +121,7 @@ typedef struct archive_handle_t { | |||
121 | #define ARCHIVE_DONT_RESTORE_PERM (1 << 6) | 121 | #define ARCHIVE_DONT_RESTORE_PERM (1 << 6) |
122 | #define ARCHIVE_NUMERIC_OWNER (1 << 7) | 122 | #define ARCHIVE_NUMERIC_OWNER (1 << 7) |
123 | #define ARCHIVE_O_TRUNC (1 << 8) | 123 | #define ARCHIVE_O_TRUNC (1 << 8) |
124 | #define ARCHIVE_REMEMBER_NAMES (1 << 9) | ||
124 | 125 | ||
125 | 126 | ||
126 | /* POSIX tar Header Block, from POSIX 1003.1-1990 */ | 127 | /* POSIX tar Header Block, from POSIX 1003.1-1990 */ |
diff --git a/include/bb_e2fs_defs.h b/include/bb_e2fs_defs.h index 7974497ca..b400f8c11 100644 --- a/include/bb_e2fs_defs.h +++ b/include/bb_e2fs_defs.h | |||
@@ -406,25 +406,43 @@ struct ext2_super_block { | |||
406 | * Performance hints. Directory preallocation should only | 406 | * Performance hints. Directory preallocation should only |
407 | * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. | 407 | * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. |
408 | */ | 408 | */ |
409 | uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ | 409 | uint8_t s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ |
410 | uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ | 410 | uint8_t s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ |
411 | uint16_t s_reserved_gdt_blocks; /* Per group table for online growth */ | 411 | uint16_t s_reserved_gdt_blocks; /* Per group table for online growth */ |
412 | /* | 412 | /* |
413 | * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. | 413 | * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. |
414 | */ | 414 | */ |
415 | uint8_t s_journal_uuid[16]; /* uuid of journal superblock */ | 415 | /*D0*/ uint8_t s_journal_uuid[16]; /* uuid of journal superblock */ |
416 | uint32_t s_journal_inum; /* inode number of journal file */ | 416 | /*E0*/ uint32_t s_journal_inum; /* inode number of journal file */ |
417 | uint32_t s_journal_dev; /* device number of journal file */ | 417 | uint32_t s_journal_dev; /* device number of journal file */ |
418 | uint32_t s_last_orphan; /* start of list of inodes to delete */ | 418 | uint32_t s_last_orphan; /* start of list of inodes to delete */ |
419 | uint32_t s_hash_seed[4]; /* HTREE hash seed */ | 419 | uint32_t s_hash_seed[4]; /* HTREE hash seed */ |
420 | uint8_t s_def_hash_version; /* Default hash version to use */ | 420 | uint8_t s_def_hash_version; /* Default hash version to use */ |
421 | uint8_t s_jnl_backup_type; /* Default type of journal backup */ | 421 | uint8_t s_jnl_backup_type; /* Default type of journal backup */ |
422 | uint16_t s_reserved_word_pad; | 422 | uint16_t s_reserved_word_pad; |
423 | uint32_t s_default_mount_opts; | 423 | /*100*/ uint32_t s_default_mount_opts; |
424 | uint32_t s_first_meta_bg; /* First metablock group */ | 424 | uint32_t s_first_meta_bg; /* First metablock group */ |
425 | /* ext3 additions */ | ||
425 | uint32_t s_mkfs_time; /* When the filesystem was created */ | 426 | uint32_t s_mkfs_time; /* When the filesystem was created */ |
426 | uint32_t s_jnl_blocks[17]; /* Backup of the journal inode */ | 427 | uint32_t s_jnl_blocks[17]; /* Backup of the journal inode */ |
427 | uint32_t s_reserved[172]; /* Padding to the end of the block */ | 428 | /* 64bit support valid if EXT4_FEATURE_COMPAT_64BIT */ |
429 | /*150*/ uint32_t s_blocks_count_hi; /* Blocks count */ | ||
430 | uint32_t s_r_blocks_count_hi; /* Reserved blocks count */ | ||
431 | uint32_t s_free_blocks_count_hi; /* Free blocks count */ | ||
432 | uint16_t s_min_extra_isize; /* All inodes have at least # bytes */ | ||
433 | uint16_t s_want_extra_isize; /* New inodes should reserve # bytes */ | ||
434 | uint32_t s_flags; /* Miscellaneous flags */ | ||
435 | uint16_t s_raid_stride; /* RAID stride */ | ||
436 | uint16_t s_mmp_interval; /* # seconds to wait in MMP checking */ | ||
437 | uint64_t s_mmp_block; /* Block for multi-mount protection */ | ||
438 | uint32_t s_raid_stripe_width; /* blocks on all data disks (N*stride)*/ | ||
439 | uint8_t s_log_groups_per_flex; /* FLEX_BG group size */ | ||
440 | uint8_t s_reserved_char_pad2; | ||
441 | uint16_t s_reserved_pad; | ||
442 | uint32_t s_reserved[162]; /* Padding to the end of the block */ | ||
443 | }; | ||
444 | struct BUG_ext2_super_block { | ||
445 | char bug[sizeof(struct ext2_super_block) == 1024 ? 1 : -1]; | ||
428 | }; | 446 | }; |
429 | 447 | ||
430 | /* | 448 | /* |
@@ -463,6 +481,7 @@ struct ext2_super_block { | |||
463 | #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ | 481 | #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ |
464 | ( EXT2_SB(sb)->s_feature_incompat & (mask) ) | 482 | ( EXT2_SB(sb)->s_feature_incompat & (mask) ) |
465 | 483 | ||
484 | /* for s_feature_compat */ | ||
466 | #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 | 485 | #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 |
467 | #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 | 486 | #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 |
468 | #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 | 487 | #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 |
@@ -470,23 +489,45 @@ struct ext2_super_block { | |||
470 | #define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 | 489 | #define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 |
471 | #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 | 490 | #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 |
472 | 491 | ||
492 | /* for s_feature_ro_compat */ | ||
473 | #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 | 493 | #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 |
474 | #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 | 494 | #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 |
475 | /* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 not used */ | 495 | #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 /* not used */ |
496 | #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008 | ||
497 | #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 | ||
498 | #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 | ||
499 | #define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 | ||
476 | 500 | ||
501 | /* for s_feature_incompat */ | ||
477 | #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 | 502 | #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 |
478 | #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 | 503 | #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 |
479 | #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ | 504 | #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 |
480 | #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ | 505 | #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 |
481 | #define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 | 506 | #define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 |
482 | #define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040 | 507 | #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 |
508 | #define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 | ||
509 | #define EXT4_FEATURE_INCOMPAT_MMP 0x0100 | ||
510 | #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 | ||
483 | 511 | ||
484 | 512 | ||
485 | #define EXT2_FEATURE_COMPAT_SUPP 0 | 513 | #define EXT2_FEATURE_COMPAT_SUPP 0 |
486 | #define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE) | ||
487 | #define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ | 514 | #define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ |
488 | EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ | 515 | EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ |
489 | EXT2_FEATURE_RO_COMPAT_BTREE_DIR) | 516 | EXT2_FEATURE_RO_COMPAT_BTREE_DIR) |
517 | #define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \ | ||
518 | EXT2_FEATURE_INCOMPAT_META_BG) | ||
519 | #define EXT2_FEATURE_INCOMPAT_UNSUPPORTED (~EXT2_FEATURE_INCOMPAT_SUPP) | ||
520 | #define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED (~EXT2_FEATURE_RO_COMPAT_SUPP) | ||
521 | |||
522 | #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ | ||
523 | EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ | ||
524 | EXT2_FEATURE_RO_COMPAT_BTREE_DIR) | ||
525 | #define EXT3_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \ | ||
526 | EXT3_FEATURE_INCOMPAT_RECOVER| \ | ||
527 | EXT2_FEATURE_INCOMPAT_META_BG) | ||
528 | #define EXT3_FEATURE_INCOMPAT_UNSUPPORTED (~EXT3_FEATURE_INCOMPAT_SUPP) | ||
529 | #define EXT3_FEATURE_RO_COMPAT_UNSUPPORTED (~EXT3_FEATURE_RO_COMPAT_SUPP) | ||
530 | |||
490 | 531 | ||
491 | /* | 532 | /* |
492 | * Default values for user and/or group using reserved blocks | 533 | * Default values for user and/or group using reserved blocks |
diff --git a/include/busybox.h b/include/busybox.h index 315ef8f26..b1e31e5ee 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -13,10 +13,10 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN | |||
13 | 13 | ||
14 | /* Defined in appletlib.c (by including generated applet_tables.h) */ | 14 | /* Defined in appletlib.c (by including generated applet_tables.h) */ |
15 | /* Keep in sync with applets/applet_tables.c! */ | 15 | /* Keep in sync with applets/applet_tables.c! */ |
16 | extern const char applet_names[]; | 16 | extern const char applet_names[] ALIGN1; |
17 | extern int (*const applet_main[])(int argc, char **argv); | 17 | extern int (*const applet_main[])(int argc, char **argv); |
18 | extern const uint16_t applet_nameofs[]; | 18 | extern const uint16_t applet_nameofs[]; |
19 | extern const uint8_t applet_install_loc[]; | 19 | extern const uint8_t applet_install_loc[] ALIGN1; |
20 | 20 | ||
21 | #if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS | 21 | #if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS |
22 | # define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff)) | 22 | # define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff)) |
diff --git a/include/libbb.h b/include/libbb.h index a78772b6a..5012209f8 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -346,6 +346,7 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ | |||
346 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 9, /* -c */ | 346 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 9, /* -c */ |
347 | FILEUTILS_SET_SECURITY_CONTEXT = 1 << 10, | 347 | FILEUTILS_SET_SECURITY_CONTEXT = 1 << 10, |
348 | #endif | 348 | #endif |
349 | FILEUTILS_IGNORE_CHMOD_ERR = 1 << 11, | ||
349 | }; | 350 | }; |
350 | #define FILEUTILS_CP_OPTSTR "pdRfilsLH" IF_SELINUX("c") | 351 | #define FILEUTILS_CP_OPTSTR "pdRfilsLH" IF_SELINUX("c") |
351 | extern int remove_file(const char *path, int flags) FAST_FUNC; | 352 | extern int remove_file(const char *path, int flags) FAST_FUNC; |
@@ -1301,6 +1302,7 @@ int sd_listen_fds(void); | |||
1301 | #define SETUP_ENV_CHANGEENV (1 << 0) | 1302 | #define SETUP_ENV_CHANGEENV (1 << 0) |
1302 | #define SETUP_ENV_CLEARENV (1 << 1) | 1303 | #define SETUP_ENV_CLEARENV (1 << 1) |
1303 | #define SETUP_ENV_TO_TMP (1 << 2) | 1304 | #define SETUP_ENV_TO_TMP (1 << 2) |
1305 | #define SETUP_ENV_NO_CHDIR (1 << 4) | ||
1304 | extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; | 1306 | extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; |
1305 | extern int correct_password(const struct passwd *pw) FAST_FUNC; | 1307 | extern int correct_password(const struct passwd *pw) FAST_FUNC; |
1306 | /* Returns a malloced string */ | 1308 | /* Returns a malloced string */ |
@@ -1629,8 +1631,8 @@ unsigned get_cpu_count(void) FAST_FUNC; | |||
1629 | char *percent_decode_in_place(char *str, int strict) FAST_FUNC; | 1631 | char *percent_decode_in_place(char *str, int strict) FAST_FUNC; |
1630 | 1632 | ||
1631 | 1633 | ||
1632 | extern const char bb_uuenc_tbl_base64[]; | 1634 | extern const char bb_uuenc_tbl_base64[] ALIGN1; |
1633 | extern const char bb_uuenc_tbl_std[]; | 1635 | extern const char bb_uuenc_tbl_std[] ALIGN1; |
1634 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; | 1636 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; |
1635 | enum { | 1637 | enum { |
1636 | BASE64_FLAG_UU_STOP = 0x100, | 1638 | BASE64_FLAG_UU_STOP = 0x100, |
@@ -1711,29 +1713,24 @@ extern const char *applet_name; | |||
1711 | * Therefore now we use #defines. | 1713 | * Therefore now we use #defines. |
1712 | */ | 1714 | */ |
1713 | /* "BusyBox vN.N.N (timestamp or extra_version)" */ | 1715 | /* "BusyBox vN.N.N (timestamp or extra_version)" */ |
1714 | extern const char bb_banner[]; | 1716 | extern const char bb_banner[] ALIGN1; |
1715 | extern const char bb_msg_memory_exhausted[]; | 1717 | extern const char bb_msg_memory_exhausted[] ALIGN1; |
1716 | extern const char bb_msg_invalid_date[]; | 1718 | extern const char bb_msg_invalid_date[] ALIGN1; |
1717 | #define bb_msg_read_error "read error" | 1719 | #define bb_msg_read_error "read error" |
1718 | #define bb_msg_write_error "write error" | 1720 | #define bb_msg_write_error "write error" |
1719 | extern const char bb_msg_unknown[]; | 1721 | extern const char bb_msg_unknown[] ALIGN1; |
1720 | extern const char bb_msg_can_not_create_raw_socket[]; | 1722 | extern const char bb_msg_can_not_create_raw_socket[] ALIGN1; |
1721 | extern const char bb_msg_perm_denied_are_you_root[]; | 1723 | extern const char bb_msg_perm_denied_are_you_root[] ALIGN1; |
1722 | extern const char bb_msg_you_must_be_root[]; | 1724 | extern const char bb_msg_you_must_be_root[] ALIGN1; |
1723 | extern const char bb_msg_requires_arg[]; | 1725 | extern const char bb_msg_requires_arg[] ALIGN1; |
1724 | extern const char bb_msg_invalid_arg[]; | 1726 | extern const char bb_msg_invalid_arg[] ALIGN1; |
1725 | extern const char bb_msg_standard_input[]; | 1727 | extern const char bb_msg_standard_input[] ALIGN1; |
1726 | extern const char bb_msg_standard_output[]; | 1728 | extern const char bb_msg_standard_output[] ALIGN1; |
1727 | 1729 | ||
1728 | /* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ | 1730 | /* NB: (bb_hexdigits_upcase[i] | 0x20) -> lowercase hex digit */ |
1729 | extern const char bb_hexdigits_upcase[]; | 1731 | extern const char bb_hexdigits_upcase[] ALIGN1; |
1730 | 1732 | ||
1731 | extern const char bb_path_wtmp_file[]; | 1733 | extern const char bb_path_wtmp_file[] ALIGN1; |
1732 | #if ENABLE_PLATFORM_MINGW32 | ||
1733 | #define bb_busybox_exec_path get_busybox_exec_path() | ||
1734 | #else | ||
1735 | extern const char bb_busybox_exec_path[]; | ||
1736 | #endif | ||
1737 | 1734 | ||
1738 | /* Busybox mount uses either /proc/mounts or /etc/mtab to | 1735 | /* Busybox mount uses either /proc/mounts or /etc/mtab to |
1739 | * get the list of currently mounted filesystems */ | 1736 | * get the list of currently mounted filesystems */ |
@@ -1747,9 +1744,14 @@ extern const char bb_busybox_exec_path[]; | |||
1747 | #define bb_path_motd_file "/etc/motd" | 1744 | #define bb_path_motd_file "/etc/motd" |
1748 | 1745 | ||
1749 | #define bb_dev_null "/dev/null" | 1746 | #define bb_dev_null "/dev/null" |
1747 | #if ENABLE_PLATFORM_MINGW32 | ||
1748 | #define bb_busybox_exec_path get_busybox_exec_path() | ||
1749 | #else | ||
1750 | extern const char bb_busybox_exec_path[] ALIGN1; | ||
1751 | #endif | ||
1750 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | 1752 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, |
1751 | * but I want to save a few bytes here */ | 1753 | * but I want to save a few bytes here */ |
1752 | extern const char bb_PATH_root_path[]; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ | 1754 | extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ |
1753 | #define bb_default_root_path (bb_PATH_root_path + sizeof("PATH")) | 1755 | #define bb_default_root_path (bb_PATH_root_path + sizeof("PATH")) |
1754 | #define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin")) | 1756 | #define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin")) |
1755 | 1757 | ||
@@ -1779,7 +1781,7 @@ extern struct globals *const ptr_to_globals; | |||
1779 | * If you change LIBBB_DEFAULT_LOGIN_SHELL, | 1781 | * If you change LIBBB_DEFAULT_LOGIN_SHELL, |
1780 | * don't forget to change increment constant. */ | 1782 | * don't forget to change increment constant. */ |
1781 | #define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh" | 1783 | #define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh" |
1782 | extern const char bb_default_login_shell[]; | 1784 | extern const char bb_default_login_shell[] ALIGN1; |
1783 | /* "/bin/sh" */ | 1785 | /* "/bin/sh" */ |
1784 | #define DEFAULT_SHELL (bb_default_login_shell+1) | 1786 | #define DEFAULT_SHELL (bb_default_login_shell+1) |
1785 | /* "sh" */ | 1787 | /* "sh" */ |
diff --git a/include/platform.h b/include/platform.h index 925cce60c..78d42fed9 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -301,7 +301,8 @@ typedef unsigned smalluint; | |||
301 | #define fdprintf dprintf | 301 | #define fdprintf dprintf |
302 | 302 | ||
303 | /* Useful for defeating gcc's alignment of "char message[]"-like data */ | 303 | /* Useful for defeating gcc's alignment of "char message[]"-like data */ |
304 | #if 1 /* if needed: !defined(arch1) && !defined(arch2) */ | 304 | #if !defined(__s390__) |
305 | /* on s390[x], non-word-aligned data accesses require larger code */ | ||
305 | # define ALIGN1 __attribute__((aligned(1))) | 306 | # define ALIGN1 __attribute__((aligned(1))) |
306 | # define ALIGN2 __attribute__((aligned(2))) | 307 | # define ALIGN2 __attribute__((aligned(2))) |
307 | # define ALIGN4 __attribute__((aligned(4))) | 308 | # define ALIGN4 __attribute__((aligned(4))) |
@@ -351,6 +352,12 @@ typedef unsigned smalluint; | |||
351 | # define MAXSYMLINKS SYMLOOP_MAX | 352 | # define MAXSYMLINKS SYMLOOP_MAX |
352 | #endif | 353 | #endif |
353 | 354 | ||
355 | #if defined(ANDROID) || defined(__ANDROID__) | ||
356 | # define BB_ADDITIONAL_PATH ":/system/sbin:/system/bin:/system/xbin" | ||
357 | # define SYS_ioprio_set __NR_ioprio_set | ||
358 | # define SYS_ioprio_get __NR_ioprio_get | ||
359 | #endif | ||
360 | |||
354 | 361 | ||
355 | /* ---- Who misses what? ------------------------------------ */ | 362 | /* ---- Who misses what? ------------------------------------ */ |
356 | 363 | ||