On Fri Dec 1 19:11:16 2023 +0000, Rémi Bernon wrote:
Ah yeah looks like you're right... Hmm. The server priority might matter in the case where it's privileged where maybe it can succeed regardless of the target rlimit? The `min` is probably somehow there tell between the two, but only if we assume the rlimit isn't changed between wineserver start and process start, so maybe a dedicated flag would be better to handle the privileged case.
Hm it seems to me like every process can set its own niceness to [limit, 19]. Making the assumption that the hard limit for wineserver and wine processes are the same (which it probably always will be unless the user did something special), there probably is no need to send back the nice limit of the target process, only for each to raise its limit.
For CAP_SYS_NICE (or euid 0) though the target process limit does not matter at all, so taking the -20 limit of the server there should be fine as well.
Would be a partial revert of https://gitlab.winehq.org/wine/wine/-/merge_requests/4551/diffs?commit_id=89... and adjusting the logic to go from [limit, -limit] to [limit, 19], unless they have to be symmetrical?