oniony / TMSU

TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.
Other
2.05k stars 120 forks source link

Tag names CAN contain the / character #180

Open 0ion9 opened 4 years ago

0ion9 commented 4 years ago

(contrary to what help and the wiki say)

Just found this due to an automation bug. Test case:

cd /tmp/
tmsu init .
touch foo
tmsu tag foo foo/bar/baz
tmsu tags
tmsu files foo/bar/baz

In all respects these behave as if / is acceptable -- the tagging goes through, and the 'tmsu files' command returns the correct filename.

I made similar checks for backslash; it is possible to apply a tag containing backslash, but it cannot be queried using files. Neither tags containing / nor \ can be chdired to in the VFS.

Overall conclusion:

TMSU version: "0.8.0", latest git (rebuilt today)

oniony commented 4 years ago

Yes, this change is in the release notes for v0.7.0. Slashes are allowed but use is discouraged as the VFS does not support them. A similar looking Unicode character is substituted on the VFS. You should be able to change to the directories if you tab complete the name.

The wiki and help are likely out of date. I'll leave this open to fix that.

On Mon, 6 Jan 2020, 06:14 David Gowers, notifications@github.com wrote:

(contrary to what help and the wiki say)

Just found this due to an automation bug. Test case:

cd /tmp/ tmsu init . touch foo tmsu tag foo foo/bar/baz tmsu tags tmsu files foo/bar/baz

In all respects these behave as if / is acceptable -- the tagging goes through, and the 'tmsu files' command returns the correct filename.

I made similar checks for backslash; it is possible to apply a tag containing backslash, but it cannot be queried using files. Neither tags containing / nor \ can be chdired to in the VFS.

Overall conclusion:

  • validation may not be firing at all on 'tmsu tag' (and untag? I didn't test that)
  • validation is incomplete for tmsu files

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/180?email_source=notifications&email_token=AAABOB62B3PJZXVBAKKYPYLQ4LD5BA5CNFSM4KDAAE7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IEESVIQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABOB477XHQCQK77JHEE2TQ4LD5BANCNFSM4KDAAE7A .

0ion9 commented 4 years ago

I see. In some ways this is a very convenient change. However, judging from your reply I feel as if I may need to make my second point again: that backslash is also (buggily/inconsistently) allowed, and unless I'm being confused by escaping rules, that seems like it is definitely a wrong behaviour; it should either be always accepted or always rejected.

oniony commented 4 years ago

It should, but it's a fringe case and I'm struggling for time to fix anything at the moment.

On Mon, 6 Jan 2020, 23:23 David Gowers, notifications@github.com wrote:

I see. However, judging from your reply I feel as if I may need to point out that backslash is also (buggily/inconsistently) allowed, and unless I'm being confused by escaping rules, that seems like it is definitely a wrong behaviour; it should either be always accepted or always rejected.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/180?email_source=notifications&email_token=AAABOB3OCI3VTPDE2WTNOQLQ4O4PNA5CNFSM4KDAAE7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIHEDLI#issuecomment-571359661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABOB53ZYESDQOXLDRVRX3Q4O4PNANCNFSM4KDAAE7A .

oniony commented 4 years ago

Backslash seems to work fine to me. Or do you mean in the VFS?

tmsu tag somefile \\\\
tmsu files \\\\