Bug 492402 - nxserver doesn't detect stale X11 displays (port in use without lock file)
nxserver doesn't detect stale X11 displays (port in use without lock file)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: freenx-server (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Axel Thimm
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-26 14:12 EDT by Nils Philippsen
Modified: 2009-08-10 17:52 EDT (History)
3 users (show)

See Also:
Fixed In Version: 0.7.3-15.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-08-10 17:40:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
freenx-0.7.3-stale-x11-display.patch (669 bytes, patch)
2009-03-26 14:12 EDT, Nils Philippsen
no flags Details | Diff

  None (edit)
Description Nils Philippsen 2009-03-26 14:12:28 EDT
Created attachment 336856 [details]
freenx-0.7.3-stale-x11-display.patch

Description of problem:

If there are processes having X11 displays in use, the nxserver script seems to use broken arithmetic to determine the port number, e.g. instead of port 6010 for display :10 it checks port 8010 (which isn't in use). Later on, allocating the X11 display a second time won't work and logging in fails.

Version-Release number of selected component (if applicable):
freenx-server-0.7.3-11.fc10.i386

The problematic part is in the nxserver script, around line 1439:

...
            # Check if there is already an agent running on that display on that host
            let AGENT_DISPLAY=$SESS_DISPLAY+6000
            if $COMMAND_NETCAT -z "$SERVER_HOST" $AGENT_DISPLAY 2>/dev/null
            then
                log 2 "Warning: Stray nxagent without .nX$SESS_DISPLAY-lock found on host:port $SERVER_HOST:$AGENT_DISPLAY."
                let SESS_DISPLAY=$SESS_DISPLAY+1
                continue
            fi
...

As $SESS_DISPLAY is $DISPLAY_BASE plus the offset (e.g. 10 for display :10), it needs to be substracted again to calculate the X11 display TCP port ($AGENT_DISPLAY).

It could be that I interpret these lines wrongly (i.e. they aren't about the X11 display TCP port), then a check for that port would need to be added to the script. The following patch assumes that I'm right of course ;-).
Comment 1 Axel Thimm 2009-07-25 13:27:04 EDT
Thanks for the patch!
Comment 2 Fedora Update System 2009-07-25 19:11:00 EDT
freenx-server-0.7.3-14.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/freenx-server-0.7.3-14.fc10
Comment 3 Fedora Update System 2009-07-25 19:11:45 EDT
freenx-server-0.7.3-14.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/freenx-server-0.7.3-14.fc11
Comment 4 Fedora Update System 2009-07-27 17:30:00 EDT
freenx-server-0.7.3-14.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update freenx-server'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-8023
Comment 5 Fedora Update System 2009-07-27 17:30:56 EDT
freenx-server-0.7.3-14.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update freenx-server'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8022
Comment 6 Fedora Update System 2009-08-01 19:53:52 EDT
freenx-server-0.7.3-15.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update freenx-server'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8022
Comment 7 Fedora Update System 2009-08-01 19:57:47 EDT
freenx-server-0.7.3-15.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update freenx-server'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-8023
Comment 8 Fedora Update System 2009-08-10 17:39:36 EDT
freenx-server-0.7.3-15.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2009-08-10 17:52:00 EDT
freenx-server-0.7.3-15.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.