Commits

Paul Ruane committed 2612834

Prevented nested tag directories from being deleted as the tag it represents may still be in use.

  • Participants
  • Parent commits 2e1f7cf

Comments (0)

Files changed (1)

File src/tmsu/vfs/fusevfs.go

 
 	switch path[0] {
 	case tagsDir:
-		tagName := path[len(path)-1]
+		if len(path) != 2 {
+			// can only remove top-level tag directories
+			return fuse.EPERM
+		}
+
+		tagName := path[1]
 		tag, err := vfs.store.TagByName(tagName)
 		if err != nil {
 			log.Fatalf("could not retrieve tag '%v': %v", tagName, err)
 		return fuse.OK
 	case queriesDir:
 		if len(path) != 2 {
+			// can only remove top-level queries directories
 			return fuse.EPERM
 		}