aboutsummaryrefslogtreecommitdiff
path: root/main.c
AgeCommit message (Collapse)Author
2018-09-16It should never matter on Linux (where the top half of virtual address spaceRob Landley
is reserved for the kernel), but technically a pointer is unsigned long.
2018-07-02Dereference one layer of symlink in multiplexer on lookup failure, so you canRob Landley
"ln -s gsed sed" or similar if you need to use nonstandard names for things.
2018-06-23News and version update for 0.7.7 release.0.7.7Rob Landley
2018-02-24Update version string to 0.7.6.0.7.6Rob Landley
2017-10-21Use setlocale(LC_CTYPE, "C.UTF-8") for more targeted locale enable:Rob Landley
(only enable character parsing, force utf8, "C" semantics otherwise.)
2017-10-19Elliott wants to add TOYBOX_VENDOR.Rob Landley
2017-06-19Past time for 0.7.4.0.7.4Rob Landley
2017-05-23fixup code styleJoyounger
Signed-off-by: Joyounger <aquanox@163.com>
2017-02-21It's past time for 0.7.3.0.7.3Rob Landley
2017-02-17Fix the comment about the Android SIGPIPE behavior.Elliott Hughes
2017-02-10Add back bionic SIGPIPE handler workaround accidentally removed in 3b51a07e478dRob Landley
2016-10-20Announce 0.7.2.0.7.2Rob Landley
2016-10-17The recent --help infrastructure fiddling made "toybox --help unknown" segfaultRob Landley
because lookup failure left this->which NULL and error_exit() dereferenced it. (Oops.)
2016-10-01Move --version handling next to --help handling, so it applies to all commands.Rob Landley
Say "toybox" before version string. Tweak sed to preserve lie-to-autoconf.
2016-08-13Add TOYFLAG_NOHELP to disable --help processing for individual commands,Rob Landley
apply it to "true" and "false".
2016-06-30Fix option parsing infrastructure bug.Rob Landley
In main.c: used adjusted string with placeholers for removed options (so flag values don't move based on config, allowing FORCE_FLAGS to work). In scripts/mkflags.c: test was wrong, a bare longopt never matches a single letter command, but it was treated as always matching when comparing allyesconfig vs current config to determine which options were disabled, so there was a corner case that got the flag values wrong.
2016-06-05Fix TOYBOX_VERSIONPaul Barker
The latest tagged version is 0.7.1.
2016-05-10Use CFG_TOYBOX_NORECURSE to avoidRob Landley
<strike>all that tedious mucking about with hyperspace</strike> stack measuring in ways that confuse security stuff.
2016-05-07Work around increasingly insane compiler developers wanting to make everythingRob Landley
undefined behavior so the optimizer can silently eliminate your entire program.
2016-04-10Didn't check in all my local basename_r->getbasename changes. (Oops.)Rob Landley
2016-02-10main.c: fix non-root usage when installed suid rootPatrick Ohly
When toybox is installed suid root and invoked by a non-root user for commands which do not require root privileges, it drops the root privileges during initialization. However, since commit afba5b8efd the result check of setuid() was inverted such that it aborted on success, making toybox unusuable for non-root users. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2016-02-02Release time.0.7.0Rob Landley
Calling it 0.7.0 because the fullscreen (cursor/utf8) infrasructure is in now.
2016-01-30Fix two CFG_TOYBOX_SUID corner cases:Rob Landley
1) Don't try to force re-exec unless we actually dropped permissions. (Fixes "./toybox mount" when no suid bit on toybox binary, which previously exited.) 2) Set temporary toys.which value for error reporting. (Fixes "ln -s toybox mount && ./mount" with CFG_TOYBOX_DEBUG and no suid bit, which previously segfaulted.)
2015-11-03Version 0.6.10.6.1Rob Landley
2015-09-27Another chunk of nommu support, replacing toys.recursion with toys.stacktop.Rob Landley
2015-09-11Replace toys.exithelp with help_exit() in lib.Rob Landley
2015-08-06Make multiplexer's "command not found" exit 127.Rob Landley
Somebody (carsonh on freenode) objected that they were running something like "toybox test 1 == 2" and couldn't distinguish the test failing from toybox not having the test command. Why they were running toybox out of the multiplexer instead of having a test symlink in the $PATH, I couldn't tell you. (Is "I know toybox is on this system, but don't know how it was configured" a problem people actually have?) *shrug* They care about it more than I do, so now you can't distinguish between the multiplexer not being found and the command the multiplexer tried to run not being found. Progress!
2015-07-19Tweak version number.Rob Landley
2015-05-03Replace android-specific hack with just signal(SIGPIPE, SIG_IGN).Rob Landley
2015-04-30Add default sigpipe handler for android (as suggested by Elliott Hughes).Rob Landley
2015-04-17Make toybox --version use the "git describe" info if it's available.Rob Landley
2015-04-07Adding --version broke ./toybox command list. (Oops.)Rob Landley
2015-04-05Add --version to multiplexer.Rob Landley
Can't think of a better place to stick the actual version info than a #define at the top of main. Makefile and toys.h are equally awkward, querying git tags wouldn't work if building a release tarball... watch me forget to update this when cutting a release.
2015-03-06The "no }" error with find | xargs sed is because toy_init() wasn't blanking ↵Rob Landley
the GLOBALS() block on a recursive call. (How that ever worked...)
2015-02-15Only discard optargs in toy_exec() after finding the command to run ↵Rob Landley
(otherwise the fallback exevp() segfaults).
2015-02-07Make toy_exec() check if argc is in optargs and deal with it there so we ↵Rob Landley
don't need a separate xexec_optargs().
2015-01-18Remove trailing whitespace.Rob Landley
2015-01-03Move fflush() checking to xexit() and have exit paths in main() call that.Rob Landley
2014-12-31Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag ↵Rob Landley
macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags). This means the flag space is no longer packed, but leaves gaps where the zeroes go. (Actual flag bit positions are the same for all configs.) Since the option parsing needs to know where the holes are, the OPTSTR values are now generated as part of flags.h with ascii 1 values for the disabled values. (So generated/oldflags.h went away.) This also means that the option string argument for OLDTOY() went away, it now uses the same arguments as the NEWTOY() it references.
2014-11-29The "re-exec to regain root permissions" logic broke the error message when ↵Rob Landley
calling root-only commands through the multiplexer. It would say "no such command" when it should say "not root".
2014-10-26Cosmetic tweak: no trailing spaces when ./toybox lists command names.Rob Landley
2014-09-27Don't segfault for --help of single.sh build of OLDTOY commands that use ↵Rob Landley
another command's help.
2014-09-20Always call setlocale if I18N is enabled, so nested toy_exec() can switch it ↵Rob Landley
back off if necessary.
2014-09-09Two problems: 1) Sometimes toy_exec() needs to re-exec to gain dropped root ↵Rob Landley
permissions, 2) shouldn't recurse forever without exec, stack depth increases and we may leak other resources. Limit it to ~5 levels.
2014-08-31Give a hint when setuid logic fails.Rob Landley
Toybox expects to be setuid root; setuid some other user confuses the attempt to drop privileges, and we err on the side of avoiding shenanigans.
2014-06-21Forgot to check in main() part of TOYFLAG_LOCALE change.Rob Landley
2014-06-11Move toys.toycount initialization _after_ zeroing toys, so help -a works again.Rob Landley
2014-05-24The "not root" test happens before looking for --help, so "./sulogin --help" ↵Rob Landley
doesn't show it. Instead make the "not root" failure case always show help text.
2014-05-21Add generic_signal() handler, which sets toys.signal and writes byte to ↵Rob Landley
toys.signalfd if set.
2014-04-01bugfix: the multiplexer increments optc and then the command the multiplexer ↵Rob Landley
runs increments it further, resulting in a wrong count. Fix: zero it.