"server" entry may not be added to /etc/hosts by screen.d/ldm script

Bug #1098349 reported by Phil Sharfstein on 2013-01-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LTSP5
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)

Wim Muskee (wimmuskee) wrote :

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.

Changed in ltsp:
status: New → Fix Committed
Alkis Georgopoulos (alkisg) wrote :

Fix released in LTSP 5.4.5.

Changed in ltsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers