-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added child_user and child_group to CreateProcess for unix. #45
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
bc4e5e6
Added child_user and child_group to CreateProcess for unix.
jprider63 932fe34
Addresses comments from #45. Feel free to squash.
jprider63 296535e
Revert "Addresses comments from #45. Feel free to squash."
jprider63 2397d4f
Updated `CreateProcess` documentation after revert.
jprider63 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that a CGid or CUid is just an
int
, I think this can be done without the pointer indirection, by using-1
to represent "not provided."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made this change in the latest commit, but I'm worried that there could be conflicts since
uid_t
andgid_t
are unsigned. It might be better to go with the original.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The research I did before making my comment implied that:
-1
value is considered reservedI could be mistaken on this, however. I'm OK with either approach, it just struck me as strange to use a pointer for integral data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that signedness will vary by platform. Do you have a reference that says
-1
is reserved? My concern was that on an unsigned system,-1
could be interpreted as max_int (which although unlikely could be a user's/group's id).I suppose another option would be to add another mask to the flag indicating whether the set the user/group or not. Maybe this is the safest approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I've found:
http://pubs.opengroup.org/onlinepubs/009695399/functions/chown.html
http://stackoverflow.com/questions/21370094/uid-t-type-is-signed-or-not
I wouldn't bother with a mask on the flag, I'd either stick with your original pointer approach or use
-1
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like using
-1
is probably ok, but I'm still skeptical since setgid's and setuid's documentation don't mention it. I'll revert to the pointer approach since I think it's the safer option.