extend pragma(msg) with writing to file
Andrey Zherikov
andrey.zherikov at gmail.com
Mon Oct 10 15:18:22 UTC 2022
On Monday, 10 October 2022 at 12:59:30 UTC, kdevel wrote:
> On Monday, 10 October 2022 at 01:10:42 UTC, Andrey Zherikov
> wrote:
>> What additional security risks do you see if writing has the
>> same restrictions as reading: requires command line option
>> (error out otherwise) and be allowed to create files under
>> specified (by CLI) folder only?
>
> If the context which invokes `dmd -J` already has write
> permission and the source code of the context and the source
> code handed over to dmd is of same origin then none.
I don't think that `-J` should support writing so let's introduce
new CLI option, say `-pragma-out=<dir>`. Now, if context that
invokes `dmd -pragma-out` has no write permissions then
compilation should error out when it tries to write to file.
Regarding "source code of the context", I'm not sure I get what
you mean here. If you mean something that calls dmd then is it
makefile or build tool? The first one is usually written by
owners of the code you are compiling, the second one is not.
More information about the Digitalmars-d
mailing list