Skip to content

keep original file permissions#150

Merged
netblue30 merged 1 commit into
masterfrom
unknown repository
Nov 20, 2015
Merged

keep original file permissions#150
netblue30 merged 1 commit into
masterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 19, 2015

Don't force 0755 permissions for whitelisted files. (#149)

netblue30 pushed a commit that referenced this pull request Nov 20, 2015
keep original file permissions
@netblue30 netblue30 merged commit 1b48878 into netblue30:master Nov 20, 2015
@netblue30
Copy link
Copy Markdown
Owner

I am sure there is more to come, for example:

$ mkdir aaa
$ touch bbb
$ rm -fr aaa bbb
$ mkdir aaa
$ touch aaa/bbb
$ firejail --whitelist=~/aaa/bbb
Reading profile /etc/firejail/generic.profile
Reading profile /etc/firejail/disable-mgmt.inc
Reading profile /etc/firejail/disable-secret.inc
Reading profile /etc/firejail/disable-common.inc

** Note: you can use --noprofile to disable generic.profile **

Parent pid 8187, child pid 8188
Child process initialized
$ ls -l
total 0
drw-r--r-- 2 netblue netblue 60 Nov 19 19:18 aaa

aaa inherits the permissions of bbb file.

$ ls -l aaa/bbb
ls: cannot access aaa/bbb: Permission denied
$ 

So I had to add a 0111 to the mode in mkpath() function:

static int mkpath(const char* path, mode_t mode) {
    assert(path && *path);
    mode |= 0111;

    // create directories with uid/gid as root or as current user if inside home directory
...

I put "mode |= 0111" fix in, thanks!

@ghost
Copy link
Copy Markdown
Author

ghost commented Nov 20, 2015

That's weird though, and I want to see it work properly, not halfass-hackedly. Can't leave it like that. Damn details.

You're welcome!

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

Successfully merging this pull request may close these issues.

2 participants