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

checkpath should respect --user and/or --owner for symlink ownership #773

Open
sevmonster opened this issue Jan 26, 2025 · 0 comments
Open

Comments

@sevmonster
Copy link

In checkpath, symbolic links in the path are tested to see if they are owned by root. I am not sure I understand why this is, especially when the owner of the target path can be specified, and moreso now when user mode exists (-U). It seems very likely that there could be a link in the path not owned by root in one of the latter two cases, so why is this hardcoded for all situations?

Sure, when running root-owned or other privileged services, this could help with security, as a non-root link could be abused by its owner to change where it points. But it's just as possible a service could have links in its own directory that it manages, and when running in user mode, having something owned by root in a user's home directory would be strange to begin with—any links are probably going to be owned by the user.

In my particular case, I am trying to test if a path exists from within a user init script, and the path contains a symbolic link inside the user's home directory that points to mounted storage. All paths involved are owned by the user, and checkpath bails because of it before it can do anything.

I think ownership should be compared with a list. System services without checkpath -o should check if the link is owned by root. Specifying -o adds that user to the list. -U should add the running user. At max you could have 3 potential owners with both -U and -o.

@sevmonster sevmonster changed the title checkpath should respect --user checkpath should respect --user for symlink ownership Jan 26, 2025
@sevmonster sevmonster changed the title checkpath should respect --user for symlink ownership checkpath should respect --user and/or --owner for symlink ownership Jan 26, 2025
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

1 participant