[GH-ISSUE #910] Support symlinks for --private-home #618

Closed
opened 2026-05-05 06:17:18 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @ghost on GitHub (Nov 13, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/910

Hi, after rebuilding firejail from git (including e75dfa59eb) I'm seeing the issues raised in https://github.com/netblue30/firejail/issues/886 again. The committed fix simply doesn't work for me and seems to have broken usage of '--private=$HOME' ..

As I'm seeing the exact same outputs as in https://github.com/netblue30/firejail/issues/886 I left those out here for brevity.

On a side note, I tested all my firejail scripts with '--private' (which should be equivalent to --private=$HOME) once more, but that still doesn't work either. According to the man it's possible to use '--private-home=file,directory'. That doesn't seem to work when specifying symlinked dir(s) in $HOME as per the below. I take it this is by design, because this is showing on firejail built without commit e75dfa59eb ..

$ ls -l $HOME | grep claws
lrwxrwxrwx 1 dirkos dirkos 32 Nov 13 06:27 .clawsmail -> /mnt/lab16.sda3/user/.clawsmail/
lrwxrwxrwx 1 dirkos dirkos 33 Nov 13 06:27 .claws-mail -> /mnt/lab16.sda3/user/.claws-mail/

$ firejail --private-home=.claws-mail claws-mail
Error: invalid private directory

$ firejail --private-home=/home/dirkos/.claws-mail claws-mail
Error: file /home/dirkos/.claws-mail is not in user home directory

For now I omit the referenced commit in firejail to get '--private=$HOME' working again, but I considered it important enough to report this here.

Regards

Originally created by @ghost on GitHub (Nov 13, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/910 Hi, after rebuilding firejail from git (including https://github.com/netblue30/firejail/commit/e75dfa59eb8e74b0f1bae2be6e4d981205edcda2) I'm seeing the issues raised in https://github.com/netblue30/firejail/issues/886 again. The committed fix simply doesn't work for me and seems to have broken usage of '--private=$HOME' .. As I'm seeing the exact same outputs as in https://github.com/netblue30/firejail/issues/886 I left those out here for brevity. On a side note, I tested all my firejail scripts with '--private' (which should be equivalent to --private=$HOME) once more, but that still doesn't work either. According to the man it's possible to use '--private-home=file,directory'. That doesn't seem to work when specifying symlinked dir(s) in $HOME as per the below. I take it this is by design, because this is showing on firejail built without commit e75dfa59eb8e74b0f1bae2be6e4d981205edcda2 .. $ ls -l $HOME | grep claws lrwxrwxrwx 1 dirkos dirkos 32 Nov 13 06:27 .clawsmail -> /mnt/lab16.sda3/user/.clawsmail/ lrwxrwxrwx 1 dirkos dirkos 33 Nov 13 06:27 .claws-mail -> /mnt/lab16.sda3/user/.claws-mail/ $ firejail --private-home=.claws-mail claws-mail Error: invalid private directory $ firejail --private-home=/home/dirkos/.claws-mail claws-mail Error: file /home/dirkos/.claws-mail is not in user home directory For now I omit the referenced commit in firejail to get '--private=$HOME' working again, but I considered it important enough to report this here. Regards
gitea-mirror 2026-05-05 06:17:18 -06:00
Author
Owner

@netblue30 commented on GitHub (Nov 13, 2016):

Currently --private-home does not allow symbolic links outside home directory. You do have it as a symbolic link.

$ ls -l $HOME | grep claws
lrwxrwxrwx 1 dirkos dirkos 32 Nov 13 06:27 .clawsmail -> /mnt/lab16.sda3/user/.clawsmail/
lrwxrwxrwx 1 dirkos dirkos 33 Nov 13 06:27 .claws-mail -> /mnt/lab16.sda3/user/.claws-mail/

I'll add support for it, the only condition will be to have the directory - /mnt/lab16.sda3/user/.clawsmail/ in your case - owned by the regular user.

<!-- gh-comment-id:260191689 --> @netblue30 commented on GitHub (Nov 13, 2016): Currently --private-home does not allow symbolic links outside home directory. You do have it as a symbolic link. ``` $ ls -l $HOME | grep claws lrwxrwxrwx 1 dirkos dirkos 32 Nov 13 06:27 .clawsmail -> /mnt/lab16.sda3/user/.clawsmail/ lrwxrwxrwx 1 dirkos dirkos 33 Nov 13 06:27 .claws-mail -> /mnt/lab16.sda3/user/.claws-mail/ ``` I'll add support for it, the only condition will be to have the directory - /mnt/lab16.sda3/user/.clawsmail/ in your case - owned by the regular user.
Author
Owner

@ghost commented on GitHub (Nov 13, 2016):

That would be great, thanks. The condition you mention is something I rely on as well, so that would fit in nicely. In regards to commit e75dfa59eb breaking '--private=$HOME I'm going through some more testing right now. Will report back here on that.

<!-- gh-comment-id:260193450 --> @ghost commented on GitHub (Nov 13, 2016): That would be great, thanks. The condition you mention is something I rely on as well, so that would fit in nicely. In regards to commit https://github.com/netblue30/firejail/commit/e75dfa59eb8e74b0f1bae2be6e4d981205edcda2 breaking '--private=$HOME I'm going through some more testing right now. Will report back here on that.
Author
Owner

@netblue30 commented on GitHub (Nov 21, 2016):

I think I have a fix on the main branch.

<!-- gh-comment-id:261957503 --> @netblue30 commented on GitHub (Nov 21, 2016): I think I have a fix on the main branch.
Author
Owner

@ghost commented on GitHub (Nov 26, 2016):

Sorry for the late reply. Your fix works great. Thanks!

<!-- gh-comment-id:263059540 --> @ghost commented on GitHub (Nov 26, 2016): Sorry for the late reply. Your fix works great. Thanks!
Author
Owner

@netblue30 commented on GitHub (Nov 27, 2016):

No problem.

<!-- gh-comment-id:263124529 --> @netblue30 commented on GitHub (Nov 27, 2016): No problem.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#618
No description provided.