diff options
author | Michael Stone <michael@laptop.org> | 2009-12-06 00:48:47 (GMT) |
---|---|---|
committer | Michael Stone <michael@laptop.org> | 2009-12-06 00:48:47 (GMT) |
commit | 23f51f3ef972ad631b6c637daab5ed3e6a51b330 (patch) | |
tree | bf897917a9e74dfbe446292c5f32168cd115eb06 | |
parent | ffd4bc469644caf8a28cd9244cd71c1f69ad93b3 (diff) |
Clean up group membership.
-rwxr-xr-x | rainbow/bin/rainbow-gc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rainbow/bin/rainbow-gc b/rainbow/bin/rainbow-gc index 22e9e3e..24f2063 100755 --- a/rainbow/bin/rainbow-gc +++ b/rainbow/bin/rainbow-gc @@ -6,6 +6,7 @@ from subprocess import call, check_call, CalledProcessError from os import listdir, unlink from os.path import join, isdir, islink, exists from optparse import OptionParser +from glob import glob from rainbow.util import trace, make_reporter @@ -42,6 +43,10 @@ def gc_uid(spool, uid): # NB: it is important that rm -rf doesn't follow links. <MS> check_call(['/bin/rm', '-r', '-f', row]) + for row in glob(join(spool, 'gid_to_members', '*', uid)): + # NB: it is important that rm -rf doesn't follow links. <MS> + check_call(['/bin/rm', '-r', '-f', row]) + # So long as we unlink the reservation last, we run no risk of seeing inconsistency unlink(reservation) |