Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Might fail on macOS for obscure reasons #1

Closed
baskerville opened this issue Oct 30, 2016 · 4 comments
Closed

Might fail on macOS for obscure reasons #1

baskerville opened this issue Oct 30, 2016 · 4 comments

Comments

@baskerville
Copy link
Contributor

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
Copy link
Owner

NiLuJe commented Nov 4, 2016

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
Copy link
Contributor Author

More generally you might want to ignore:

  • Hidden INI files.
  • INI files that do not contain a [watch] section.
  • INI files for which the mandatory fields aren't specified (or empty).

@NiLuJe NiLuJe closed this as completed in ef58234 Nov 27, 2016
@NiLuJe
Copy link
Owner

NiLuJe commented Nov 27, 2016

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

@NiLuJe
Copy link
Owner

NiLuJe commented Apr 14, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants