Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 308737
Collapse All | Expand All

(-)original/INSTALL (-3 / +3 lines)
Lines 11-17 Link Here
11
    http://sourceforge.net/projects/pexpect
11
    http://sourceforge.net/projects/pexpect
12
  - simplejson Python module
12
  - simplejson Python module
13
    http://www.undefined.org/python/#simplejson
13
    http://www.undefined.org/python/#simplejson
14
  - PyGTK+ 2.14 or higher
14
  - PyGTK+ 2.10 or higher
15
    http://www.pygtk.org/
15
    http://www.pygtk.org/
16
  - PyGObject 2.14 or higher
16
  - PyGObject 2.14 or higher
17
    http://www.pygtk.org/
17
    http://www.pygtk.org/
Lines 58-66 Link Here
58
$ rpmdev-setuptree
58
$ rpmdev-setuptree
59
$ cd /path/to/neatx/tree
59
$ cd /path/to/neatx/tree
60
$ tar czf ~/rpmbuild/SOURCES/neatx-0.1.tar.gz *
60
$ tar czf ~/rpmbuild/SOURCES/neatx-0.1.tar.gz *
61
$ rpmbuild -bs contrib/rpm/neatx.spec --nodeps
61
$ rpmbuild -bs extras/rpm/neatx.spec --nodeps
62
# yum-builddep ~<user>/rpmbuild/SRPMS/neatx-*.src.rpm
62
# yum-builddep ~<user>/rpmbuild/SRPMS/neatx-*.src.rpm
63
$ rpmbuild -bb contrib/rpm/neatx.spec
63
$ rpmbuild -bb extras/rpm/neatx.spec
64
# yum install --nogpgcheck ~<user>/rpmbuild/RPMS/<platform>/<rpmname>
64
# yum install --nogpgcheck ~<user>/rpmbuild/RPMS/<platform>/<rpmname>
65
65
66
Then customise /etc/neatx.conf as below.
66
Then customise /etc/neatx.conf as below.
(-)original/Makefile.am (-1 / +2 lines)
Lines 146-152 Link Here
146
146
147
doc/%.html: doc/%.rst
147
doc/%.html: doc/%.rst
148
	@if test -z "$(RST2HTML)"; then \
148
	@if test -z "$(RST2HTML)"; then \
149
		echo 'rst2html not found during configure, not building docs'; \
149
		echo "rst2html not found during configure, can't build docs"; \
150
		exit 1; \
150
	else \
151
	else \
151
		$(RST2HTML) $< $@; \
152
		$(RST2HTML) $< $@; \
152
	fi
153
	fi
(-)original/autotools/gen-log-wrapper (-1 / +3 lines)
Lines 20-29 Link Here
20
  logger -t "\$PROGNAME[\$\$]" -p "user.\${PRIORITY:-crit}" -- "\$@"
20
  logger -t "\$PROGNAME[\$\$]" -p "user.\${PRIORITY:-crit}" -- "\$@"
21
}
21
}
22
22
23
PRIORITY=debug log "Called with args: \$*"
24
23
# Duplicate stdout to fd 3
25
# Duplicate stdout to fd 3
24
exec 3>&1
26
exec 3>&1
25
exec $1 "\$@" 2>&1 >&3 | {
27
exec $1 "\$@" 2>&1 >&3 | {
26
  PRIORITY=debug log "Started"
28
  PRIORITY=debug log "Started $1 \$*"
27
  while read; do
29
  while read; do
28
    log "\$REPLY"
30
    log "\$REPLY"
29
  done
31
  done
(-)original/configure.ac (-1 / +2 lines)
Lines 30-36 Link Here
30
30
31
# Check for rst2html
31
# Check for rst2html
32
AC_ARG_VAR(RST2HTML, [rst2html path])
32
AC_ARG_VAR(RST2HTML, [rst2html path])
33
AC_PATH_PROG(RST2HTML, [rst2html], [])
33
AC_PATH_PROGS(RST2HTML, [rst2html rst2html.py], [])
34
34
if test -z "$RST2HTML"
35
if test -z "$RST2HTML"
35
then
36
then
36
  AC_MSG_WARN([rst2html not found, documentation rebuild will not be possible])
37
  AC_MSG_WARN([rst2html not found, documentation rebuild will not be possible])
(-)original/extras/rpm/neatx.initscript (+26 lines)
Line 0 Link Here
1
#!/bin/bash
2
#
3
# Copied from freenx-server fedora package
4
#
5
# chkconfig: 2345 91 35
6
# description: Creates /tmp/.X11-unix/ if required
7
8
start() {
9
  install -d -o root -g root -m 1777 "/tmp/.X11-unix"
10
  restorecon /tmp/.X11-unix 2>/dev/null || :
11
}
12
13
case "$1" in
14
  start)
15
        start
16
        ;;
17
  stop)
