From 98954ccb0afd69ec390907798cc3de8c92777d52 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Tue, 3 Nov 2009 13:38:59 -0800 Subject: Allow unlinking symlinks correctly without unallocating block refs or going outside the tree 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): -- cgit v0.10.2