I screwed up when making that last commit, ended up reverting some
previous patches, and including some unwanted code changes too. This
should fix that.
commit 670ec1c350808f0c38a64422b71d10e2799cbea7
Author: Stephen Shirley <
dia...@nonado.net>
Date: Mon Dec 14 17:45:32 2009 +0100
Revert inadvertant changes in r48
diff --git a/INSTALL b/INSTALL
index 4c7d9d7..d6d7b58 100644
--- a/INSTALL
+++ b/INSTALL
@@ -58,9 +58,9 @@ run as root). Replace names in <>'s appropriately.
$ rpmdev-setuptree
$ cd /path/to/neatx/tree
$ tar czf ~/rpmbuild/SOURCES/neatx-0.1.tar.gz *
-$ rpmbuild -bs contrib/rpm/neatx.spec --nodeps
+$ rpmbuild -bs extras/rpm/neatx.spec --nodeps
# yum-builddep ~<user>/rpmbuild/SRPMS/neatx-*.src.rpm
-$ rpmbuild -bb contrib/rpm/neatx.spec
+$ rpmbuild -bb extras/rpm/neatx.spec
# yum install --nogpgcheck ~<user>/rpmbuild/RPMS/<platform>/<rpmname>
Then customise /etc/neatx.conf as below.
diff --git a/extras/rpm/neatx.spec b/extras/rpm/neatx.spec
index 4a64672..987e0a4 100644
--- a/extras/rpm/neatx.spec
+++ b/extras/rpm/neatx.spec
@@ -33,6 +33,7 @@ Requires: nc
Requires: nx
Requires: xauth
Requires: xrdb
+Requires: xorg-x11-fonts-misc
Requires(pre): shadow-utils
Requires(post): %__install
diff --git a/lib/app/nxserver_login.py b/lib/app/nxserver_login.py
index 602366a..6481434 100644
--- a/lib/app/nxserver_login.py
+++ b/lib/app/nxserver_login.py
@@ -148,7 +148,10 @@ class LoginCommandHandler(object):
# Not writing username. If user specified a username starting with "NX>",
# the client could interpret it as a response.
- server.WriteLine("")
+ if username.startswith('NX>'):
+ server.WriteLine("")
+ else:
+ server.WriteLine(username)
# Read password without echo on interactive terminals
def _RequestPassword():
@@ -157,15 +160,16 @@ class LoginCommandHandler(object):
return server.ReadLine(hide=True)
password = server.WithoutTerminalEcho(_RequestPassword)
+
+ # Not writing real password for security reasons.
+ server.WriteLine(NX_DUMMY_PASSWORD)
+
if not password:
server.Write(500, ("Password cannot be in MD5 when not using the NX "
"password DB."))
server.Write(500, "Please update your NX Client")
raise protocol.NxQuitServer()
- # Not writing real password for security reasons.
- server.WriteLine(NX_DUMMY_PASSWORD)
-
self._TryLogin(username, password)
def _Set(self, args):
diff --git a/lib/config.py b/lib/config.py
index 4161287..bbe0a0c 100644
--- a/lib/config.py
+++ b/lib/config.py
@@ -92,7 +92,7 @@ class Config(object):
"""
if _hostname is None:
- _hostname = utils.GetHostname()
+ _hostname = socket.gethostname()
cfg = _ReadConfig(filename)
diff --git a/lib/node.py b/lib/node.py
index 26582c7..536d4d6 100644
--- a/lib/node.py
+++ b/lib/node.py
@@ -61,6 +61,10 @@ CMD_GET_SHADOW_COOKIE = "getshadowcookie"
PROTO_SEPARATOR = "\0"
+def GetHostname():
+ return socket.getfqdn()
+
+
def _GetUserShell(username):
return pwd.getpwnam(username).pw_shell
@@ -112,7 +116,7 @@ class NodeSession(session.SessionBase):
def __init__(self, ctx, clientargs, _env=None):
self._ctx = ctx
- hostname = utils.GetHostname()
+ hostname = GetHostname()
display = FindUnusedDisplay()
session.SessionBase.__init__(self, ctx.sessid, hostname, display,
diff --git a/lib/session.py b/lib/session.py
index b636ecf..657dafc 100644
--- a/lib/session.py
+++ b/lib/session.py
@@ -49,7 +49,7 @@ def NewUniqueId(_data=None):
"""
if _data is None:
- _data = random.getrandbits(1024)
+ _data = random.SystemRandom().getrandbits(1024)
return md5.md5(str(_data)).hexdigest().upper()
diff --git a/lib/utils.py b/lib/utils.py
index df2c699..24f4e8d 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -32,7 +32,6 @@ import pwd
import resource
import re
import signal
-import socket
import sys
import syslog
import tempfile
@@ -878,10 +877,3 @@ def GetCurrentUserName():
"""
return pwd.getpwuid(os.getuid())[0]
-
-def GetHostname():
- """Returns hostname, minus illegal characters.
-
- """
- host = socket.getfqdn()
- return host.replace(",", "")
--
"You are technically correct, the best kind of correct."
- Bureaucrat 1.0, Futurama