Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28409 - repoman crashes on /var/cache/edb/repo.stats
Summary: repoman crashes on /var/cache/edb/repo.stats
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Douglas Russell (RETIRED)
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2003-09-10 19:49 UTC by Lars Weiler (RETIRED)
Modified: 2003-10-05 16:23 UTC (History)
2 users (show)

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


Attachments
Patch on portage 2.0.49-r7 to fix a permission problem with repoman (repoman.patch,1.00 KB, patch)
2003-10-04 10:25 UTC, Douglas Russell (RETIRED)
Details | Diff
Slightly better patch on portage 2.0.49-r7 to fix a permission problem with repoman (repoman.patch,1.08 KB, patch)
2003-10-04 10:43 UTC, Douglas Russell (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Weiler (RETIRED) gentoo-dev 2003-09-10 19:49:26 UTC
I changed my system so that PORTDIR is now the cvs checkout (and also the
SYNC-method).  After that I ran a chown to root:portage over /usr/portage and
made all group-writeable.

When I now run repoman (with scan or commit) as a user (that is in the
portage-group), I get an errormessage:

RepoMan scours the neighborhood...
Traceback (most recent call last):
  File "/usr/bin/repoman", line 700, in ?
    os.chown('/var/cache/edb/repo.stats',os.geteuid(),getgrnam('portage')[2])
OSError: [Errno 1] Operation not permitted: '/var/cache/edb/repo.stats'

This file has the following permissions:
-rw-rw-r--    1 root     portage       838 2003-09-11 04:48
/var/cache/edb/repo.stats

When I call repoman as root (or sudo) everything works as expected.

Reproducible: Always
Steps to Reproduce:
1. repoman scan in a PORTDIR-subdir
2. sudo repoman scan works
Comment 1 Douglas Russell (RETIRED) gentoo-dev 2003-09-11 01:37:19 UTC
Hmm. This appears to be my fault and is actually unrelated to you changing to a CVS PORTDIR. I'll try and fix it as soon as possible. A temporary work-a-round is to su to root, rm /var/cache/edb/repo.* and then use repoman as you would normally.

This bug is due to the fact that chown doesn't like being run as a user.

Puggy
Comment 2 Lars Weiler (RETIRED) gentoo-dev 2003-09-11 13:55:58 UTC
Another workaround is, to change the files' owner to the local user who is also in the portage group (instead of deleting them).

I tracked the problem a bit more deeper.  This is caused by the fact, that a user else than the owner of a file can't change the group, although he is in the group and the file is group-writeable.

Why do we need this check?  When the file has the right properties (-rw-rw-r-- and *:portage) repoman should not change it.  And if something is wrong, an errormessage would suffice.
Comment 3 Douglas Russell (RETIRED) gentoo-dev 2003-09-14 13:11:41 UTC
Baqsically because the file didn't exist in the first place. I could just put in an if statement which doesn't mess with the file if it exists. Will do that and see.

Puggy
Comment 4 Douglas Russell (RETIRED) gentoo-dev 2003-10-04 10:25:07 UTC
Created attachment 18752 [details, diff]
Patch on portage 2.0.49-r7 to fix a permission problem with repoman

Basically repoman will now check and see if portage is the group ID of the
pickled data files. If not it will change them to belong to group portage,
they
should only not belong to portage immediatly after creation seeing as this
code
will kick in and give them to group portage.

Puggy
Comment 5 Douglas Russell (RETIRED) gentoo-dev 2003-10-04 10:43:36 UTC
Created attachment 18753 [details, diff]
Slightly better patch on portage 2.0.49-r7 to fix a permission problem with repoman

Slightly better. Just in case some weirdness ever happened and the files
weren't chown'd the same.

Puggy
Comment 6 Nicholas Jones (RETIRED) gentoo-dev 2003-10-05 16:23:03 UTC
Included for 2.0.49-r8