oniony / TMSU

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

TMSU mount script enhancements #237

Closed mpeter50 closed 2 years ago

mpeter50 commented 2 years ago

While setting up Advanced Mounting I noticed some problems with the mount script. I've also found the solution for them, so I'll soon follow with a PR.

  1. Path parameter word splitting If the database path or the mountpoint contains spaces, tmsu will print tmsu: too many arguments because the paths have got split at the spaces, and now instead of the 2 path params there is more. Also, this might cause other problems if one of the paths contain special characters, like &, or accented ones (non-english). Word splitting happens here. I think all of this is avoided if the argument references are put in quotes, because the shell makes sure that it will be one "word".

  2. options argument documentation On the linked Wiki page the allow_other option is not mentioned, so the users might not know that it can be used also if they automount the VFS. This can be a problem because when I tested the mounting functinality with sudo mount ..., I wasn't able to ls the VFS directory because of permission problems. Also, the option is mentioned in the mount helper script, but incorrectly: copy-pasting it won't work, because the option there isn't preceeded with --.

  3. options=allow_other as mount option I think it could be a good idea to make it possible to use allow_other as an option to the mount command. When debugging the word splitting, I noticed that mount passes all of the options it got to helper scripts, so it's possible to read custom options.

mpeter50 commented 2 years ago

@oniony thank you for the merge! Though I just had a question relating to the mount subcommand. Is it possible that the database path ([FILE] in tmsu mount [OPTION]... [FILE] MOUNTPOINT) is currently ignored, and it is always searched starting from the current working directory?

Asking because it seems I'm unable to specify the db path in the above mentioned command even without my changes; the --versbose option shows tmsu will always search my directories for a db file.

Until now I've always used tmsu mount from a subdir of the dir where the db file is, so I didn't notice it.

mpeter50 commented 2 years ago

(moved to #239)