Revision: 49
Author: kormat
Date: Mon Dec 14 11:47:39 2009
Log: Revert inadvertant changes in r48
Reviewed-By: imsnah
http://code.google.com/p/neatx/source/detail?r=49
Modified:
/trunk/neatx/INSTALL
/trunk/neatx/extras/rpm/neatx.spec
/trunk/neatx/lib/app/nxserver_login.py
/trunk/neatx/lib/config.py
/trunk/neatx/lib/node.py
/trunk/neatx/lib/session.py
/trunk/neatx/lib/utils.py
=======================================
--- /trunk/neatx/INSTALL Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/INSTALL Mon Dec 14 11:47:39 2009
@@ -58,9 +58,9 @@
$ 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.
=======================================
--- /trunk/neatx/extras/rpm/neatx.spec Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/extras/rpm/neatx.spec Mon Dec 14 11:47:39 2009
@@ -33,6 +33,7 @@
Requires: nx
Requires: xauth
Requires: xrdb
+Requires: xorg-x11-fonts-misc
Requires(pre): shadow-utils
Requires(post): %__install
=======================================
--- /trunk/neatx/lib/app/nxserver_login.py Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/lib/app/nxserver_login.py Mon Dec 14 11:47:39 2009
@@ -148,7 +148,10 @@
# 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 @@
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):
=======================================
--- /trunk/neatx/lib/config.py Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/lib/config.py Mon Dec 14 11:47:39 2009
@@ -92,7 +92,7 @@
"""
if _hostname is None:
- _hostname = utils.GetHostname()
+ _hostname = socket.gethostname()
cfg = _ReadConfig(filename)
=======================================
--- /trunk/neatx/lib/node.py Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/lib/node.py Mon Dec 14 11:47:39 2009
@@ -61,6 +61,10 @@
PROTO_SEPARATOR = "\0"
+def GetHostname():
+ return socket.getfqdn()
+
+
def _GetUserShell(username):
return pwd.getpwnam(username).pw_shell
@@ -112,7 +116,7 @@
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,
=======================================
--- /trunk/neatx/lib/session.py Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/lib/session.py Mon Dec 14 11:47:39 2009
@@ -49,7 +49,7 @@
"""
if _data is None:
- _data = random.getrandbits(1024)
+ _data = random.SystemRandom().getrandbits(1024)
return md5.md5(str(_data)).hexdigest().upper()
=======================================
--- /trunk/neatx/lib/utils.py Fri Dec 11 11:26:09 2009
+++ /trunk/neatx/lib/utils.py Mon Dec 14 11:47:39 2009
@@ -32,7 +32,6 @@
import resource
import re
import signal
-import socket
import sys
import syslog
import tempfile
@@ -878,10 +877,3 @@
"""
return pwd.getpwuid(os.getuid())[0]
-
-def GetHostname():
- """Returns hostname, minus illegal characters.
-
- """
- host = socket.getfqdn()
- return host.replace(",", "")