Comments (2)
I'm running the following patch locally:
diff --git a/src/bottle.rs b/src/bottle.rs
index 17bcf49..bb7746e 100644
--- a/src/bottle.rs
+++ b/src/bottle.rs
@@ -363,6 +363,15 @@ pub fn shell(uid: Option<nix::unistd::Uid>, quiet: bool) -> Result<i32, error::E
args.push(CString::new("--setenv").unwrap());
args.push(CString::new(format!("SUBSYSTEMCTL_PATH={}", std::env::current_dir().unwrap().display())).unwrap());
+ let ignore_keys = ["SHELL", "HOME", "USER", "EDITOR", "LOGNAME", "LANG", "TERM", "MAIL"];
+ for (key, value) in std::env::vars() {
+ if ignore_keys.contains(&key.as_str()) {
+ continue;
+ }
+ args.push(CString::new("--setenv").unwrap());
+ args.push(CString::new(format!("{}={}", key, value)).unwrap());
+ }
+
args.push(CString::new(".host").unwrap());
args.push(CString::new("/bin/sh").unwrap());
This copies all variables except the ones specified in the list (I don't want these to be copied from the root user).
from subsystemctl.
PR is welcomed.
from subsystemctl.
Related Issues (16)
- can't cat /proc/sys/fs/binfmt_misc/WSLInterop Too many levels of symbolic links HOT 2
- Not working in ssh
- Cannot access DISPLAY :0 HOT 1
- error in command using subsystemctl exec bash HOT 3
- Shell falls back to sh on subsystemctl shell
- pkg subsystemctl is removed from aur? HOT 3
- Some thoughts about setuid
- A note on AppArmor and WSL
- errors
- 404 PAGE HOT 1
- Missing Windows Path HOT 1
- is this available for CentOS/RHEL? HOT 9
- WORKING GOOD in CENTOS7/RHEL7 / Oracle Linux 7 HOT 1
- Cockpit + KVM HOT 1
- I was able to run the subsystemctl in Centos 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from subsystemctl.