Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 265607 - sys-apps/openrc-0.4.3-r1 /etc/init.d/bootmisc $wipe_tmp thinko
Summary: sys-apps/openrc-0.4.3-r1 /etc/init.d/bootmisc $wipe_tmp thinko
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: Low minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard: in upstream trunk (next release)
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-10 04:37 UTC by cypherpunks
Modified: 2009-10-11 09:14 UTC (History)
2 users (show)

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 cypherpunks 2009-04-10 04:37:40 UTC
The tmp-wiping code does an initial rm -rf (/etc/init.d/bootmisc line 35), and then follows up with a find that excludes a few directories worth preserving.

It's currently written
    # Faster than find
    rm -rf -- [b-ikm-pr-zA-Z0-9\.]*

    find ${startopts} ! -name . \
      ! -path "./lost+found" \
      ! -path "./lost+found/*" \
      ! -path "./quota.user" \
      ! -path "./quota.user/*" \
[snip]
      ! -path "./.private" \
      ! -path "./.private/*" \
      -exec rm -rf {} \;

The initial rm -rf pattern seems silly.  First, it explicitly includes ., which turns out not to work (try it with echo in your home directory!), and second it's a somewhat painful way to make an inverted set, something that sh has long supported.

How about simplifying and clarifying it to
    rm -rf -- [^lqaj.]*
Comment 1 Roy Marples 2009-04-12 13:00:04 UTC
Fixed here http://roy.marples.name/projects/openrc/changeset/1511

Thanks
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-14 01:59:05 UTC
I don't see a need to patch this myself (IOW, wait until next release) Thanks for your contribution.