aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gmail.com>2010-10-31 19:39:41 +0100
committerJory A. Pratt <anarchy@gentoo.org>2010-10-31 16:18:38 -0500
commit09bed967bf610ee9e52a7eab772fa6f9c7b3e00b (patch)
treed246575ce8216520ca0e4bffd2d166c1ac8f8e7d /init.d
parent060b19e3e3afdd9af511d295ea944eb55dfec70b (diff)
Allow cleaning up of pam_mktemp-based temporary directories.
This was blacklisted before, so the .private directories never had their content cleaned up, even if WIPE_TMP was set to yes.
Diffstat (limited to 'init.d')
-rw-r--r--init.d/bootmisc.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in
index 9708a247..9a3b1fa1 100644
--- a/init.d/bootmisc.in
+++ b/init.d/bootmisc.in
@@ -35,6 +35,12 @@ cleanup_tmp_dir()
# Faster than find
rm -rf -- [^ajlq\.]*
+ # pam_mktemp creates a .private directory within which
+ # each user gets a private directory with immutable
+ # bit set; remove the immutable bit before trying to
+ # remove it.
+ [ -d /tmp/.private ] && chattr -R -a /tmp/.private
+
find $startopts ! -name . \
! -path "./lost+found" \
! -path "./lost+found/*" \
@@ -48,8 +54,6 @@ cleanup_tmp_dir()
! -path "./aquota.group/*" \
! -path "./journal" \
! -path "./journal/*" \
- ! -path "./.private" \
- ! -path "./.private/*" \
-exec rm -rf {} \;
eend 0
else