View previous topic :: View next topic |
Author |
Message |
bender86 Guru
Joined: 18 Mar 2005 Posts: 484
|
Posted: Wed Jul 07, 2010 7:04 pm Post subject: FEATURES=usersync does NOT drop to portage user for sync |
|
|
Hi
I am using usersync and userfetch in my FEATURES to have the emerge operations run by portage user, but this seems to work only partially. I setted these iptables rules:
Code: | iptables -A OUTPUT -m owner --uid-owner portage -p tcp --dport http -d $GENTOO_MIRROR -s $MY_IP -j ACCEPT
iptables -A OUTPUT -m owner --uid-owner portage -p tcp --dport rsync -d rsync.gentoo.org -s $MY_IP -j ACCEPT |
The former allows only portage user to download sources from the mirror (and this works). The latter allows only portage user to execute emerge --sync. If I cut off -m owner --uid-owner portage the sync runs fine, otherwise I get a timeout. During timeout I checked with ps aux and I found out that
Code: | ...
root 9778 1.0 0.2 4144 1176 pts/1 S+ 20:56 0:00 rsync --recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --verbose rsync://91.186.30.235/gentoo-portage/metadata/timestamp.chk /tmp/tmp39GzjS
... |
rsync is called by root! (and of course is blocked by firewall)
(note: as said in documentation, portage user is the owner of PORTDIR)
If I cut off the user constrain and I do a ps aux while syncing I get
Code: | ...
portage 9913 28.7 0.4 8136 2312 pts/1 D+ 20:57 0:01 rsync --recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --verbose rsync://134.68.240.40/gentoo-portage/ /usr/portage
portage 9916 7.6 0.8 49064 4136 pts/1 S+ 20:57 0:00 rsync --recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --verbose rsync://134.68.240.40/gentoo-portage/ /usr/portage
... |
So it seems that emerge drops to portage user only after syncing the timestamp file.
Is this behaviour correct? I can't see any reason why this happens. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9532 Location: beyond the rim
|
Posted: Thu Jul 08, 2010 1:43 am Post subject: |
|
|
Yeah, looks like the code simply doesn't pass the uid (and other stuff) to the first rsync call. Probably an oversight when that feature was added, file a bug about it and it should get fixed very quickly. |
|
Back to top |
|
|
|