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

cd in strider #2070

Closed
panki27 opened this issue Jan 8, 2023 · 5 comments
Closed

cd in strider #2070

panki27 opened this issue Jan 8, 2023 · 5 comments

Comments

@panki27
Copy link
Contributor

panki27 commented Jan 8, 2023

Hi, I just got started using Zellij and have discovered the strider plugin.

I'm not sure if this is because I'm running this on Windows inside WSL, but I can't go "up" out of my home directory (nothing happens).
After checking the source code, there doesn't seem to be a way to provide a path either (like /mnt/myfiles).

Would it be possible to add this? Something like hitting c popping a small input box?

Another "nice to have" feature I was thinking of would be providing command, which when run inside a pane updates the strider working directory to the panes current working directory, but I don't know how feasible this is.

@imsnif
Copy link
Member

imsnif commented Jan 13, 2023

Hey - the reason you're not able to go up in Strider beyond the original folder is that Strider is implemented as a plugin and thus is sandboxed to only be able to access the folder it was opened in. A bit of a security measure so plugins wouldn't be able to access arbitrary paths on the hard-drive.

I can totally see us implementing a flag that would bypass this, but a bit later down the road as we put more work into our plugin system. Same goes for your other suggestion with the pane CWD.

I'm glad you're enjoying Strider though! I definitely want to improve it as time permits.

@imsnif imsnif closed this as completed Jan 13, 2023
@panki27
Copy link
Contributor Author

panki27 commented Jan 13, 2023

@imsnif ok, I understand the motivation.
But I don't think your goal has been achieved (yet). strider happily follows symlinks:

$ t=$(mktemp -d)
$ echo "I should not be seen" > "$t"/secret_file
$ ln -s "$t" link
$ zellij --layout strider

Navigating to link lets you edit secret_file, therefore breaking out of my home directory.
You can check for this by using realpath.

$ realpath link
/tmp/tmp.6SwPVJzB8p

So your statement

[...] Strider is implemented as a plugin and thus is sandboxed to only be able to access the folder it was opened in.

doesn't seem accurate. Can you point me to the relevant code?

@imsnif
Copy link
Member

imsnif commented Jan 13, 2023

Try it with another path, we make sure the plugins have access to /tmp in case they need it: https://github.com/zellij-org/zellij/blob/main/zellij-server/src/plugins/wasm_bridge.rs#L322

@panki27
Copy link
Contributor Author

panki27 commented Jan 13, 2023

Try it with another path, we make sure the plugins have access to /tmp in case they need it: https://github.com/zellij-org/zellij/blob/main/zellij-server/src/plugins/wasm_bridge.rs#L322

So I shouldn't be able to follow a link to /etc and view my passwd, right? But I am.

@imsnif
Copy link
Member

imsnif commented Jan 14, 2023

Looks like the WASI devs view this as desired behavior. More discussion here: wasmerio/wasmer#2243

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