diff options
author | netblue30 <netblue30@protonmail.com> | 2022-02-02 12:54:27 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2022-02-02 12:54:27 -0500 |
commit | 4e27b344ed2ff6a15030d3d4c5c5fc9994baf504 (patch) | |
tree | c465f287c5e6ddf3073653a83a16e5fb5f2b11c3 /src | |
parent | netlocker fixes (diff) | |
download | firejail-4e27b344ed2ff6a15030d3d4c5c5fc9994baf504.tar.gz firejail-4e27b344ed2ff6a15030d3d4c5c5fc9994baf504.tar.zst firejail-4e27b344ed2ff6a15030d3d4c5c5fc9994baf504.zip |
tentative fix for private-etc in NixOS - issue 4887
Diffstat (limited to 'src')
-rw-r--r-- | src/fcopy/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fcopy/main.c b/src/fcopy/main.c index c64d20127..3f2d3137f 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c | |||
@@ -402,6 +402,16 @@ static void duplicate_link(const char *src, const char *dest, struct stat *s) { | |||
402 | gid_t gid = s->st_gid; | 402 | gid_t gid = s->st_gid; |
403 | mode_t mode = s->st_mode; | 403 | mode_t mode = s->st_mode; |
404 | 404 | ||
405 | // NixOS problem #4887: | ||
406 | // /etc/fonts is a double symlink to a directory - copy the files instead of copying the symlink | ||
407 | // they could have some other dirs handled this way, so let's do it for all files in /etc | ||
408 | if (strncmp(src, "/etc/", 5) == 0) { | ||
409 | duplicate_dir(src, dest, s); | ||
410 | free(rsrc); | ||
411 | free(rdest); | ||
412 | return; | ||
413 | } | ||
414 | |||
405 | // build destination file name | 415 | // build destination file name |
406 | char *name; | 416 | char *name; |
407 | // char *ptr = strrchr(rsrc, '/'); | 417 | // char *ptr = strrchr(rsrc, '/'); |