18
        :
19
        ;;
20
  restart)
21
        :
22
        ;;
23
  *)
24
        echo $"Usage: $prog {start}"
25
        exit 1
26
esac
(-)original/extras/rpm/neatx.spec (-3 / +16 lines)
Lines 23-38 Link Here
23
BuildRequires: python-devel
23
BuildRequires: python-devel
24
BuildRequires: python-docutils
24
BuildRequires: python-docutils
25
25
26
Requires: nc
27
Requires: nx
26
Requires: openssh
28
Requires: openssh
27
Requires: pexpect
29
Requires: pexpect
28
Requires: pygobject2 >= 2.14
30
Requires: pygobject2 >= 2.14
29
Requires: pygtk2 >= 2.13
31
Requires: pygtk2 >= 2.10
30
Requires: python >= 2.4
32
Requires: python >= 2.4
31
Requires: python-simplejson
33
Requires: python-simplejson
32
Requires: nc
33
Requires: nx
34
Requires: xauth
34
Requires: xauth
35
Requires: xorg-x11-fonts-misc
36
Requires: xorg-x11-xkb-utils
35
Requires: xrdb
37
Requires: xrdb
38
Requires: xterm
36
Requires(pre): shadow-utils
39
Requires(pre): shadow-utils
37
Requires(post): %__install
40
Requires(post): %__install
38
41
Lines 44-49 Link Here
44
%setup -cq
47
%setup -cq
45
48
46
%build
49
%build
50
# fixup paths
51
sed -ri 's@^(XSESSION\s+=).*@\1 "/etc/X11/xinit/Xsession"@' lib/constants.py
52
sed -ri 's@^(NETCAT\s+=).*@\1 "/usr/bin/nc"@' lib/constants.py
53
sed -ri 's@^(#xsession-path\s+=).*@\1 /etc/X11/xinit/Xsession@' doc/neatx.conf.example
54
sed -ri 's@^(#netcat-path\s+=).*@\1 /usr/bin/nc@' doc/neatx.conf.example
47
./autogen.sh
55
./autogen.sh
48
%configure
56
%configure
49
make
57
make
Lines 53-58 Link Here
53
make DESTDIR=%{buildroot} install
61
make DESTDIR=%{buildroot} install
54
# provide a meaningfull config file
62
# provide a meaningfull config file
55
%__install -D -m 644 %{buildroot}/%_docdir/%{name}/neatx.conf.example %{buildroot}/etc/neatx.conf
63
%__install -D -m 644 %{buildroot}/%_docdir/%{name}/neatx.conf.example %{buildroot}/etc/neatx.conf
64
%__install -D -m 755 extras/rpm/neatx.initscript %{buildroot}/etc/init.d/neatx
56
65
57
%clean
66
%clean
58
rm -rf %{buildroot}
67
rm -rf %{buildroot}
Lines 63-68 Link Here
63
getent passwd nx >/dev/null || \
72
getent passwd nx >/dev/null || \
64
       useradd -r -g nx -m -d %nx_homedir -s %_libdir/%{name}/nxserver-login-wrapper \
73
       useradd -r -g nx -m -d %nx_homedir -s %_libdir/%{name}/nxserver-login-wrapper \
65
      -c "System account for the %{name} package" nx
74
      -c "System account for the %{name} package" nx
75
chown -R nx: %nx_homedir
66
exit 0
76
exit 0
67
77
68
%post
78
%post
Lines 71-80 Link Here
71
    %__install -d -m 700 -o nx -g nx %nx_homedir/.ssh/
81
    %__install -d -m 700 -o nx -g nx %nx_homedir/.ssh/
72
    %__install -D -m 600 -o nx -g nx %_datadir/%{name}/authorized_keys.nomachine %nx_homedir/.ssh/authorized_keys
