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

Bug 427968

Summary: app-portage/gentoolkit - revdep-rebuild fails to run when /var/ is a symlink
Product: Portage Development Reporter: Vasco Figueira <vasco.figueira>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Vasco Figueira 2012-07-24 23:56:36 UTC
I have at root: /var -> var+tmp/var (root is on ssd, var and tmp aren't)

revdep-rebuild fails to run.


Reproducible: Always

Steps to Reproduce:
1. Create a symlink pointing /var to a different directory
2. Run revdep-rebuild

Actual Results:  
# revdep-rebuild -- --ask
 * Configuring search environment for revdep-rebuild
 * Working directory expected to be /var/cache/revdep-rebuild, but is /var+tmp/var/cache/revdep-rebuild


Expected Results:  
revdep-rebuild to run normally
Comment 1 Paul Varner (RETIRED) gentoo-dev 2012-07-25 15:40:22 UTC
This is done on purpose to prevent symlink attacks on revdep-rebuild when run as root.  The security bug for the design decision is Bug 203414.  Please note the discussion at the end of the bug for removing the check only applied when revdep-rebuild was run as a user.

The solution to fix the problem is to not use a symlink, but to bind mount the desired directories.

So assuming that you have the following:

/var+tmp/var is your desired location for /var instead of making /var as symlink to /var+tmp/var you want to do the following

mount --bind /var+tmp/var /var

The /etc/fstab entry to do this automatically should look like:
/var+tmp/var /var none bind

*** This bug has been marked as a duplicate of bug 263661 ***