From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1Dvbo8-0007Qp-UU for garchives@archives.gentoo.org; Thu, 21 Jul 2005 14:13:53 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j6LED279005633; Thu, 21 Jul 2005 14:13:02 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j6LED2s8017663 for ; Thu, 21 Jul 2005 14:13:02 GMT Received: from p061198141224.ppp.prin.ne.jp ([61.198.141.224] helo=opteron246.suzuki-stubbs.home) by smtp.gentoo.org with esmtpa (Exim 4.43) id 1DvbnY-0001H6-SO for gentoo-portage-dev@lists.gentoo.org; Thu, 21 Jul 2005 14:13:19 +0000 Received: by opteron246.suzuki-stubbs.home (Postfix, from userid 1000) id 1975E1032EF; Thu, 21 Jul 2005 23:13:37 +0900 (JST) From: Jason Stubbs To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] PATCH: Use lchown and lchgrp no-op functions when operating on symlinks (#99616) Date: Thu, 21 Jul 2005 23:13:34 +0900 User-Agent: KMail/1.8.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart35064940.GQPE0faN1f"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200507212313.36804.jstubbs@gentoo.org> X-Archives-Salt: 427cc0c9-dfaa-4e53-90a0-566a2b7b0cea X-Archives-Hash: 280e90b64f931173e371b7f42695ef44 --nextPart35064940.GQPE0faN1f Content-Type: multipart/mixed; boundary="Boundary-01=_P263Cw+mp0JGIGH" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_P263Cw+mp0JGIGH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline http://bugs.gentoo.org/show_bug.cgi?id=3D99616 Similar to the usage of chown on Darwin in bug #98827, ebuild.sh uses chown on symlinks which can alter the target where the intention is to modify the symlink. This patch adds no-op lchown and lchgrp functions to ebuild.sh. Profiles should override these to provide the correct implementation for the specific userland. (Apologies to the bug poster!) =2D-=20 Jason Stubbs --Boundary-01=_P263Cw+mp0JGIGH Content-Type: text/x-diff; charset="us-ascii"; name="99616_overridable_lchown_lchgrp.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="99616_overridable_lchown_lchgrp.patch" diff -uNr portage-2.0.51.22-r2/bin/ebuild.sh portage-patched/bin/ebuild.sh =2D-- portage-2.0.51.22-r2/bin/ebuild.sh 2005-07-19 19:38:32.949904000 +0900 +++ portage-patched/bin/ebuild.sh 2005-07-21 23:03:58.429898000 +0900 @@ -85,6 +85,11 @@ export SANDBOX_PREDICT=3D"$SANDBOX_PREDICT:$1" } =20 +lchown() +{ 0; } + +lchgrp() +{ 0; } =20 # source the existing profile.bashrc's. save_IFS @@ -1075,9 +1080,13 @@ local count=3D0 find "${D}/" -user portage | while read file; do count=3D$(( $count + 1 )) =2D [[ ! -L ${file} ]] && s=3D$(stat_perms $file) =2D chown root "$file" =2D [[ ! -L ${file} ]] && chmod "$s" "$file" + if [ -L "${file}" ]; then + lchown root "${file}" + else + s=3D$(stat_perms $file) + chown root "$file" + chmod "$s" "$file" + fi done if (( $count > 0 )); then ewarn "$count files were installed with user portage!" @@ -1086,13 +1095,13 @@ count=3D0 find "${D}/" -group portage | while read file; do count=3D$(( $count + 1 )) =2D [[ ! -L ${file} ]] && s=3D$(stat_perms "$file") =2D if [ "$USERLAND" =3D=3D "BSD" ] || [ "$USERLAND" =3D=3D "Darwin" ];then =2D chgrp wheel "$file" + if [ -L ${file} ]; then + lchgrp 0 "${file}" else =2D chgrp root "$file" + s=3D$(stat_perms "$file") + chgrp 0 "$file" + chmod "$s" "$file" fi =2D [[ ! -L ${file} ]] && chmod "$s" "$file" done if (( $count > 0 )); then ewarn "$count files were installed with group portage!" --Boundary-01=_P263Cw+mp0JGIGH-- --nextPart35064940.GQPE0faN1f Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBC362QxvWNPsk/ZP4RAifhAJwMX/lX4DaPdOsphxl2UOIq9Qq01QCfeT+c x+g8W6vvFMI2h3ytr5HftH4= =J7lw -----END PGP SIGNATURE----- --nextPart35064940.GQPE0faN1f-- -- gentoo-portage-dev@gentoo.org mailing list