diff options
author | Michael Stone <michael@laptop.org> | 2009-12-06 00:49:26 (GMT) |
---|---|---|
committer | Michael Stone <michael@laptop.org> | 2009-12-06 00:49:26 (GMT) |
commit | 92d18526e561058ba84321407398478ea55e982e (patch) | |
tree | a585d5b0f82864128783e073cd7773bccd8228ae | |
parent | 23f51f3ef972ad631b6c637daab5ed3e6a51b330 (diff) |
Protect sticky uids from garbage collection.
-rwxr-xr-x | rainbow/bin/rainbow-gc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rainbow/bin/rainbow-gc b/rainbow/bin/rainbow-gc index 24f2063..2ab493c 100755 --- a/rainbow/bin/rainbow-gc +++ b/rainbow/bin/rainbow-gc @@ -17,6 +17,9 @@ def active_uid(uid): return ret == 0 raise CalledProcessError(ret, cmd) +def sticky_uid(spool, uid): + return exists(join(spool, "sticky_uids", uid)) + def gc_uid(spool, uid): """This function conservatively attempts to garbage-collect stale uid reservations. @@ -35,7 +38,7 @@ def gc_uid(spool, uid): uid_num = int(uid) assert uid_num >= 1000 and uid_num <= 65534 # XXX: magic numbers from util/spool.py - if active_uid(uid): + if active_uid(uid) or sticky_uid(spool, uid): return for table in ('uid_to_instance_dir', 'uid_to_home_dir', 'uid_to_gid'): |