lunatic-solutions/lunatic-rs

ProcessConfig::new can fail, but will not report this

HurricanKai opened this issue · 1 comments

This is quite the dangerous bug for users that assume they are spawning processes with reduced privileges, but this will not be the case.
ProcessConfig::new is expected to return a config with no privileges, but, if the calling process does not itself have the privilege of creating configs, will simply return -1, indicating that privileges are inherited from the parent instead.

In my opinion ProcessConfig::new should return a Result<ProcessConfig, _>. Most process would simply expect this, in which case the missing privilege can simply be added, but no security hole is created.

I just pushed out 0.11.3 with a fix. Now ProcessConfig::new will return a Result.