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

Bug 557222

Summary: sys-apps/openrc: savecache should be checking for write permissions on $RC_LIBEXECDIR/cache first?
Product: Gentoo Hosted Projects Reporter: Joe M <joe9mail>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Joe M 2015-08-10 13:41:37 UTC
Hello,

When root (/) is read-only, but, /lib64/rc/{cache,tmp} are read-writable as below:
ls --color=always --classify --human-readable -l --sort=time --reverse --all /lib64/rc
total 28K
drwxr-xr-x  2 root root 4.0K Aug 20  2014 cache.old/
lrwxrwxrwx  1 root root   13 Aug 21  2014 cache -> /var/rc/cache/
lrwxrwxrwx  1 root root   11 Aug 21  2014 tmp -> /var/rc/tmp/
lrwxrwxrwx  1 root root   15 Aug 21  2014 console -> /var/rc/console/
-rw-r--r--  1 root root    5 Jun 30 00:37 version
drwxr-xr-x  6 root root 4.0K Jun 30 00:37 ./
drwxr-xr-x  2 root root 4.0K Jun 30 00:37 bin/
drwxr-xr-x  2 root root 4.0K Jun 30 00:37 sh/
drwxr-xr-x  2 root root 4.0K Jun 30 00:37 sbin/
drwxr-xr-x 13 root root 4.0K Jul 29 00:30 ../

savecache should check if /lib64/rc/cache is writable when saving the dependency cache on shutdown. Instead, savecache is checking the permissions of /lib64/rc and is assuming that any child directories would have the same permissions too.

Please let me know if you need more information,

Thanks

Reproducible: Always
Comment 1 dwfreed 2015-08-10 14:57:19 UTC
Pushed a much better implemented savecache to master; Joe confirms it works for his case, and I know it still handles the other important cases.