projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d86fdcb
)
- blind chmod 0 before unlinking files to avoid anybody doing sneaky stuff via hardlinks
author
Ned Ludd
<solar@gentoo.org>
Mon, 21 May 2007 19:27:28 +0000
(19:27 -0000)
committer
Ned Ludd
<solar@gentoo.org>
Mon, 21 May 2007 19:27:28 +0000
(19:27 -0000)
svn path=/main/trunk/; revision=6563
pym/portage/dbapi/vartree.py
patch
|
blob
|
history
diff --git
a/pym/portage/dbapi/vartree.py
b/pym/portage/dbapi/vartree.py
index d438cbee029374592102f37c466450aae9755a2f..3c7e646ebaeefb9aa6620e3e2eb2206fa4d92445 100644
(file)
--- a/
pym/portage/dbapi/vartree.py
+++ b/
pym/portage/dbapi/vartree.py
@@
-1211,6
+1211,10
@@
class dblink(object):
writemsg_stdout("--- !md5 %s %s\n" % ("obj", obj))
continue
try:
+ if statobj.st_nlink > 1:
+ portage.writemsg("There are "+str(st.st_nlink-1)+" hardlinks to " + obj)
+ # Always blind chmod 0 before unlinking to avoid race conditions.
+ os.chmod(obj, 0000)
os.unlink(obj)
except (OSError, IOError), e:
pass