[Toybox] [PATCH] Fix cp.test to pass even if you're root or have a restrictive umask.

enh enh at google.com
Wed Jun 26 12:21:42 PDT 2019


On Tue, Jun 25, 2019 at 4:54 PM Rob Landley <rob at landley.net> wrote:
>
> Wait...
>
> $ touch walrus
> $ chmod 000 walrus
> $ sudo /bin/bash
> # echo hello > walrus
> # ls -l walrus
> ---------- 1 landley landley 6 Jun 25 18:51 walrus
>
> Really, Linux? Seriously?
>
> That's... wow. Ok, I need to work out how to restructure this test because the
> kernel is INSANE. (You can already chmod any file, the ability to accidentally
> "dmesg > /bin/sh" is gratuitous bull in a china shop levels of authority here.)

this isn't Linux's fault... this is true of every Unix i remember
using. (and i just checked that macOS has the same behavior.)

as far as i'm concerned, i really ought to run all the tests twice --
since toybox can be used in either context -- and annotating the ones
that require root/not-root seems fine to me.

> # cat /proc/sysrq-trigger
> cat: /proc/sysrq-trigger: Input/output error
>
> They should not need to implement multiple codepaths here. But they did. Sigh...
>
> Rob



More information about the Toybox mailing list