Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 176008

Summary: emerge-delta-webrsync stalls when run as non-root user
Product: Gentoo Linux Reporter: Rudi Lippert <gentoo>
Component: Current packagesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: write2David, zmedico
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 454046    
Bug Blocks:    
Attachments: possible patch
Handle FEATURES=usersync
Check write permission for PORTDIR and DISTDIR

Description Rudi Lippert 2007-04-25 18:56:12 UTC
I accidentally ran emerge-delta-webrsync as a normal user today, and it pretended to do something:
# emerge-delta-webrsync
Looking for available base versions for a delta
found a stale snapshot.  cleansing
...and stayed at that point forever.
The correct behavior would be to report that the program has to be run as root and exit.
Comment 1 Rudi Lippert 2007-04-25 19:10:17 UTC
Created attachment 117261 [details, diff]
possible patch

The user check could probably be performed at a more suitable position in the code, but I don't have enough knowledge of it.
Comment 2 Zac Medico gentoo-dev 2012-08-14 03:32:36 UTC
Created attachment 321266 [details, diff]
Handle FEATURES=usersync

(In reply to comment #1)
> Created attachment 117261 [details, diff] [details, diff]
> possible patch
> 
> The user check could probably be performed at a more suitable position in
> the code, but I don't have enough knowledge of it.

I don't want to disable running it as non-root, since it's valid to run as non-root with FEAUTURE=usersync if we apply the attached patch.

The reason it stalled for you is that rm went into interactive mode while its prompt was redirected to /dev/null. We can fix that by using rm -f (I'll attach a patch for that).
Comment 3 Zac Medico gentoo-dev 2012-08-14 03:48:34 UTC
Created attachment 321268 [details, diff]
Check write permission for PORTDIR and DISTDIR

These permission checks should make it bail out earlier, so you won't trigger the interactive rm call. I'll add in the rm -f option later.
Comment 4 Zac Medico gentoo-dev 2012-08-18 01:36:17 UTC
(In reply to comment #2)
> Created attachment 321266 [details, diff] [details, diff]
> Handle FEATURES=usersync

In git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87a769bdab8e54c68260996026c87d3d7845d2e6

(In reply to comment #3)
> Created attachment 321268 [details, diff] [details, diff]
> Check write permission for PORTDIR and DISTDIR

Also in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9807b6646b8f9ce6d67b03cddfe4b9d0b02288bf
Comment 6 Zac Medico gentoo-dev 2012-08-19 06:17:28 UTC
This is fixed in version 3.6.