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

Error parsing configuration when an ampersand ("&") is used in the userinfo #13

Open
neiljt opened this issue Feb 25, 2015 · 0 comments

Comments

@neiljt
Copy link

neiljt commented Feb 25, 2015

Writing a userinfo with an ampersand in the text causes the daemon to close with errors at the next run, it does not do so immediately, and the userinfo is handled and presented correctly as long as the daemon keeps running, which means the culprit is the xml config parser (and indeed it says so).

in the following output, which has identifying information replaced by "REDACTED"
and "SYSTEM", the intention was to provide the output of "museekcontrol"
as part of the userinfo, therefore including the (themed) bash prompt, which contains
an ampersand. the prompt is:

░▒▓█REDACTED@SYSTEM█▓▒░ Tuesday, 24th February. 23:34:14
[pts/0,11746$,1+;0&,0x] ~/:

and it provides information that may change every time the prompt is presented, like eg: time, exit status of the last process etc...

the parser helpfully prints out the contents of the incorrect line and flags the invalid character with "^". however, because of the presence of non-printable color attributes in the prompt, which was copied into the userinfo, visually, the mark "^" appears to point to a different character.

here's the result:

░▒▓█REDACTED@SYSTEM█▓▒░ Tuesday, 24th February. 23:34:03
[pts/0,11746$,1+;0&,0x] ~/: museeq&
[1] 12171

░▒▓█REDACTED@SYSTEM█▓▒░ Tuesday, 24th February. 23:34:14
[pts/0,11746$,1+;1&,0x] ~/: [newnet.net.debug] 4096 file descriptors available for museekd.
[museekd.peers.warn] No valid client bind port set (range: 0 - 0).
[museekd.config.debug] Loading configuration '/home/REDACTED/.museekd/config.xml'.
/home/REDACTED/.museekd/config.xml:137: parser error : xmlParseEntityRef: no name
[pts/0,11746$,1+;0&,0x] ~/: museekcontrol --info REDACTED
^
[museekd.config.warn] Could not parse configuration file '/home/REDACTED/.museekd/config.xml'.
[museek.config.warn] Failed to load configuration, bailing out.
[newnet.net.debug] 4096 file descriptors available for museekd.
[museekd.peers.warn] No valid client bind port set (range: 0 - 0).
[museekd.config.debug] Loading configuration '/home/REDACTED/.museekd/config.xml'.
/home/REDACTED/.museekd/config.xml:137: parser error : xmlParseEntityRef: no name
[pts/0,11746$,1+;0&,0x] ~/: museekcontrol --info REDACTED

i assume that musetup-gtk (and possibily musetup, but i did not try that one) uses the same xml parsing function, as it also printed an error - and truncated part of the userinfo (at least visually), so to avoid damages I closed it without changes and used vi on the configuration file.

musetup-gtk however prints out the column number instead of the above flagging method, so it reports the correct offset of the offending character.

version 0.3.0 running under kubuntu. uname:

Linux SYSTEM 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

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

1 participant