Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 557222 - sys-apps/openrc: savecache should be checking for write permissions on $RC_LIBEXECDIR/cache first?
Summary: sys-apps/openrc: savecache should be checking for write permissions on $RC_LI...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2015-08-10 13:41 UTC by Joe M
Modified: 2015-08-10 15:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.