How can I make an app think it's running in another directory (without merely changing HOME environment variable, which doesn't always work, and it also doesn't work with non-home directories)?
Any input would be GREATLY appreciated!
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] How can I make an app think it's running in another directory (without merely changing HOME env. var.)?
- canci
- Global Moderator
- Posts: 2502
- Joined: 2006-09-24 11:28
- Has thanked: 136 times
- Been thanked: 136 times
Re: How can I make an app think it's running in another directory (without merely changing HOME environment variable)?
CLI tools usually should respect cd PATH or some flag like --path. Many GUI tools also do that.
It's really hard to say though, since you didn't tell us what app you mean.
It's really hard to say though, since you didn't tell us what app you mean.
Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe
READ THIS:
* How to Post a Thread Here
* Other Tips and Great Resources
READ THIS:
* How to Post a Thread Here
* Other Tips and Great Resources
- wizard10000
- Global Moderator
- Posts: 626
- Joined: 2019-04-16 23:15
- Location: southeastern us
- Has thanked: 84 times
- Been thanked: 98 times
Re: How can I make an app think it's running in another directory (without merely changing HOME environment variable)?
Yep - we need a use case to understand what you're trying to do
we see things not as they are, but as we are.
-- anais nin
-- anais nin
-
- Posts: 19
- Joined: 2022-05-31 16:19
- Has thanked: 5 times
Re: How can I make an app think it's running in another directory (without merely changing HOME environment variable)?
chdir() #in python/perl/php/C/C++s3a wrote: How can I make an app think it's running in another directory?
cd #in bash
Just google 'chdir $your_language_of_choice_here'
Re: How can I make an app think it's running in another directory (without merely changing HOME environment variable)?
I don't think any of these answer would do what I need, but thanks anyways.
It seems what I need is to use firejail --noprofile --private=/home/user/fake_home.
For example,
and then, everything would seem like it's being done in /home/user, but it'd really be done in /home/user/fake_home.
Basically, I wanted to sandbox my IDE and toolchain environment (that are from upstream and not in the Debian repositories (because I'm paranoid )).
Edit:
I also wanted to isolate the files made from the rest of the system.
P.S.
That doesn't allow one to fool an app into thinking its non-home directories are other than they are, but I don't really need that for my use case anyways.
It seems what I need is to use firejail --noprofile --private=/home/user/fake_home.
For example,
Code: Select all
firejail --noprofile --private=/home/user/fake_home bash
Basically, I wanted to sandbox my IDE and toolchain environment (that are from upstream and not in the Debian repositories (because I'm paranoid )).
Edit:
I also wanted to isolate the files made from the rest of the system.
P.S.
That doesn't allow one to fool an app into thinking its non-home directories are other than they are, but I don't really need that for my use case anyways.
Use Mnemosyne to Study for School!