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

Bug 299367

Summary: dev-ruby/i18n-0.3.2 setting homedir permissions doesn't work for custom TMPDIR
Product: Gentoo Linux Reporter: Martin Jansa <Martin.Jansa>
Component: [OLD] DevelopmentAssignee: Gentoo Ruby Team <ruby>
Status: RESOLVED FIXED    
Severity: normal CC: bugs_gentoo_org.korobkov, ec5983, levertond, uzytkownik2
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fixes paludis installation
dev-ruby-HOME-fix.patch

Description Martin Jansa 2010-01-02 15:54:20 UTC
I have own TMPDIR setting because I share it with ie bitbake work dir for building.

Its set for portage to
PORTAGE_TMPDIR=/tmp/tmpwork
then WORKDIR looks like
WORKDIR: /tmp/tmpwork/portage/dev-ruby/i18n-0.3.2/work

old expresion for homedir ${WORKDIR/work/homedir}
 * old: /tmp/tmphomedir/portage/dev-ruby/i18n-0.3.2/work
new expresion for homedir ${WORKDIR/\/work//homedir} works for me:
 * new: /tmp/tmpwork/portage/dev-ruby/i18n-0.3.2/homedir

To make it a bit more safer (bash replace seems to not support $ for checking end of string) I used 
HOMEDIR=`echo ${WORKDIR} | sed 's#/work$#/homedir#g'`
in both src_prepare and src_test, because I got QA notice if it is defined in global section:

jama ~ # ebuild /usr/portage/dev-ruby/i18n/i18n-0.3.2.ebuild digest
 * QA Notice: 'sed' called in global scope: dev-ruby/i18n-0.3.2

If having word "work" in PORTAGE_TMPDIR is considered unsupported then please ignore&close this bug :).

Thanks

Reproducible: Always
Comment 1 Harris Landgarten 2010-01-02 19:34:06 UTC
this also causes paludis the fail:

 * Running source copy phase for ruby18 ...
chmod: cannot access `/var/tmp/paludis/dev-ruby-i18n-0.3.2/homedir': No such file or directory

!!! ERROR in dev-ruby/i18n-0.3.2::gentoo:
!!! In src_prepare at line 4114
!!! Failed to fix permissions on home

Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-01-03 13:29:35 UTC
Actually the permission mangling is just temporary so it should go away soonish.
Comment 3 Harris Landgarten 2010-01-03 21:43:56 UTC
this also causes paludis the fail:

 * Running source copy phase for ruby18 ...
chmod: cannot access `/var/tmp/paludis/dev-ruby-i18n-0.3.2/homedir': No such file or directory

!!! ERROR in dev-ruby/i18n-0.3.2::gentoo:
!!! In src_prepare at line 4114
!!! Failed to fix permissions on home

Comment 4 Samu Voutilainen 2010-02-04 16:15:15 UTC
I confirm that brokes compilation with paludis completely. 

And as this is pulled by activesupport, you can૑t really install rails from gentoo-86 on system you use paludis...
Comment 5 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-03-09 05:25:07 UTC
*** Bug 308547 has been marked as a duplicate of this bug. ***
Comment 6 David Leverton 2010-03-09 18:31:12 UTC
Is there any reason why this doesn't just use "${HOME}" (with the quotes)?
Comment 7 Andrey Korobkov 2010-07-22 13:04:50 UTC
Also confirm failing with paludis.
Is it difficult to fix? Does it depend on ebuild or on source code?
Comment 8 Samu Voutilainen 2010-07-22 13:48:50 UTC
Created attachment 239793 [details, diff]
Fixes paludis installation

Originally I thought I shouldn't publish this ugly patch, which isn't even tested but in one environment that runs Redmine. And I don't know how it behaves with portage, it is written for Paludis.
Comment 9 David Leverton 2010-07-22 21:33:21 UTC
Created attachment 239869 [details, diff]
dev-ruby-HOME-fix.patch

Patch to apply comment #6 suggestion to all dev-ruby ebuilds that use this pattern
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-22 21:59:54 UTC
Comment on attachment 239869 [details, diff]
dev-ruby-HOME-fix.patch

If userpriv is not set ${HOME} might touch outside the sandbox.
Comment 11 Bo Ørsted Andresen 2010-07-23 09:10:50 UTC
(In reply to comment #10)
> (From update of attachment 239869 [details, diff])
> If userpriv is not set ${HOME} might touch outside the sandbox.

HOME is an environment variable set by your package manager to the desired value in a directory in the sandbox. The actual home directories of the portage or root users are irrelevant. Hence so is userpriv.
Comment 12 Andrey Korobkov 2010-07-23 13:02:25 UTC
Also confirm this with dev-ruby/i18n-0.3.7

Thanks for the patches, Samu, but why are they obsoletted?
Comment 13 David Leverton 2010-07-23 17:49:27 UTC
Comment on attachment 239869 [details, diff]
dev-ruby-HOME-fix.patch

As Bo said - the stated behaviour is required by PMS, and zmedico confirms that Portage does indeed do it.  And if that weren't the case, RubyInline would itself cause a violation when it tried to put its own files in $HOME
Comment 14 Samu Voutilainen 2010-07-23 18:06:34 UTC
(In reply to comment #12)
> Also confirm this with dev-ruby/i18n-0.3.7
> 
> Thanks for the patches, Samu, but why are they obsoletted?
> 

If this fix (and problem) doesn't affect Portage, please say so and I'll put it to Paludis, or as another bug if it still is ebuild problem...
Comment 15 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-07-29 00:15:28 UTC
Fixed.