Hi !
I just found an error in the getltspcfg utility.
If there is a value that contains a "#" character the
rest of the line will be truncated even if the value is
enclosed by " .
I had a look into the source and found the reason for this.
The trim routine will remove the " characters from a
string and also the trailing end of a line if a #
character is found not enclosed by ".
This should work fine, however the function is called
twice. Once when the record is processed for the
complete line and a second time on the value part of
the line.
So if the value part contains a '#' enclosed by '"' the
firs call will remove the '"' characters and the second
one will then kill the trailing rest of the value after
the '#', since it is no longer enclosed by '"'.
Example :
The record looks like :
key = "value_p1#value_p2"
the first call will make the record look like
key = value_p1#value_p2
And after the split of key and value the second call on
the value will remove '#value_p2' thus returning
value_p1 as the value.
I used the utility for one of my projects so I do not
know wether this bug is of any relevance for the ltsp
project.
I solved the bug by simply duplicating the trim()
function to trim_s removing the part that removes the
'"' from trim_s and calling trim_s from the
process_record function instead of trim.
Attached you will find the modified getltscfg.c
Anyway : Thanks for this great project.
Bye
Achim
Modified getltscfg.c