Wind4 / vlmcsd

KMS Emulator in C (currently runs on Linux including Android, FreeBSD, Solaris, Minix, Mac OS, iOS, Windows with or without Cygwin)
https://forums.mydigitallife.net/threads/50234
8.35k stars 2.23k forks source link

It's better to use UNIX line endings (LF) in ini #22

Closed dartraiden closed 4 years ago

dartraiden commented 5 years ago

vlmcsd.ini uses Windows line endings (CR LF)

This cause problems on some UNIX systems. For example, my Mi Router 3G with Padavan firmware

My vlmcsd.ini:

# Listen on all private IP addresses and reject incoming requests from public IP addresses
# Command line: -o
PublicIPProtectionLevel = 3
/etc/storage # ./vlmcsd -i /etc/storage/vlmcsd.ini
". Must be integer between 0 and 3ine 55: "PublicIPProtectionLevel = 3

Converting ini to LF solves problem.

rouben commented 5 years ago

Line endings are platform dependent, and since vlmcsd is cross-platform, I would imagine it would make sense to make the code handles both LF and CRLF on any platform... I can suggest that upstream to the developer, and in the meantime, will look at the source code to see where ini file parsing is handled.

rouben commented 5 years ago

I’ve looked at the config file parsing code and it’s... rather unorthodox. vlmcsd bootstraps itself while reading the config file. Not sure why the dev (Hotbird64) chose this path, whether it’s just laziness, i.e. “evolution” of a quick hack into the codebase it is today, or whether there’s a “good” reason for doing this, such as efficiency or optimizing memory usage, for example.

I’m probably completely wrong here, but I think this “fix” would entail modifying multiple lines rather than changing a single function dealing with the config file, because there is no single function dealing with the config file. I am probably completely wrong on this, though.

In either case, it’s best to make the suggestion to the author upstream, not here.

rouben commented 5 years ago

The author (HotBird64) is aware of this issue and has committed to fixing it in future releases.

rouben commented 4 years ago

Still no new releases with fixes for this upstream. I did not forget about this issue. :)

rouben commented 4 years ago

This has been resolved in release svn1113.