Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 671808 - sys-apps/portage-2.3.51: write permission on PORTAGE_TMPDIR during sync
Summary: sys-apps/portage-2.3.51: write permission on PORTAGE_TMPDIR during sync
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 671498
  Show dependency tree
 
Reported: 2018-11-24 17:09 UTC by Fabio Rossi
Modified: 2019-04-11 03:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.gz (emerge-info.txt.gz,7.90 KB, application/gzip)
2018-11-24 17:11 UTC, Fabio Rossi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Rossi 2018-11-24 17:09:47 UTC
I set PORTAGE_TMPDIR to a mount-point directory. emerge probably executes as root when creates ${PORTAGE_TMPDIR}/portage before dropping the privileges to portage:portage for the building process. I see instead a problem during the sync phase because rsync, executed as portage user, cannot write a temporary file in ${PORTAGE_TMPDIR} so it fails. 

This issue seems related to Bug 340046 which is fixed but see what happens now:

>>> Starting retry 1 of 18 with rsync://88.198.224.205/gentoo-portage
Welcome To
        ____ _____ _____    _    _     _____ ____               _
       / ___|_   _| ____|  / \  | |   | ____|  _ \   _ __   ___| |_
       \___ \ | | |  _|   / _ \ | |   |  _| | |_) | | '_ \ / _ \ __|
        ___) || | | |___ / ___ \| |___| |___|  _ < _| | | |  __/ |_
       |____/ |_| |_____/_/   \_\_____|_____|_| \_(_)_| |_|\___|\__|

IP: 88.198.224.205
AKA: rsync7.de.gentoo.org
AKA: rsync.gentoo.stealer.net

Connection: 1 GBit/s, rsync limited to 20 connections
Location: Nuernberg, Germany
Contact: Sven Wegener <swegener@gentoo.org>

receiving incremental file list
rsync: mkstemp "/mnt/tmp/.tmps3maPz.TJwqyv" failed: Permission denied (13)
             32 100%   31.25kB/s    0:00:00 (xfr#1, to-chk=0/1)

Number of files: 1 (reg: 1)
Number of created files: 0
Number of deleted files: 0
Number of regular files transferred: 1
Total file size: 32 bytes
Total transferred file size: 32 bytes
Literal data: 32 bytes
Matched data: 0 bytes
File list size: 41
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 104
Total bytes received: 127

sent 104 bytes  received 127 bytes  154.00 bytes/sec
total size is 32  speedup is 0.14
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1659) [generator=3.1.3]
Comment 1 Fabio Rossi 2018-11-24 17:11:50 UTC
Created attachment 556126 [details]
emerge-info.gz
Comment 2 Larry the Git Cow gentoo-dev 2019-01-03 07:11:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=8ddc902ba8cb4712a2a8b49f46951c8ec326a678

commit 8ddc902ba8cb4712a2a8b49f46951c8ec326a678
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-01-03 02:48:32 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-01-03 06:21:42 +0000

    rsync: use ${PORTAGE_TMPDIR}/portage (bug 671808)
    
    Write temporary timestamp files in ${PORTAGE_TMPDIR}/portage,
    since writing files directly in ${PORTAGE_TMPDIR} is generally
    unexpected. Also, use the rsync --inplace option, since it's
    writing to a temp file created in advance and the usersync
    user does not necessarily have write access to the parent
    directory.
    
    Bug: https://bugs.gentoo.org/671808
    Bug: https://bugs.gentoo.org/336503
    Fixes: 3f7f72cf339d ("Bug #336503 - Use PORTAGE_TMPDIR for the emerge --sync server timestamp")
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/sync/modules/rsync/rsync.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2019-01-04 06:03:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=549e77312735f9f19863daafaef0382ab1a2157f

commit 549e77312735f9f19863daafaef0382ab1a2157f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-01-04 04:01:57 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-01-04 06:03:28 +0000

    sys-apps/portage: version bump to 2.3.54
    
     #671808 rsync: fix usersync timestamp file permission issue
     #673738 fix PORTAGE_TMPDIR=/ edge case
     #673900 validate unshare calls
    
    Bug: https://bugs.gentoo.org/671808
    Bug: https://bugs.gentoo.org/673738
    Bug: https://bugs.gentoo.org/673900
    Package-Manager: Portage-2.3.54, Repoman-2.3.12
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.54.ebuild | 270 +++++++++++++++++++++++++++++++++
 2 files changed, 271 insertions(+)
Comment 4 Zac Medico gentoo-dev 2019-04-10 04:33:33 UTC
Fixed in portage-2.3.62.