Skip to content
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

Reconsider #44 (change user and group) #230

Open
blackgnezdo opened this issue Jan 12, 2022 · 2 comments
Open

Reconsider #44 (change user and group) #230

blackgnezdo opened this issue Jan 12, 2022 · 2 comments

Comments

@blackgnezdo
Copy link
Contributor

blackgnezdo commented Jan 12, 2022

The capability to change user and group was added 6 years ago in #45. There a few reasons why I believe this feature may not be pulling its weight:

  • doing setuid dance correctly in a cross-platform way is hard (consider how much effort openssh-portable goes through)
  • there's a TODO acknowledging the questionable correctness of the implementation
  • posix_spawn API doesn't support this capability so this feature requires keeping both code paths and runtime fall-back which is unlikely to be a well-tested scenario.
  • no tests cover this functionality (because it is really inconvenient to test)

@jprider63 do you still use this feature that you added? Can somebody think of a way to survey the ecosystem to figure out how much usage the feature received?

In summary, I believe the feature is likely not secure, contains race conditions, complicates the codebase, and has no tests. This seems like a good candidate for removal.

@jprider63
Copy link

Hi @blackgnezdo. Yes, child_user and child_group are still used in internal code.

@bgamari
Copy link
Contributor

bgamari commented Jan 14, 2022

For what it's worth, I tend to agree that user and group changing isn't pulling its weight. This sort of functionality is extremely platform-dependent and ripe for nasty (potentially exploitable) bugs (e.g. #149).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants