Redirect "/dev/null"
fails with Error: System error: "/dev/null.out: Operation not permitted"
— is there a better way, or does even this case need a change (like possibly https://github.com/coq/coq/pull/17724) ?
I think that's a smart change. We want the out file to be exactly what the user wrote.
I think the .out was a mild security consideration before. But I am not too sure how serious this is.
If we deem it undesirable to output to an arbitrary file, I suppose we can extend Redirect
to include Redirect Null
or something which would point to /dev/null
and an equivalent on windows.
Another question is what is the use case for redirecting to /dev/null? Simply to silence stdout/stderr?
Then doing that with a better output infrastructure might be the more sensible thing to do. There is much cleanup we can do on this front.
yes, Redirect "/dev/null" Check (foo : bar).
runs the command while hiding its output, I'm sure alternatives exist.
or rather: alternatives could be designed. But I'm not sure what are the other use-cases for Redirect
beyond Redirect Null
?
@Emilio Jesús Gallego Arias also mentioned security, and I agree Redirect
gives the attacker more power than coqc
, but much less than make
or even dune
with run
rules. This seems a real problem for JsCoq (so it should disable Redirect
altogether), but it seems to make no difference when you're building hostile code. VsCode plugins should refuse invoking build systems unless the project is trusted by the user.
But I see more of the discussion is happening on https://github.com/coq/coq/pull/17724 — my bad.
Last updated: Oct 13 2024 at 01:02 UTC