Skip group/owner tarsync options for tarsync if chown on /usr/portage
authorZac Medico <zmedico@gentoo.org>
Fri, 2 May 2008 02:56:45 +0000 (02:56 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 2 May 2008 02:56:45 +0000 (02:56 -0000)
fails, since the user might still be able to sync even though the
chown call is not permitted.

svn path=/main/trunk/; revision=10070

bin/emerge-webrsync

index ae4dfff354e63f53e4cb9fa8b47d0740b4069bb0..24733840bbfbd70070b3f65cbb3dbc96b03cf76b 100755 (executable)
@@ -174,7 +174,10 @@ sync_local() {
        vecho "Syncing local tree ..."
 
        if type -P tarsync > /dev/null ; then
-               if ! tarsync $(vvecho -v) -s 1 -o portage -g portage -e /distfiles -e /packages -e /local "${file}" "${PORTDIR}"; then
+               local chown_opts="-o portage -g portage"
+               chown portage:portage portage > /dev/null 2>&1 || chown_opts=""
+               if ! tarsync $(vvecho -v) -s 1 ${chown_opts} \
+                       -e /distfiles -e /packages -e /local "${file}" "${PORTDIR}"; then
                        eecho "tarsync failed; tarball is corrupt? (${file})"
                        return 1
                fi