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

Timestamp path gets created with primary group of user who invokes doas #47

Open
djmattyg007 opened this issue Jan 29, 2021 · 1 comment

Comments

@djmattyg007
Copy link

When I enable the persist keyword and run doas, /run/doas gets created with the user root and the group djmattyg007. The permissions are correct (0600), so my non-privileged user account doesn't have access to the directory. It just seems strange that the group on the directory wouldn't also be root.

@Duncaen
Copy link
Owner

Duncaen commented Jan 29, 2021

This was not done as I thought there was a TOCTU between mkdir(2) and chown(2) and that extra steps would be required to make sure not to chown(2) a different directory or a symlink.

But thinking about it now, I don't think there would be a TOCTU issue.

  • mkdir(2) would return an error if the directory already exists so that the chown(2) immediately after mkdir(2) without extra checks would be safe as I understand it currently.
  • mkdir(2) would return an error if the directory it tries to create is a dangling symlink so that is also not a problem.

All in all, maybe this can be changed if its safe, but also does not really change anything effectively as the mode is already restrictive and checked every time the directory will be used.

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

2 participants