Skip to content

Commit

Permalink
tentative fix for private-etc in NixOS - issue 4887
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Feb 2, 2022
1 parent f5c0b6a commit 4e27b34
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fcopy/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,16 @@ static void duplicate_link(const char *src, const char *dest, struct stat *s) {
gid_t gid = s->st_gid;
mode_t mode = s->st_mode;

// NixOS problem #4887:
// /etc/fonts is a double symlink to a directory - copy the files instead of copying the symlink
// they could have some other dirs handled this way, so let's do it for all files in /etc
if (strncmp(src, "/etc/", 5) == 0) {
duplicate_dir(src, dest, s);
free(rsrc);
free(rdest);
return;
}

// build destination file name
char *name;
// char *ptr = strrchr(rsrc, '/');
Expand Down

0 comments on commit 4e27b34

Please sign in to comment.