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

gpclient rootless with capabilites: /var/run/gpclient.lock: Permission denied #440

Open
t-nil opened this issue Nov 11, 2024 · 1 comment

Comments

@t-nil
Copy link

t-nil commented Nov 11, 2024

fs::write(GP_CLIENT_LOCK_FILE, pid.to_string()).unwrap();

This fails when running gpclient rootless with capabilites (`sudo capsh --caps='cap_net_admin+eip cap_setpcap,cap_setuid,cap_setgid+ep' --user=nobody --keep=1 --addamb=cap_net_admin -- -c 'gpclient connect […] --csd-wrapper /usr/lib/openconnect/hipreport.sh --user […]'), because only root can write in that directory. I think a fix would be to use $XDG_RUNTIME_DIR (or, better yet, /tmp/gpclient_.lock or something, since $XDG_RUNTIME_DIR only exists if you use a user who is logged in).

Would such a change be acceptable?

In other notes, why does gpclient lock in the first place? Is ist the goal to only launch one application per user?

@yuezk
Copy link
Owner

yuezk commented Nov 18, 2024

I think the GP_CLIENT_LOCK_FILE can be changed to any other directory. I added the lock file mainly because I want to be able to implement the gpclient disconnect command, in which I will find the lock file and send a terminate signal to it. But I didn't finish it due to some other problems.

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