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

rsync-download_only: private-bin is broken #5692

Open
glitsj16 opened this issue Feb 27, 2023 · 7 comments
Open

rsync-download_only: private-bin is broken #5692

glitsj16 opened this issue Feb 27, 2023 · 7 comments
Labels
needinfo More information is needed from the issue author

Comments

@glitsj16
Copy link
Collaborator

glitsj16 commented Feb 27, 2023

Today I found my first ever use case for rsync-download_only.profile. But private-bin rsync is broken on my Arch Linux box (running firejail from git):

$ /usr/bin/rsync --version | grep version
rsync  version 3.2.7  protocol version 31
$ firejail --quiet --noprofile /usr/bin/rsync --version | grep version
rsync  version 3.2.7  protocol version 31
$ firejail --quiet --profile=rsync-download_only /usr/bin/rsync --version
Error: no suitable /usr/bin/rsync executable found
$ firejail --quiet --ignore=private-bin --profile=rsync-download_only /usr/bin/rsync --version | grep version
rsync  version 3.2.7  protocol version 31

Obviously ignore private-bin fixes this. But I can't explain why private-bin rsync reports an error. Testing other apps using private-bin confirm it seems to work as expected. I'll do some more digging but I don't think Arch Linux does anything out of the ordinary packaging rsync compared to other distro's. If anyone can check this on a different distribution that would be helpful. @rusty-snake As you contributed this, can you double-check if private-bin works for you on Fedora please (if that's still your main distro)?

[Side note] foo.local refers to rsync.local although the hardening comment uses rsync-download_only.local - which can be easily fixed

# Add the next line to your rsync-download_only.local to enable extra hardening.

@kmk3
Copy link
Collaborator

kmk3 commented Feb 27, 2023

Works for me on Artix:

$ firejail --quiet --profile=rsync-download_only /usr/bin/rsync --version |
  grep version
rsync  version 3.2.7  protocol version 31

$ firejail --ignore='include rsync.local' --ignore='include globals.local' \
  --profile=rsync-download_only /usr/bin/rsync --version | grep version
rsync  version 3.2.7  protocol version 31

[Side note] foo.local refers to rsync.local although the hardening comment
uses rsync-download_only.local - which can be easily fixed

+1

$ firejail --quiet --profile=rsync-download_only /usr/bin/rsync --version
Error: no suitable /usr/bin/rsync executable found

By the way, you can probably keep the | grep version here since the errors
usually go to stderr.

@glitsj16
Copy link
Collaborator Author

Works for me on Artix

@kmk3 Thanks for your response. I do use an additional patch for #5650, but even when I take that out I'm seeing the breakage as posted above. Will have to do more debugging...

@kmk3
Copy link
Collaborator

kmk3 commented Feb 28, 2023

@glitsj16 on Feb 28:

@kmk3 Thanks for your response. I do use an additional patch for #5650, but
even when I take that out I'm seeing the breakage as posted above. Will have
to do more debugging...

No problem; I'd suggest temporarily installing and testing with the non-git
Arch package (community/firejail 0.9.72-1) to rule out it being caused by
custom patches or regressions on master.

@kmk3 kmk3 changed the title rsync-download_only.profile: private-bin is broken rsync-download_only: private-bin is broken Aug 23, 2024
@kmk3
Copy link
Collaborator

kmk3 commented Aug 23, 2024

Hello, is this still an issue?

Are you sure that it's not due to modifications in globals.local, etc?

@kmk3 kmk3 added the needinfo More information is needed from the issue author label Aug 23, 2024
@glitsj16
Copy link
Collaborator Author

Hello, is this still an issue?
Are you sure that it's not due to modifications in globals.local, etc?

Yes, the issue still shows for me. I've made absolutely sure to temporarily move my *.local files out of the way while testing. It works when I use private-bin rsync*. Baffled, but there it is :)

@kmk3
Copy link
Collaborator

kmk3 commented Aug 23, 2024

It works when I use private-bin rsync*. Baffled, but there it is :)

$ pacman -Qlq rsync | grep bin
/usr/bin/
/usr/bin/rrsync
/usr/bin/rsync
/usr/bin/rsync-ssl

Does it work with just the following?

private-bin rsync,rsync-ssl

Are you using a wrapper script (such as in ~/bin) for rsync?

Or something that rsync might call, like ssh?

@glitsj16
Copy link
Collaborator Author

I was aware of /usr/bin/rrsync and /usr/bin/rsync-ssl while re-checking this issue. But no, adding rsync-ssl to private-bin does not solve it. Which is to be expected, because that is a shell script and rsync-download_only.profile blocks that via include disable-shell.inc...

Re-checked for wrappers, but again, nothing there either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo More information is needed from the issue author
Projects
None yet
Development

No branches or pull requests

2 participants