aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.src.h40
-rw-r--r--include/bb_archive.h1
-rw-r--r--include/bb_e2fs_defs.h63
-rw-r--r--include/busybox.h4
-rw-r--r--include/libbb.h46
-rw-r--r--include/platform.h9
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
70IF_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))
71IF_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))
72IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) 72IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP))
73IF_ADDGROUP(APPLET(addgroup, BB_DIR_BIN, BB_SUID_DROP)) 73IF_ADDGROUP(APPLET(addgroup, BB_DIR_USR_SBIN, BB_SUID_DROP))
74IF_ADDUSER(APPLET(adduser, BB_DIR_BIN, BB_SUID_DROP)) 74IF_ADDUSER(APPLET(adduser, BB_DIR_USR_SBIN, BB_SUID_DROP))
75IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) 75IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP))
76IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP)) 76IF_AR(APPLET(ar, BB_DIR_USR_BIN, BB_SUID_DROP))
77IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) 77IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP))
78IF_ARPING(APPLET(arping, BB_DIR_USR_BIN, BB_SUID_DROP)) 78IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP))
79IF_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))
80IF_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))
81IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) 81IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP))
@@ -86,7 +86,7 @@ IF_BZIP2(APPLET(bzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
86IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) 86IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP))
87IF_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))
88IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) 88IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP))
89IF_CHAT(APPLET(chat, BB_DIR_USR_BIN, BB_SUID_DROP)) 89IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP))
90IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP)) 90IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP))
91IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) 91IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP))
92IF_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))
@@ -111,8 +111,8 @@ IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut))
111IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP)) 111IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP))
112IF_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))
113IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP)) 113IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP))
114IF_DELGROUP(APPLET_ODDNAME(delgroup, deluser, BB_DIR_BIN, BB_SUID_DROP, delgroup)) 114IF_DELGROUP(APPLET_ODDNAME(delgroup, deluser, BB_DIR_USR_SBIN, BB_SUID_DROP, delgroup))
115IF_DELUSER(APPLET(deluser, BB_DIR_BIN, BB_SUID_DROP)) 115IF_DELUSER(APPLET(deluser, BB_DIR_USR_SBIN, BB_SUID_DROP))
116IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP)) 116IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP))
117IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) 117IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP))
118IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) 118IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP))
@@ -136,7 +136,7 @@ IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP))
136IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) 136IF_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)) 137IF_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)) 138IF_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)) 139IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_SBIN, BB_SUID_DROP, ether_wake))
140IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) 140IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP))
141IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) 141IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP))
142IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) 142IF_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))
144IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) 144IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP))
145IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP)) 145IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP))
146IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) 146IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush))
147IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_BIN, BB_SUID_DROP)) 147IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP))
148IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) 148IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP))
149IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) 149IF_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))
182IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) 182IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP))
183IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown)) 183IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown))
184IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) 184IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP))
185IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_BIN, BB_SUID_DROP)) 185IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP))
186IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup)) 186IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup))
187IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) 187IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP))
188IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP)) 188IF_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
196IF_IP(APPLET(ip, BB_DIR_BIN, BB_SUID_DROP)) 196IF_IP(APPLET(ip, BB_DIR_SBIN, BB_SUID_DROP))
197#endif 197#endif
198IF_IPADDR(APPLET(ipaddr, BB_DIR_BIN, BB_SUID_DROP)) 198IF_IPADDR(APPLET(ipaddr, BB_DIR_SBIN, BB_SUID_DROP))
199IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) 199IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP))
200IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) 200IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP))
201IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) 201IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP))
202IF_IPLINK(APPLET(iplink, BB_DIR_BIN, BB_SUID_DROP)) 202IF_IPLINK(APPLET(iplink, BB_DIR_SBIN, BB_SUID_DROP))
203IF_IPROUTE(APPLET(iproute, BB_DIR_BIN, BB_SUID_DROP)) 203IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP))
204IF_IPRULE(APPLET(iprule, BB_DIR_BIN, BB_SUID_DROP)) 204IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP))
205IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_BIN, BB_SUID_DROP)) 205IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP))
206IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_USR_BIN, BB_SUID_DROP)) 206IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP))
207IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) 207IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP))
208IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) 208IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall))
209IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall5)) 209IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5))
210IF_KLOGD(APPLET(klogd, BB_DIR_SBIN, BB_SUID_DROP)) 210IF_KLOGD(APPLET(klogd, BB_DIR_SBIN, BB_SUID_DROP))
211IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP)) 211IF_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))
288IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP)) 288IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP))
289IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) 289IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP))
290IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) 290IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP))
291IF_READAHEAD(APPLET(readahead, BB_DIR_USR_BIN, BB_SUID_DROP)) 291IF_READAHEAD(APPLET(readahead, BB_DIR_USR_SBIN, BB_SUID_DROP))
292IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) 292IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP))
293IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) 293IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP))
294IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) 294IF_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))
303IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) 303IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP))
304IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP)) 304IF_RPM(APPLET(rpm, BB_DIR_BIN, BB_SUID_DROP))
305IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP)) 305IF_RPM2CPIO(APPLET(rpm2cpio, BB_DIR_USR_BIN, BB_SUID_DROP))
306IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_BIN, BB_SUID_DROP)) 306IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP))
307IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) 307IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts))
308IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) 308IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP))
309IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) 309IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP))
@@ -365,7 +365,7 @@ IF_TELNETD(APPLET(telnetd, BB_DIR_USR_SBIN, BB_SUID_DROP))
365IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) 365IF_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
367IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) 367IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP))
368IF_TFTPD(APPLET(tftpd, BB_DIR_USR_BIN, BB_SUID_DROP)) 368IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
369#endif 369#endif
370IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP)) 370IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP))
371IF_TIMEOUT(APPLET(timeout, BB_DIR_USR_BIN, BB_SUID_DROP)) 371IF_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};
444struct 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! */
16extern const char applet_names[]; 16extern const char applet_names[] ALIGN1;
17extern int (*const applet_main[])(int argc, char **argv); 17extern int (*const applet_main[])(int argc, char **argv);
18extern const uint16_t applet_nameofs[]; 18extern const uint16_t applet_nameofs[];
19extern const uint8_t applet_install_loc[]; 19extern 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")
351extern int remove_file(const char *path, int flags) FAST_FUNC; 352extern 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)
1304extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC; 1306extern void setup_environment(const char *shell, int flags, const struct passwd *pw) FAST_FUNC;
1305extern int correct_password(const struct passwd *pw) FAST_FUNC; 1307extern 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;
1629char *percent_decode_in_place(char *str, int strict) FAST_FUNC; 1631char *percent_decode_in_place(char *str, int strict) FAST_FUNC;
1630 1632
1631 1633
1632extern const char bb_uuenc_tbl_base64[]; 1634extern const char bb_uuenc_tbl_base64[] ALIGN1;
1633extern const char bb_uuenc_tbl_std[]; 1635extern const char bb_uuenc_tbl_std[] ALIGN1;
1634void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; 1636void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC;
1635enum { 1637enum {
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)" */
1714extern const char bb_banner[]; 1716extern const char bb_banner[] ALIGN1;
1715extern const char bb_msg_memory_exhausted[]; 1717extern const char bb_msg_memory_exhausted[] ALIGN1;
1716extern const char bb_msg_invalid_date[]; 1718extern 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"
1719extern const char bb_msg_unknown[]; 1721extern const char bb_msg_unknown[] ALIGN1;
1720extern const char bb_msg_can_not_create_raw_socket[]; 1722extern const char bb_msg_can_not_create_raw_socket[] ALIGN1;
1721extern const char bb_msg_perm_denied_are_you_root[]; 1723extern const char bb_msg_perm_denied_are_you_root[] ALIGN1;
1722extern const char bb_msg_you_must_be_root[]; 1724extern const char bb_msg_you_must_be_root[] ALIGN1;
1723extern const char bb_msg_requires_arg[]; 1725extern const char bb_msg_requires_arg[] ALIGN1;
1724extern const char bb_msg_invalid_arg[]; 1726extern const char bb_msg_invalid_arg[] ALIGN1;
1725extern const char bb_msg_standard_input[]; 1727extern const char bb_msg_standard_input[] ALIGN1;
1726extern const char bb_msg_standard_output[]; 1728extern 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 */
1729extern const char bb_hexdigits_upcase[]; 1731extern const char bb_hexdigits_upcase[] ALIGN1;
1730 1732
1731extern const char bb_path_wtmp_file[]; 1733extern const char bb_path_wtmp_file[] ALIGN1;
1732#if ENABLE_PLATFORM_MINGW32
1733#define bb_busybox_exec_path get_busybox_exec_path()
1734#else
1735extern 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
1750extern 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 */
1752extern const char bb_PATH_root_path[]; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ 1754extern 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"
1782extern const char bb_default_login_shell[]; 1784extern 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