Conversation
Except when loading the configuration, the content of all those strings is not supposed to change during the execution of the program. Even then, the mutation should only occur in the triton module before exposing those strings to consumption. This patch changes the pppd_compat module to actually reflect this fact by marking their configuration strings as const. Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
Apparently, execve() only has one level of const marker in order not to break existing code, but it is not supposed to mutate the content, hence the safety of casting our strings at the last moment. The general pattern when initializing an array of const structures is to first generate the instances as we want them, and only when they're ready do we insert them into the array. That's the reason behind the changes when filling the argv array, as the previous version did it in the reverse order. Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
The argument sanitation for the various executable paths that can be provided to this module is very generic, this patch cuts through some of the boilerplate. Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
The only part of the code that should be able to make changes to this data should be triton itself, as it knows if there are potential consumers of the data running. Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
Clang emits a warning about the previous syntax, as it might have been a typo for '-='. This commit simply move the minus operator next to its operand. Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
The configuration option are not for this code to change. Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
Signed-off-by: Simon Chopin <s.chopin@alphalink.fr>
|
Dear @laarmen, Can you open a PR at "good" place: Thanks in advance. |
themiron
pushed a commit
to themiron/accel-ppp
that referenced
this pull request
Jul 29, 2026
ci: use ubuntu 24.04 as default runner in github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As they say, "shared mutable state is the root of all evil". This patch series clearly marks the triton code as the owner of the configuration objects, making their content internal. Most of the changes are simply changing the client code to use the proper type, with the exception of pppd_compat.
There, the changes are a bit more involved, as the
const char *pointers end up being fed to an API that takes inchar *arguments for historical reasons. Detailed explanations can be found in the commit logs.