mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-21 06:45:29 -06:00
Merge pull request #32 from pmillerchip/tilde-support
Support ~ in blacklist and profile includes
This commit is contained in:
commit
85273ce7d1
3 changed files with 10 additions and 4 deletions
|
|
@ -297,6 +297,11 @@ void fs_blacklist(const char *homedir) {
|
|||
errExit("asprintf");
|
||||
ptr = new_name;
|
||||
}
|
||||
else if (strncmp(ptr, "~/", 2) == 0) {
|
||||
if (asprintf(&new_name, "%s%s", homedir, ptr + 1) == -1)
|
||||
errExit("asprintf");
|
||||
ptr = new_name;
|
||||
}
|
||||
|
||||
// expand path macro - look for the file in /bin, /usr/bin, /sbin and /usr/sbin directories
|
||||
if (strncmp(ptr, "${PATH}", 7) == 0) {
|
||||
|
|
|
|||
|
|
@ -430,6 +430,10 @@ void profile_read(const char *fname, const char *skip1, const char *skip2) {
|
|||
if (asprintf(&newprofile2, "%s%s", cfg.homedir, newprofile + 7) == -1)
|
||||
errExit("asprintf");
|
||||
}
|
||||
else if (strncmp(newprofile, "~/", 2) == 0) {
|
||||
if (asprintf(&newprofile2, "%s%s", cfg.homedir, newprofile + 1) == -1)
|
||||
errExit("asprintf");
|
||||
}
|
||||
|
||||
// recursivity
|
||||
profile_read((newprofile2)? newprofile2:newprofile, newskip1, newskip2);
|
||||
|
|
|
|||
5
todo
5
todo
|
|
@ -1,6 +1,3 @@
|
|||
1. Deal with .purple directory. It holds the confiig files for pidgin
|
||||
|
||||
2. Support ~ in --blacklist filenames, maybe in some other options. Example
|
||||
$ firejail --blacklist=~/.ssh
|
||||
|
||||
3. Support filenames with spaces in blacklist option.
|
||||
2. Support filenames with spaces in blacklist option.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue