summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/build/activation.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index 03c1d24126..009c1fff0a 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -155,7 +155,14 @@ numeric gid or #f."
                 (let ((target (string-append "/etc/" file))
                       (source (string-append "/etc/static/" file)))
                   (rm-f target)
-                  (symlink source target)))
+
+                  ;; Things such as /etc/sudoers must be regular files, not
+                  ;; symlinks; furthermore, they could be modified behind our
+                  ;; back---e.g., with 'visudo'.  Thus, make a copy instead of
+                  ;; symlinking them.
+                  (if (file-is-directory? source)
+                      (symlink source target)
+                      (copy-file source target))))
               (scandir etc
                        (lambda (file)
                          (not (member file '("." ".."))))