aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-11-03 21:38:59 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-11-03 21:38:59 (GMT)
commit98954ccb0afd69ec390907798cc3de8c92777d52 (patch)
treefc1bc356f4727a75df0b9ba23820d99c3929e8a4
parente537768f1e54c89e5b7cda75899a7d0b30830980 (diff)
downloadfusearchive-98954ccb0afd69ec390907798cc3de8c92777d52.zip
fusearchive-98954ccb0afd69ec390907798cc3de8c92777d52.tar.gz
fusearchive-98954ccb0afd69ec390907798cc3de8c92777d52.tar.bz2
Allow unlinking symlinks correctly without unallocating block refs or
going outside the tree
-rw-r--r--FuseArchive/FileSystem.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/FuseArchive/FileSystem.py b/FuseArchive/FileSystem.py
index dfb5515..0d38f7b 100644
--- a/FuseArchive/FileSystem.py
+++ b/FuseArchive/FileSystem.py
@@ -47,10 +47,12 @@ class FileSystem(fuse.Fuse):
yield fuse.Direntry(e)
def unlink(self, path):
- # Ask our file to release it's chunks
- f = ChunkFile( path, os.O_RDWR, 0 )
- f.pre_unlink()
- f.release( 0 )
+ if os.path.isfile( path ) and not os.path.islink( path ):
+ # Ask our file to release it's chunks
+ f = ChunkFile( path, os.O_RDWR, 0 )
+ f.pre_unlink()
+ f.release( 0 )
+
os.unlink("./tree" + path)
def rmdir(self, path):