[K42-discussion] [patch] absolute symlinks in rootfs

Amos Waterland apw at us.ibm.com
Fri Feb 3 11:13:01 EST 2006


K42 synchronizes its /etc by copying files from a read-only mount of a
Gentoo root filesystem.  Until unionfs support is more stable, it uses
rsync to effect this.  The below patch makes sure rsync will ignore
absolute symlinks and links that point out of the tree, since a
resursive chown and other commands run on the developer's workstation
could have unpleasant results.

I am committing this patch since it passes regress.  Posting to the list
in case people start seeing a failure from a tool that depended on one
of those symlinks.


Index: bin/sysinit
===================================================================
RCS file: /u/kitchawa/cvsroot/kitch-core/bin/sysinit,v
retrieving revision 1.20
diff -u -r1.20 sysinit
--- bin/sysinit	27 Sep 2005 21:19:09 -0000	1.20
+++ bin/sysinit	2 Feb 2006 04:16:34 -0000
@@ -50,8 +50,8 @@
 
     status "Mirroring local writable directories"
     if [ ! -f /etc/.updated ]; then
-	rsync --ignore-existing -rl -v /nfs/etc/ /etc/ &&
-	touch /etc/.updated
+	rsync -r -v --ignore-existing --safe-links /nfs/etc/ /etc/ &&
+	touch /etc/.updated;
 	sync
     fi
 



More information about the K42-discussion mailing list