"server" entry may not be added to /etc/hosts by screen.d/ldm script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LTSP5 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In screen.d/ldm if the ltsp client address begins with the ltsp server address, the grep check on line 92 of screen.d/ldm will return 0 and the "server" entry will not be added to /etc/hosts.
For example:
server IP = 10.1.0.1
Client IP = 10.1.0.123
Since 10.1.0.123 is already in /etc/hosts the grep command will find a match.
92 if ! grep -q "$SRV" /etc/hosts ; then
93 echo "$SRV server-$SRV" >> /etc/hosts
94 fi
To fix this, change the grep command to:
92 if ! fgrep -qw "$SRV" /etc/hosts ; then
* fgrep ensures that no accidental pattern matching occurs on the '.' characters in the IP address
* -w only matches whole words (begins with whitespace or at the start of a line, ends with whitespace or at end of line)
Committed your fix: http:// bazaar. launchpad. net/~ltsp- upstream/ ltsp/ldm- trunk/revision/ 1459. Since fgrep is deprecated used the -F option.
Thanks for the report.