aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/chgrp.c
AgeCommit message (Collapse)Author
2020-08-18Add missing longopts alias for chgrp/chown and rmdirAntoni Villalonga
Heavily used long params under some contexts for already implemented options: chgrp/chown: Add alias '--no-dereference' for '-h' rmdir: Add alias '--parents' for '-p'
2020-02-02Canonicalize the usage: lines for the POSIX toys.Elliott Hughes
This only touches 24 of the 68 toys/posix/ files --- the others were already canonical. Potentially contentious, so worth stating explicitly, is that there were 8 matches for "COMMAND..." amongst all existing help output, with 7 matches for various inconsistent variants involving something with "ARG", so I resolved that in favor of using "COMMAND..." (which is also shorter overall, and avoids nested []s).
2019-03-04Don't print (null) in error messages.Rob Landley
2018-12-04Clean up some --help formatting.Elliott Hughes
Be consistent about upper versus lower case. (Upper seems to have the majority, so I went with that, though I'm happy to provide the opposite patch as long as we're consistent!) Be consistent about using \t. (Though saving a few bytes seems like it might be better done in the code that generates help.h rather than directly in the source, since tabs make careful ASCII art layout hard enough that we regularly have things misaligned.) Remove trailing periods (most of which seem to have been added by me). Always use the US "human readable" rather than my British "human-readable", and be more consistent about declaring whether we're showing multiples of 1000 or 1024. Just say "verbose" rather than adding a useless "mode" or "output".
2017-05-26Be more consistent about periods in help text.Elliott Hughes
2016-08-18Change xgetpwnamid/xgetgrnamid to xgetuid/xgetgid returning the id numberRob Landley
instead of a struct. This means it can return "12345" even if that user/group doesn't exist in /etc/passwd and similar. All the users were immediately dereferencing it to get pw_uid or gr_gid anyway, so just return it directly and adjust the users. This fixes things like "chown 12345:23456 filename".
2016-03-07Cleanup pass on the dirtree infrastructure, in preparation for making rm -rRob Landley
handle infinite depth. Fix docs, tweak dirtree_handle_callback() semantics, remove dirtree_start() and don't export dirtree_handle_callback(), instead offer dirtree_flagread(). (dirtree_read() is a wrapper around dirtree_flagread passing 0 for flags.)
2015-05-09Add DIRTREE_SHUTUP to disable dirtree warnings if file vanishes out fromRob Landley
under traversal. Pass through full flag set in dirtree_add_node(), add dirtree_start() wrapper to provide symlink-only behavior (avoiding a lot of DIRTREE_SYMFOLLOW*!!(logic) repeated in callers).
2015-03-12Factor out xgetgrnamid() and xgetpwnamid() into xwrap.c.Rob Landley
2015-01-14i found a few problems while manually smoke testing toybox chown versus ↵Elliott Hughes
toolbox (NetBSD) chown... new test: and here's the patch to fix "owner:" ":group" and the ":" special case:
2015-01-14Let chown build standalone.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-10-09Fix use-after-free spotted by Ashwini Sharma's static analysis.Rob Landley
We xstrdup() an optargs string to avoid modifying our environment space (because it can change what "ps" shows to other processes), and then parse out colon delimited strings and save them in globals that can later be used in the -v codepath and so on. But those globals _aren't_ strdup (no point) which means we can't free the string while we're still using pointers into the middle of it. So move the free to the end. (I hardly ever test with CFG_TOYBOX_FREE switched on because even nommu doesn't need it.)
2014-07-26Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still ↵Rob Landley
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
2013-08-18Use OPTSTR_command macro for more oldtoys, to avoid keeping two option ↵Rob Landley
strings in sync. (todo: figure out how to make OLDTOY() automatically use macro. Still need the raw version for subset ala cp/mv though.)
2013-02-22Fix a warning when debug code enabled.Rob Landley
2013-01-02Have error_msg() and friends set TT.exitval to 1 if it's still 0, clean out ↵Rob Landley
other places that were setting it that no longer need to.
2012-12-31Make dirtree_handle_callback() start with dirtree_ like the rest of the ↵Rob Landley
dirtree functions.
2012-12-06Have dirtree_add_node() set parent so error message can provide full path.Rob Landley
2012-11-13Reindent to two spaces per level. Remove vi: directives that haven't worked ↵Rob Landley
right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring.
2012-10-08New build infrastructure to generate FLAG_ macros and TT alias, #define ↵Rob Landley
FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
2012-08-25Regularize command headers, update links to standards documents.Rob Landley
2012-08-25Move commands into "posix", "lsb", and "other" menus/directories.Rob Landley