From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 13 13:00:24 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31BD3106566C for ; Mon, 13 Jun 2011 13:00:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4578FC1F for ; Mon, 13 Jun 2011 13:00:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DD0N34000133 for ; Mon, 13 Jun 2011 13:00:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5DD0Nvp000132; Mon, 13 Jun 2011 13:00:23 GMT (envelope-from gnats) Resent-Date: Mon, 13 Jun 2011 13:00:23 GMT Resent-Message-Id: <201106131300.p5DD0Nvp000132@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Vladislav V. Prodan" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85021065676 for ; Mon, 13 Jun 2011 12:57:08 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 8E28F8FC1A for ; Mon, 13 Jun 2011 12:57:08 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DCv7J9059270 for ; Mon, 13 Jun 2011 12:57:07 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p5DCv7pV059269; Mon, 13 Jun 2011 12:57:07 GMT (envelope-from nobody) Message-Id: <201106131257.p5DCv7pV059269@red.freebsd.org> Date: Mon, 13 Jun 2011 12:57:07 GMT From: "Vladislav V. Prodan" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/157835: Do not copy symlinks or through mtree, or via rsync X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 13:00:24 -0000 >Number: 157835 >Category: misc >Synopsis: Do not copy symlinks or through mtree, or via rsync >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 13 13:00:23 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Vladislav V. Prodan >Release: FreeBSD 8.2-STABLE amd64 >Organization: >Environment: FreeBSD mary-teresa 8.2-STABLE FreeBSD 8.2-STABLE #0: Tue Jun 7 17:56:08 EEST 2011 root@mary-teresa:/usr/obj/usr/src/sys/otrada.3 amd64 >Description: You need to copy the skeleton directories without files contained therein, only subdirectories. Problems arose with the symlinks. Symlinks are ignored mtree and rsync. # df -h /tmp Filesystem Size Used Avail Capacity Mounted on zroot/tmp 366G 168k 366G 0% /tmp # zfs get all zroot/tmp NAME PROPERTY VALUE SOURCE zroot/tmp type filesystem - zroot/tmp creation вт янв 1 3:15 2008 - zroot/tmp used 284K - zroot/tmp available 366G - zroot/tmp referenced 168K - zroot/tmp compressratio 1.04x - zroot/tmp mounted yes - zroot/tmp quota none default zroot/tmp reservation none default zroot/tmp recordsize 128K default zroot/tmp mountpoint /tmp local zroot/tmp sharenfs off default zroot/tmp checksum fletcher4 inherited from zroot zroot/tmp compression on local zroot/tmp atime on default zroot/tmp devices on default zroot/tmp exec on local zroot/tmp setuid off local zroot/tmp readonly off default zroot/tmp jailed off default zroot/tmp snapdir hidden default zroot/tmp aclinherit restricted default zroot/tmp canmount on default zroot/tmp xattr off temporary zroot/tmp copies 1 default zroot/tmp version 4 - zroot/tmp utf8only off - zroot/tmp normalization none - zroot/tmp casesensitivity sensitive - zroot/tmp vscan off default zroot/tmp nbmand off default zroot/tmp sharesmb off default zroot/tmp refquota none default zroot/tmp refreservation none default zroot/tmp primarycache all default zroot/tmp secondarycache all default zroot/tmp usedbysnapshots 115K - zroot/tmp usedbydataset 168K - zroot/tmp usedbychildren 0 - zroot/tmp usedbyrefreservation 0 - zroot/tmp logbias latency default zroot/tmp dedup off default zroot/tmp mlslabel - zroot/tmp sync standard default >How-To-Repeat: Creating a test directory with a symlink: #!/bin/sh symlink="ghgh gugh seee udjd" mkdir -p /tmp/test/All /tmp/test-copy cd /tmp/test/All for i in $symlink; do mkdir ../$i ln -s ../$i $i done Script copying the skeleton directory using mtree: #!/bin/sh from_dir=/tmp/test to_dir=/tmp/test-copy mkdir -p $to_dir cd $from_dir/; mtree -c -d -i -n -k link,uname,gname,mode,flags > $to_dir/dir.txt mtree -U -f $to_dir/dir.txt -p $to_dir OR rsync: #!/bin/sh from_dir=/tmp/test to_dir=/tmp/test-copy rsync -vraKz --include='*/' --exclude='*' $from_dir $to_dir >Fix: >Release-Note: >Audit-Trail: >Unformatted: