From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 7 14:35:30 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D167F4CA for ; Tue, 7 Oct 2014 14:35:30 +0000 (UTC) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96CB59AE for ; Tue, 7 Oct 2014 14:35:30 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id uq10so6658144igb.2 for ; Tue, 07 Oct 2014 07:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dataix.net; s=rsa; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gG3rCmbiQbF3ccl1O9cS+y0syRFYuIW+XHy+wdKiQlc=; b=AOgR+tvsC4WAovWnhrNpfXwdyzmUNKBzyLcBPuvkcPhBfneSDlSdgIdgdo+Y0yvtaD LYe343SWTEjD8IUzTdUlmpmziPnevtoQCqtg9refMZD3IOyWFbneseCY+qBfxR0bDcOz 7oMOIoSoShJcA3ovCfh0/rx2YkRDufYNueoso= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=gG3rCmbiQbF3ccl1O9cS+y0syRFYuIW+XHy+wdKiQlc=; b=BQkr/d+z0gz5R33YRgx7HZedtHezf1HhMw8IxaGTJuRVIjI52SL404DklUAFnI8aj4 XIKec2dxiA+SjM3fLOBLExCLgd4MJStk+TlkUaYpbGHywGHYWF0jNnpjAQPJaQadOAz9 /oL5MYYZAafjBlJauB+1KpYxrBcwoZPkNFyRnIUCPiAYYx/IkrS9850QkEls0emVLvTQ fmuPwBt7l3WjMTt85RpvLHBnx2Z1LX8ntMIXNSmlZoo8YdxwIyc/vgXOODyanwDw1zWk bGZCUm3NUxa+k2Uc8XLeSRO0dQbopQ+FX1rddxsZ0hqopg1w6qtZ+wb/YajrXEMYwDrW JNDg== X-Gm-Message-State: ALoCoQnVMl7fdxnnfQn7n6TqD3ZLyHoHtKH9rwjWmsEKJs/oPLFOuDStiDP44OZSDA+UUw7NflHv X-Received: by 10.42.233.75 with SMTP id jx11mr5301229icb.22.1412692529891; Tue, 07 Oct 2014 07:35:29 -0700 (PDT) Received: from [192.168.8.21] ([66.195.151.70]) by mx.google.com with ESMTPSA id m9sm12182402igd.14.2014.10.07.07.35.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 07:35:29 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: tar and / From: Jason Hellenthal In-Reply-To: Date: Tue, 7 Oct 2014 09:35:29 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Daniel Braniss X-Mailer: Apple Mail (2.1878.6) Cc: hackers@freebsd.org, Ian Lepore X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Oct 2014 14:35:30 -0000 =46rom tar(1) o Archive entries can exploit symbolic links to restore files = to other directories. An archive can restore a symbolic link to another = directory, then use that link to restore a file into that directory. To guard against this, = tar checks each extracted path for symlinks. If the final path element is = a symlink, it will be removed and replaced with the archive entry. If -U is = specified, any intermediate symlink will also be unconditionally removed. If neither = -U nor -P is specified, tar will refuse to extract the entry. With that stated you might want to roll through your filesystem with = symlinks(1) [sysutils/symlinks]. Use of this to shorten, remove dangling = etc.. DESCRIPTION symlinks is a useful utility for maintainers of FTP sites, = CDROMs, and Linux software distributions. It scans directories for symbolic = links and lists them on stdout, often revealing flaws in the filesystem = tree. Each link is output with a classification of relative, absolute, = dan- gling, messy, lengthy, or other_fs. relative links are those expressed as paths relative to the = directory in which the links reside, usually independent of the mount = point of the filesystem. absolute links are those given as an absolute path from the root = direc- tory as indicated by a leading slash (/). dangling links are those for which the target of the link does = not cur- rently exist. This commonly occurs for absolute links when a = filesys- tem is mounted at other than its customary mount point (such as = when the normal root filesystem is mounted at /mnt after booting from = alter- native media). messy links are links which contain unnecessary slashes or dots = in the path. These are cleaned up as well when -c is specified. lengthy links are links which use "../" more than necessary in = the path (eg. /bin/vi -> ../bin/vim) These are only detected when -s is = speci- fied, and are only cleaned up when -c is also specified. other_fs are those links whose target currently resides on a = different filesystem from where symlinks was run (most useful with -r ). Hope this helps. On Oct 7, 2014, at 1:44, Daniel Braniss wrote: > hi,Ian Lepore > for security reasons tar removes the leading /, which is fine. > so I can chadir to /var/tmp, and do an extract there. The problem = arises when there > is a file that is linked to /=85 > Is there some way to drop that leading =91/=91 too? >=20 > cheers, >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to = "freebsd-hackers-unsubscribe@freebsd.org" --=20 Jason Hellenthal Mobile: +1 (616) 953-0176 jhellenthal@DataIX.net JJH48-ARIN