82
    %__install -D -m 600 -o nx -g nx %_datadir/%{name}/authorized_keys.nomachine %nx_homedir/.ssh/authorized_keys
73
fi
83
fi
84
/sbin/chkconfig --add neatx
85
/sbin/service neatx start > /dev/null 2>&1
74
86
75
%files
87
%files
76
%defattr(-,root,root)
88
%defattr(-,root,root)
77
%config(noreplace) /etc/neatx.conf
89
%config(noreplace) /etc/neatx.conf
90
/etc/init.d/neatx
78
%_libdir/%{name}
91
%_libdir/%{name}
79
%python_sitelib/%{name}/*
92
%python_sitelib/%{name}/*
80
%doc %_docdir/%{name}
93
%doc %_docdir/%{name}
(-)original/lib/agent.py (-14 / +48 lines)
Lines 69-75 Link Here
69
_GENERAL_WARNING_RE = re.compile(r"^Warning:\s+(?P<warning>.*)$")
69
_GENERAL_WARNING_RE = re.compile(r"^Warning:\s+(?P<warning>.*)$")
70
_GEOMETRY_RE = re.compile(r"^Info:\s+Screen\s+\[0\]\s+resized\s+to\s+"
70
_GEOMETRY_RE = re.compile(r"^Info:\s+Screen\s+\[0\]\s+resized\s+to\s+"
71
                          r"geometry\s+\[(?P<geometry>[^\]]+)\]"
71
                          r"geometry\s+\[(?P<geometry>[^\]]+)\]"
72
                          r"( fullscreen \[\d\])?\.$")
72
                          r"( fullscreen \[(?P<fullscreen>\d)\])?\.$")
73
73
74
74
75
class UserApplication(daemon.Program):
75
class UserApplication(daemon.Program):
Lines 384-391 Link Here
384
    m = _GEOMETRY_RE.match(line)
384
    m = _GEOMETRY_RE.match(line)
385
    if m:
385
    if m:
386
      geometry = m.group("geometry")
386
      geometry = m.group("geometry")
387
      self._ChangeGeometry(geometry)
387
      fullscreen = (m.group("fullscreen") == "1")
388
      logging.info("Matched info geometry change, new is %r", geometry)
388
      self._ChangeGeometry(geometry, fullscreen)
389
      logging.info("Matched info geometry change, new is %r, fullscreen %r",
390
                   geometry, fullscreen)
389
      return
391
      return
390
392
391
  def _CheckStatus(self, line, _status_map=None):
393
  def _CheckStatus(self, line, _status_map=None):
Lines 426-436 Link Here
426
    if new == old:
428
    if new == old:
427
      pass
429
      pass
428
430
429
    elif (old == constants.SESS_STATE_CREATED and
430
          new == constants.SESS_STATE_STARTING):
431
      self.__EmitDisplayReady()
432
433
    elif new == constants.SESS_STATE_WAITING:
431
    elif new == constants.SESS_STATE_WAITING:
432
      if old == constants.SESS_STATE_STARTING:
433
        self.__EmitDisplayReady()
434
434
      port = m.group("port")
435
      port = m.group("port")
435
436
436
      try:
437
      try:
Lines 468-482 Link Here
468
    # Send SIGHUP to reopen port
469
    # Send SIGHUP to reopen port
469
    self._SendSighup()
470
    self._SendSighup()
470
471
471
  def _ChangeGeometry(self, geometry):
472
  def _ChangeGeometry(self, geometry, fullscreen):
472
    """Called when geometry changed.
473
    """Called when geometry changed.
473
474
474
    @type geometry: str
475
    @type geometry: str
475
    @param geometry: Geometry information
476
    @param geometry: Geometry information
477
    @type fullscreen: boolean
478
    @param fullscreen: Fullscreen state
476
479
477
    """
480
    """
478
    sess = self._ctx.session
481
    sess = self._ctx.session
479
    sess.geometry = geometry
482
    sess.geometry = geometry
483
    sess.fullscreen = fullscreen
480
    sess.Save()
484
    sess.Save()
481
485
482
  def _FormatNxAgentOptions(self, opts):
486
  def _FormatNxAgentOptions(self, opts):
Lines 491-497 Link Here
491
    formatted = ",".join(["%s=%s" % (name, value)
495
    formatted = ",".join(["%s=%s" % (name, value)
492
                          for name, value in opts.iteritems()])
496
                          for name, value in opts.iteritems()])
493
497
494
    return "nx/nx,%s:%s\n" % (formatted, sess.display)
498
    return "nx/nx,%s:%d\n" % (formatted, sess.display)
495
499
496
  def _GetDisplayWithOptions(self):
500
  def _GetDisplayWithOptions(self):
497
    """Returns the value for the DISPLAY variable for nxagent.
501
    """Returns the value for the DISPLAY variable for nxagent.
Lines 499-505 Link Here
499
    """
503
    """
500
    sess = self._ctx.session
504
    sess = self._ctx.session
501
505
502
    return "nx/nx,options=%s:%s" % (sess.optionsfile, sess.display)
506
    self.__CheckStrChars(sess.optionsfile, "Session options file")
507
508
    return "nx/nx,options=%s:%d" % (sess.optionsfile, sess.display)
503
509
504
  def _GetOptions(self):
510
  def _GetOptions(self):
505
    """Returns session options for nxagent.
511
    """Returns session options for nxagent.
Lines 552-561 Link Here
552
      opts["shadowuid"] = self._ctx.uid
558
      opts["shadowuid"] = self._ctx.uid
553
      opts["shadow"] = ":%s" % sess.shadow_display
559
      opts["shadow"] = ":%s" % sess.shadow_display
554
560
555
    if not sess.rootless:
561
    if sess.rootless:
556
      opts["geometry"] = sess.geometry
557
    else:
558
      opts["menu"] = "1"
562
      opts["menu"] = "1"
563
    else:
564
      opts["geometry"] = sess.geometry
559
      opts["fullscreen"] = protocol.FormatNxBoolean(sess.fullscreen)
565
      opts["fullscreen"] = protocol.FormatNxBoolean(sess.fullscreen)
560
566
561
    if sess.rootless and sess.type == constants.SESS_TYPE_CONSOLE:
567
    if sess.rootless and sess.type == constants.SESS_TYPE_CONSOLE:
Lines 592-598 Link Here
592
      # nxagent port).
598
      # nxagent port).
593
      "-nolisten", "tcp",
599
      "-nolisten", "tcp",
594
600
595
      ":%s" % sess.display,
601
      ":%d" % sess.display,
596
      ]
602
      ]
597
603
598
    if sess.type == constants.SESS_TYPE_SHADOW:
604
    if sess.type == constants.SESS_TYPE_SHADOW:
Lines 615-620 Link Here
615
    """
621
    """
616
    sess = self._ctx.session
622
    sess = self._ctx.session
617
    filename = sess.optionsfile
623
    filename = sess.optionsfile
624
    self.__CheckOptsChars(opts)
618
    formatted = self._FormatNxAgentOptions(opts)
625
    formatted = self._FormatNxAgentOptions(opts)
619
626
620
    logging.debug("Writing session options %r to %s", formatted, filename)
627
    logging.debug("Writing session options %r to %s", formatted, filename)
Lines 622-624 Link Here
622
629
623
  def __EmitDisplayReady(self):
630
  def __EmitDisplayReady(self):
624
    self.emit(self.DISPLAY_READY_SIGNAL)
631
    self.emit(self.DISPLAY_READY_SIGNAL)
632
633
  def __CheckOptsChars(self, opts):
634
    """Checks to make sure option name/values don't contain illegal characters.
635
636
    @type opts: dict
637
    @param opts: Options
638
639
    """
640
641
    for name, value in opts.iteritems():
642
      self.__CheckStrChars(name, "Name of option %r" % name)
643
      self.__CheckStrChars(value, "Value of option %r (%r)" % (name, value))
644
645
  def __CheckStrChars(self, s, description):
646
    """Checks to make sure string don't contain illegal characters.
647
648
    @type s: string
649
    @param s: text to test
650
    @type description: string
651
    @param description: description of text
652
653
    """
654
    illegal_chars = [","]
655
    for c in illegal_chars:
656
      if c in s:
657
        raise errors.IllegalCharacterError("%s contains illegal character %r" %
658
                                           (description, c))
(-)original/lib/app/nxdialog.py (-7 / +10 lines)
Lines 163-177 Link Here
163
163
164
  """
164
  """
165
  if action == DISCONNECT:
165
  if action == DISCONNECT:
166
    ppid = os.getppid()
166
    logging.info("Disconnecting from session, sending SIGHUP to %s", agentpid)
167
    logging.info("Disconnecting from session, sending SIGHUP to %s", ppid)
167
    os.kill(agentpid, signal.SIGHUP)
168
    os.kill(ppid, signal.SIGHUP)
169
168
170
  elif action == TERMINATE:
169
  elif action == TERMINATE:
171
    if agentpid:
170
    logging.info("Terminating session, sending SIGTERM to process %s",
172
      logging.info("Terminating session, sending SIGTERM to process %s",
171
                 agentpid)
173
                   agentpid)
172
    os.kill(agentpid, signal.SIGTERM)
174
      os.kill(agentpid, signal.SIGTERM)
175
173
176
  elif action is None:
174
  elif action is None:
177
    logging.debug("Dialog canceled, nothing to do")
175
    logging.debug("Dialog canceled, nothing to do")
Lines 223-228 Link Here
223
      logging.error("Dialog type '%s' not supported", dlgtype)
221
      logging.error("Dialog type '%s' not supported", dlgtype)
224
      sys.exit(constants.EXIT_FAILURE)
222
      sys.exit(constants.EXIT_FAILURE)
225
223
224
    if dlgtype in (constants.DLG_TYPE_PULLDOWN,
225
        constants.DLG_TYPE_YESNOSUSPEND) and not self.options.agentpid:
226
      logging.error("Agent pid not supplied via --parent")
227
      sys.exit(constants.EXIT_FAILURE)
228
226
    if self.options.caption:
229
    if self.options.caption:
227
      message_caption = self.options.caption
230
      message_caption = self.options.caption
228
    else:
231
    else:
(-)original/lib/app/nxserver_login.py (-4 / +8 lines)
Lines 148-154 Link Here
148
148
149
    # Not writing username. If user specified a username starting with "NX>",
149
    # Not writing username. If user specified a username starting with "NX>",
150
    # the client could interpret it as a response.
150
    # the client could interpret it as a response.
151
    server.WriteLine("")
151
    if username.startswith('NX>'):
152
     server.WriteLine("")
153
    else:
154
     server.WriteLine(username)
152
155
153
    # Read password without echo on interactive terminals
156
    # Read password without echo on interactive terminals
154
    def _RequestPassword():
157
    def _RequestPassword():
Lines 157-171 Link Here
157
      return server.ReadLine(hide=True)
160
      return server.ReadLine(hide=True)
158
161
159
    password = server.WithoutTerminalEcho(_RequestPassword)
162
    password = server.WithoutTerminalEcho(_RequestPassword)
163
164
    # Not writing real password for security reasons.
165
    server.WriteLine(NX_DUMMY_PASSWORD)
166
160
    if not password:
167
    if not password:
161
      server.Write(500, ("Password cannot be in MD5 when not using the NX "
168
      server.Write(500, ("Password cannot be in MD5 when not using the NX "
162
                         "password DB."))
169
                         "password DB."))
163
      server.Write(500, "Please update your NX Client")
170
      server.Write(500, "Please update your NX Client")
164
      raise protocol.NxQuitServer()
171
      raise protocol.NxQuitServer()
165
172
166
    # Not writing real password for security reasons.
167
    server.WriteLine(NX_DUMMY_PASSWORD)
168
169
    self._TryLogin(username, password)
173
    self._TryLogin(username, password)
170
174
171
  def _Set(self, args):
175
  def _Set(self, args):
(-)original/lib/errors.py (+5 lines)
Lines 81-86 Link Here
81
81
82
  """
82
  """
83
83
84
class IllegalCharacterError(GenericError):
85
  """String contains illegal character (e.g. a comma in session options).
86
87
  """
88
84
89
85
# Exception classes should be added above
90
# Exception classes should be added above
86
91
(-)original/lib/session.py (-1 / +1 lines)
Lines 49-55 Link Here
49
49
50
  """
50
  """
51
  if _data is None:
51
  if _data is None:
52
    _data = random.getrandbits(1024)
52
    _data = random.SystemRandom().getrandbits(1024)
53
  return md5.md5(str(_data)).hexdigest().upper()
53
  return md5.md5(str(_data)).hexdigest().upper()
54
54
55
55

Return to bug 308737