summary refs log tree commit diff
path: root/nixos/modules/system/etc/setup-etc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/system/etc/setup-etc.pl')
-rw-r--r--nixos/modules/system/etc/setup-etc.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl
index efda74161ff8..eed20065087f 100644
--- a/nixos/modules/system/etc/setup-etc.pl
+++ b/nixos/modules/system/etc/setup-etc.pl
@@ -108,6 +108,8 @@ sub link {
             my $uid = read_file("$_.uid"); chomp $uid;
             my $gid = read_file("$_.gid"); chomp $gid;
             copy "$static/$fn", "$target.tmp" or warn;
+            $uid = getpwnam $uid unless $uid =~ /^\+/;
+            $gid = getgrnam $gid unless $gid =~ /^\+/;
             chown int($uid), int($gid), "$target.tmp" or warn;
             chmod oct($mode), "$target.tmp" or warn;
             rename "$target.tmp", $target or warn;