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

Bug 520460

Summary: app-portage/eix installs into paths that should be created at runtime
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: Martin Väth <martin>
Status: RESOLVED FIXED    
Severity: normal CC: axs, proxy-maint, xmw
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 520404    

Description Agostino Sarubbo gentoo-dev 2014-08-22 08:20:21 UTC
This is an auto-filled bug because this package should create some paths at runtime.

 * QA Notice: This ebuild installs into paths that should be created at runtime.
 *  To fix, simply do not install into these directories.  Instead, your package
 *  should create dirs on the fly at runtime as needed via init scripts/etc...
 * 
 *   var/cache
 *   var/cache/eix
 *   var/cache/eix/.keep_app-portage_eix-0
Comment 1 Martin Väth 2014-08-22 10:42:11 UTC
This is a false positive.

eix installs corresponding "code" in /usr/lib/tmpfiles.d/eix.conf
but installs the directories *additionally*.

The latter should not change, since it has several advantages:

1. The directories are available immediately.
2. Users can locate the corresponding package with tools like qfile.
3. When uninstalling eix, the directories are removed (if empty).
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2014-08-22 13:44:48 UTC
(In reply to Agostino Sarubbo from comment #0)
>  *   var/cache/eix/.keep_app-portage_eix-0


I wonder if doing 'keepdir' on this path might be a bad thing, though..  

On a side note, does eix still create the dir itself if it doesn't exist, ie, if tmpfiles.d is not processed?
Comment 3 Martin Väth 2014-08-22 15:12:27 UTC
(In reply to Ian Stakenvicius from comment #2)
> >  *   var/cache/eix/.keep_app-portage_eix-0
> 
> I wonder if doing 'keepdir' on this path might be a bad thing, though..

With ancient portage versions, empty directories would not be installed.
Current portage versions install empty directories as well; actually,
I do not understand why "keepdir" still installs a dummy file.
Since we use current EAPI anyway, I think it is safe to replace
keepdir by dodir.

> On a side note, does eix still create the dir itself if it doesn't exist,
> ie, if tmpfiles.d is not processed?

No. It would be very problematic to do so due to eix running with permissions of portage (or possibly even lower permissions). eix would need to be very smart and create/change permissions of the parent directory before dropping permissions (in a rather configurable way to avoid issues with prefix or if the user wants a different configuration).

This does not seem right and is the reason why I "outsourced" the creation of the parent directories to tmpfiles.d and to the ebuild, respectively:

This is something which should be done during installation and during a reboot, and it should not cause complications or even raise security issues in the main program. If e.g. users change the eix path, they should not need hack around some "smart" behaviour of eix.
Comment 4 Martin Väth 2014-08-23 18:13:55 UTC
I just realized (I had completely forgotten about this):

In the eix-0.30.2 ebuild the 'keepdir' is already unused:
Creation/removal takes place in pkg_postinst and pkg_postrm, respectively, so >=eix-0.30.2 shouldn't even trigger the QA Notice anymore.

(Unfortunately, this also means that users are no longer able to apply qfile, but I guess it is not such a big deal to understand which package uses /var/cache/eix).

So it seems to me that this bug is actually fixed, already...
Comment 5 Agostino Sarubbo gentoo-dev 2014-08-23 19:59:03 UTC
feel free to close when the fixed version is stable
Comment 6 Martin Väth 2014-11-16 16:58:08 UTC
Closing to not hinder stabilization of eix-0.30.4