Age | Commit message (Collapse) | Author |
|
Note: can't put in portability.h because it's a linux/ include.
|
|
Also fix another bug where we were testing `set` twice.
Fixes https://github.com/landley/toybox/issues/172.
|
|
The e2fsprogs chattr(1) returns failure when it fails to do what was
asked of it, and so should we. Fixing this then reveals a lot of issues
with the tests that were being accidentally swept under the carpet.
The bulk of this patch is going through all the tests, removing the
duplicates and making the remaining tests more thorough.
I've tested this on ext4 and f2fs on a variety of 4.x and 5.x kernel
versions (but nothing older). We might need to reduce the list of
attribtues we try to toggle, but the more thorough tests use
well-supported attributes.
I've also fixed the -R test to actually involve a directory hierarchy.
|
|
When chattr fails in production, it helps to see what it was trying to
do. Reuse the lsattr format but without the '-'s.
Only read the flags if we have any intention of changing them:
`chattr -p 123` has no reason to read the flags.
Only write the flags back if they actually change: `chattr +a`
shouldn't do anything if that flag is already set, for example.
Switch -p and -v to perror_msg() instead of perror_exit() in case
they're used with -R.
(I suspect that the uses of DIRTREE_ABORT are mistakes given -R, but
I'll leave them until I actually hit this.)
|
|
Rewrite -v and -p to not use ad hoc argument parsing.
|
|
Document all the attributes, and take less space doing so.
Switch to CAPITALS for user input in the synopses.
Don't imply that this is only for ext2 (but also don't try to list the
subset of file systems that do support which subset of attributes).
|
|
Add support for setting projid in chattr, and dumping it in lsattr.
Also fix the lsattr output formatting, and undo my well-intentioned
sorting of the flags because that broke the ordering in the lsattr terse
output.
|
|
Also update help to include flags that were already added. Remove
useless duplicative comments. Swich to FLAG macros.
|
|
|
|
|
|
|
|
|
|
|
|
open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
|
|
This is the modified and better version from the last one I sent.
It is having the both the mains (lsattr_main() and chattr_main() )
in single file.
Also removed the dependency of additional file in lib, as common code is in the
same .c file.
|