Bug 492402 - nxserver doesn't detect stale X11 displays (port in use without lock file)
Summary: nxserver doesn't detect stale X11 displays (port in use without lock file)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: freenx-server
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Axel Thimm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-26 18:12 UTC by Nils Philippsen
Modified: 2009-08-10 21:52 UTC (History)
3 users (show)

Fixed In Version: 0.7.3-15.fc10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-10 21:40:20 UTC
Type: ---


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

Description Nils Philippsen 2009-03-26 18:12:28 UTC
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 17:27:04 UTC
Thanks for the patch!

Comment 2 Fedora Update System 2009-07-25 23:11:00 UTC
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 23:11:45 UTC
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 21:30:00 UTC
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 21:30:56 UTC
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 23:53:52 UTC
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 23:57:47 UTC
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 21:39:36 UTC
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 21:52:00 UTC
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.