NiLuJe / kfmon

Kute File Monitor, an inotify-based Launcher for Kobo devices
http://www.mobileread.com/forums/showthread.php?t=274231
GNU General Public License v3.0
278 stars 15 forks source link

Might fail on macOS for obscure reasons #1

Closed baskerville closed 7 years ago

baskerville commented 8 years ago

macOS sometimes creates metadata files on FAT32 file systems and kfmon might try to parse one of those files as a configuration file:

[KFMon] [2016-10-28 @ 22:31:36] Initializing KFMon v0.9-16-g9b914a8 | Built on May 16 2016 @ 23:24:16 | Using SQLite 3.12.2 (built against version 3.12.2)
[KFMon] [2016-10-28 @ 22:31:36] Trying to load config file '/mnt/onboard/.adds/kfmon/config/koreader.ini' . . .
[KFMon] [2016-10-28 @ 22:31:36] Watch config @ index 0 loaded from 'koreader.ini': filename=/mnt/onboard/koreader.png, action=/mnt/onboard/.adds/koreader/koreader.sh, do_db_update=0, db_title=KOReader, db_author=KOReader Devs, db_comment=An eBook reader application
[KFMon] [2016-10-28 @ 22:31:36] Trying to load config file '/mnt/onboard/.adds/kfmon/config/._koreader.ini' . . .
[KFMon] [2016-10-28 @ 22:31:36] Watch config @ index 1 loaded from '._koreader.ini': filename=, action=, do_db_update=0, db_title=, db_author=, db_comment=
[KFMon] [2016-10-28 @ 22:31:36] Trying to load config file '/mnt/onboard/.adds/kfmon/config/kfmon.ini' . . .
[KFMon] [2016-10-28 @ 22:31:36] Daemon config loaded from 'kfmon.ini': db_timeout=450, use_syslog=0
[KFMon] [2016-10-28 @ 22:31:36] Trying to load config file '/mnt/onboard/.adds/kfmon/config/._kfmon.ini' . . .
[KFMon] [2016-10-28 @ 22:31:36] Watch config @ index 2 loaded from '._kfmon.ini': filename=, action=, do_db_update=0, db_title=, db_author=, db_comment=
[KFMon] [2016-10-28 @ 22:31:36] Beginning the main loop.
[KFMon] [2016-10-28 @ 22:31:36] Initializing inotify.
[KFMon] [2016-10-28 @ 22:31:36] Setup an inotify watch for '/mnt/onboard/koreader.png' @ index 0.
[KFMon] [2016-10-28 @ 22:31:36] Cannot watch ''! Giving up.
[KFMon] inotify_add_watch: No such file or directory
NiLuJe commented 8 years ago

Good point, I'll try to remember to exclude those fake resource forks (AFAIK, they're always prefixed by ._, which should make it easy enough to deal with ;).

baskerville commented 8 years ago

More generally you might want to ignore:

NiLuJe commented 7 years ago

I'll try to push an updated binary build sometimes during my winter break (in a few weeks). Ping me if I forget ;).

NiLuJe commented 6 years ago

And I also finally got around to adding a bit of input validation around the parsing of config files, covering most of those suggestions. Yay!