-
Notifications
You must be signed in to change notification settings - Fork 132
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
missing conventions for (un)installation, interference from firejail/sandboxing on copying installation files #560
Comments
@matu3ba thanks for the issue, i'll try to help but i feel some things are related to zellij, no?
|
@sagiegurari No, see this cargo profile inside firejail which is causing it. On disabling firejail with Yes, 1. is affected by this. I am not entirely sure how exactly. However the I am only asking you to document this behavior and provide a convention how to work around this so others dont trap into the same The idea is to first fix the documentation upstream, so I can then add it to zellij. It should probably go into the first simple example to hint that the |
wait, the cp doesn't copy the permissions? because of the cargo.profile? the duckscript cp is using std::fs::copy which in the docs state that it copies permissions as well. strange |
yes. This is kinda intended behavior of However using You can try it yourself with the commands I provided. |
Describe The Bug
zellij uses cargo-make to build multiple crates and provides also release builds. However adding a path like
cargo make install PATH
can only set permissions 0700. This makes binaries usable, but they can not be overwritten.Unfortunately
cargo make
is invoked by the restrictedcargo
process, so subprocesses can only write binaries as read-only forcargo
(and later on without write-permissions).(The behavior is also not very good either, because ideally one wants to forbid access to globally installed programs/programs in
PATH
for subprocesses.)This means that
cargo make install PATH
will never work as expected and install toPATH
with read-write permissions.Can you clarify this in your conventions?
The conventions are also missing that one should separate the build step from installation step (which is less ideal when people enable this by adding a
PATH
aftercargo make install
).How to uninstall is missing.
Ideally cargo-make would be explicit about the supported installation and uninstall methods. Ideally it would give advice how to not interfere with the package manager if anything with root is intended to be supported.
TO REPRODUCE:
install firejail ie with
git clone https://github.com/netblue30/firejail ; cd firejail; ./configure && make && sudo make install-strip
sudo firecfg
install zellij + requirements with cargo-make (cargo-make must be installed of course)
git clone https://github.com/zellij-org/zellij; cd zellij; cargo make install ~/.cargo/bin/zellij
stat ~/.cargo/bin/zellij
permissions should show 0700
If this is not the case, git checkout another revision/hash and retry installation.
Now permissions should show 0700
(If the file is non-existing writing it apparently is fine, but followup writes do make it 0700)
POTENTIAL WORKAROUND:
chmod +rwx FILE
could work, but are an ugly hack.WHY FIREJAIL AND THE MESS:
Restricting cargo to limit simple abuse forms is a valid use case and this requires to disallow executing created binaries or silently overwriting binaries without explicit permission to do so. Its very unfortunate that this breaks
cargo-make
installing stuff.The text was updated successfully, but these errors were encountered: