From owner-freebsd-stable@FreeBSD.ORG Fri May 7 17:21:40 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 664EF1065674 for ; Fri, 7 May 2010 17:21:40 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id F033C8FC23 for ; Fri, 7 May 2010 17:21:39 +0000 (UTC) Received: by wyb36 with SMTP id 36so1086296wyb.13 for ; Fri, 07 May 2010 10:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dz7ofkOLJdL0UFm1inqoKgNF7tiVlc86WfwXxaUrMUg=; b=pSYr/SiAoEL0p+LDVLJWfh9Lr5XZ1JIKK/+od1Z+V+AFnifzu6f0TBRQhnQn/xqk0x 0WbC1Sr7XTu+ud69y478U3AuEj9frqxVFQCkNVFU/eGb7nCxI2St27vPph9nfswOmrnx K3ORRAccL+6qU8ChT63vwo1biza+gUbdjwhoY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ww4wXE6QjGkRtGr/N+kp9XzOPpi4jXvvX84yFZ5YNlzq3rYpTd2hRiaiXdflPazQXz kG+PKjJv4LP71UAvmFoIhkxMnaxW79Du7bodttTkt3mcF0LoQMws/mPupg3Y9uaYBjKF EdXVvmkuSy+LHxg11UIWK2FBz5B3HkW7GRtaI= MIME-Version: 1.0 Received: by 10.216.93.74 with SMTP id k52mr193026wef.228.1273251251393; Fri, 07 May 2010 09:54:11 -0700 (PDT) Received: by 10.216.28.3 with HTTP; Fri, 7 May 2010 09:54:11 -0700 (PDT) In-Reply-To: <4BE43A64.9000704@uni-dortmund.de> References: <4BE43A64.9000704@uni-dortmund.de> Date: Fri, 7 May 2010 11:54:11 -0500 Message-ID: From: Scot Hetzel To: Christian Baer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: stable@freebsd.org Subject: Re: screwed up permissions in tree X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2010 17:21:40 -0000 On Fri, May 7, 2010 at 11:05 AM, Christian Baer wrote: > Hi there people! > > I guess I really screwed up the rights within my source-tree (and maybe > share too). It all started pretty innocent. :-) > > I wanted to encrypt /usr and /var, which are both mounted on dedicated > partions on this machine. There was still one unused partition, which I > will call (and mount) /enctmp for the steps I took. This is how I did it: > > - cp -rpv /usr/* /enctmp This is where you went wrong. -r =3D -RL (see cp(1) man page). This caused cp change the symbolic links to directories. You should have used either: cp -Rpv /usr/* /enctmp or used tar: tar -cf -cf - -C /usr/ . | tar -xpf - -C destdir NOTE: tar would have preserved the hardlinks. > What doesn't work, is installing world! :-O I went to /usr/src/, did a > make buildworld and make buildkernel (both of which worked). Even make > installkernel worked, just the world refuses to be installed: > > -------------------------------------------------------------- >>>> Making hierarchy > -------------------------------------------------------------- > cd /usr/src; make -f Makefile.inc1 hierarchy > cd /usr/src/etc; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0make distrib-dirs > mtree -eU =A0-f /usr/src/etc/mtree/BSD.root.dist -p / > mtree -eU =A0-f /usr/src/etc/mtree/BSD.var.dist -p /var > mtree -eU =A0-f /usr/src/etc/mtree/BSD.usr.dist -p /usr > mtree -eU =A0-f /usr/src/etc/mtree/BSD.include.dist =A0-p /usr/include > mtree -deU =A0-f /usr/src/etc/mtree/BSD.sendmail.dist -p / > cd /; rm -f /sys; ln -s usr/src/sys sys > cd /usr/share/man/en.ISO8859-1; ln -sf ../man* . > ln: ./man1: Operation not permitted > ln: ./man1aout: Operation not permitted > ln: ./man2: Operation not permitted > ln: ./man3: Operation not permitted > ln: ./man4: Operation not permitted > ln: ./man5: Operation not permitted > ln: ./man6: Operation not permitted > ln: ./man7: Operation not permitted > ln: ./man8: Operation not permitted > ln: ./man9: Operation not permitted The problem here is that these are now directories, instead of links. Your /usr/share/man/en.ISO8859-1 shoud look like: # ls -l /usr/share/man/en.ISO8859-1 total 20 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat1 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat1aout drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat2 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat3 drwxr-xr-x 7 man wheel 7 Feb 7 09:47 cat4 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat5 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat6 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat7 drwxr-xr-x 6 man wheel 6 Feb 7 09:47 cat8 drwxr-xr-x 2 man wheel 2 Feb 7 09:47 cat9 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man1 -> ../man1 lrwxr-xr-x 1 root wheel 11 May 6 07:24 man1aout -> ../man1aout lrwxr-xr-x 1 root wheel 7 May 6 07:24 man2 -> ../man2 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man3 -> ../man3 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man4 -> ../man4 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man5 -> ../man5 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man6 -> ../man6 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man7 -> ../man7 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man8 -> ../man8 lrwxr-xr-x 1 root wheel 7 May 6 07:24 man9 -> ../man9 To fix this, just delete the man1* - man9 directories, and run make installworld. Since /usr/share/man is not needed during an installworld, the best solution to recover diskspace is to remove this directory: cd /usr/src rm -rf /usr/share/man make installworld This would let installworld recreate the man hierarchy. NOTE: There might be other locations where symbolic links were changed to directories, just remove those directories and re-run 'make installworld'. Scot