Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582388 - sys-apps/portage-2.2.28: PermissionError: [Errno 1] Operation not permitted from os.utime when generating manifest
Summary: sys-apps/portage-2.2.28: PermissionError: [Errno 1] Operation not permitted f...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All All
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: portage-2.3.0
  Show dependency tree
 
Reported: 2016-05-07 23:20 UTC by Zac Medico
Modified: 2017-08-11 19:55 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2016-05-07 23:20:42 UTC
The utime function will fail with EPERM if the caller's effective UID does not match the owner of the file. This is triggered when attempting to set the mtime of a parent directory that is owned by a different user:

>>> Creating Manifest for /usr/portage/sci-biology/bwa
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.5/ebuild", line 338, in <module>
    vartree=portage.db[portage.root]['vartree'])
  File "/usr/lib64/python3.5/site-packages/portage/package/ebuild/doebuild.py", line 1066, in doebuild
    return not digestgen(mysettings=mysettings, myportdb=mydbapi)
  File "/usr/lib64/python3.5/site-packages/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/usr/lib64/python3.5/site-packages/portage/package/ebuild/digestgen.py", line 178, in digestgen
    mf.write(sign=False)
  File "/usr/lib64/python3.5/site-packages/portage/manifest.py", line 316, in write
    self._apply_max_mtime(preserved_stats, myentries)
  File "/usr/lib64/python3.5/site-packages/portage/manifest.py", line 390, in _apply_max_mtime
    os.utime(path, (max_mtime, max_mtime))
  File "/usr/lib64/python3.5/site-packages/portage/__init__.py", line 259, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
PermissionError: [Errno 1] Operation not permitted
Comment 1 Zac Medico gentoo-dev 2016-05-07 23:30:29 UTC
Since the utime call is non-essential except when generating manifests for distribution via rsync, we can simply display a warning message when it fails.
Comment 2 Zac Medico gentoo-dev 2016-05-08 22:06:53 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_582388

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/844d320c43a43eb63748878c29addc8c
Comment 4 Zac Medico gentoo-dev 2017-08-11 19:55:56 UTC
Fixed in 2.3.0.