View | Details | Raw Unified | Return to bug 5099
Collapse All | Expand All

(-)tlmisc/xstartup/Makefile (-2 / +2 lines)
Lines 18-25 Link Here
18
	mkdir -p $(PREFIX)/share/xstartup
18
	mkdir -p $(PREFIX)/share/xstartup
19
# Programs
19
# Programs
20
	install xstartup.default $(PREFIX)/etc/
20
	install xstartup.default $(PREFIX)/etc/
21
	install tl-run-xstartup.d $(PREFIX)/libexec/
21
	install -m 644 tl-run-xstartup.d $(PREFIX)/libexec/
22
	install tl-run-xlogout.d $(PREFIX)/libexec/
22
	install -m 644 tl-run-xlogout.d $(PREFIX)/libexec/
23
	$(OINSTALL) tl-xstartup-desc $(PREFIX)/libexec/
23
	$(OINSTALL) tl-xstartup-desc $(PREFIX)/libexec/
24
	$(OINSTALL) tl-run-xstartup-feedback $(PREFIX)/libexec/
24
	$(OINSTALL) tl-run-xstartup-feedback $(PREFIX)/libexec/
25
# Glade files
25
# Glade files
(-)tlmisc/xstartup/xstartup.default (+7 lines)
Lines 1-5 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# -*- mode: shell-script; coding: utf-8 -*-
3
#
4
# Copyright 2002-2016 Cendio AB.
5
# For more information, see http://www.cendio.com
2
6
7
# Ignore SIGHUP, in case Xserver/xinit terminates
8
trap "" SIGHUP
9
3
# Run all scripts in xstartup.d
10
# Run all scripts in xstartup.d
4
source "${TLPREFIX}/libexec/tl-run-xstartup.d"
11
source "${TLPREFIX}/libexec/tl-run-xstartup.d"
5
12
(-)autotests/tests/agentbase.py (-7 / +6 lines)
Lines 333-339 Link Here
333
        pass
333
        pass
334
334
335
class XStartupBase(LocalServerBase, base.ScriptRunMixin):
335
class XStartupBase(LocalServerBase, base.ScriptRunMixin):
336
    def setUp(self, filename, executable):
336
    def setUp(self, filename):
337
        LocalServerBase.setUp(self)
337
        LocalServerBase.setUp(self)
338
        try:
338
        try:
339
            base.ScriptRunMixin.setUp(self)
339
            base.ScriptRunMixin.setUp(self)
Lines 387-398 Link Here
387
            if ret:
387
            if ret:
388
                raise Exception("Unable to write to %s." % filename)
388
                raise Exception("Unable to write to %s." % filename)
389
389
390
            if executable:
390
            dir = self.machine.create('disttest.fileio.Directory')
391
                dir = self.machine.create('disttest.fileio.Directory')
391
            ret = dir.chmod(filename, 0555)
392
                ret = dir.chmod(filename, 0555)
392
            del dir
393
                del dir
393
            if ret:
394
                if ret:
394
                raise Exception("Unable to make file executable")
395
                    raise Exception("Unable to make file executable")
396
395
397
        except:
396
        except:
398
            try:
397
            try:
(-)autotests/tests/agent.py (-3 / +3 lines)
Lines 339-345 Link Here
339
339
340
class UserXStartup(agentbase.XStartupBase):
340
class UserXStartup(agentbase.XStartupBase):
341
    def setUp(self):
341
    def setUp(self):
342
        agentbase.XStartupBase.setUp(self, '~/.thinlinc/xstartup', False)
342
        agentbase.XStartupBase.setUp(self, '~/.thinlinc/xstartup')
343
343
344
    def runTest(self):
344
    def runTest(self):
345
        """Test that the user's xstartup file is executed."""
345
        """Test that the user's xstartup file is executed."""
Lines 356-362 Link Here
356
356
357
class GlobalXStartup(agentbase.XStartupBase):
357
class GlobalXStartup(agentbase.XStartupBase):
358
    def setUp(self):
358
    def setUp(self):
359
        agentbase.XStartupBase.setUp(self, thintest.THINLINC_PATH + '/etc/xsession', True)
359
        agentbase.XStartupBase.setUp(self, thintest.THINLINC_PATH + '/etc/xsession')
360
360
361
    def runTest(self):
361
    def runTest(self):
362
        """Test that the global xsession script is executed."""
362
        """Test that the global xsession script is executed."""
Lines 373-379 Link Here
373
373
374
class DefaultXStartup(agentbase.XStartupBase):
374
class DefaultXStartup(agentbase.XStartupBase):
375
    def setUp(self):
375
    def setUp(self):
376
        agentbase.XStartupBase.setUp(self, thintest.THINLINC_PATH + '/etc/xstartup.default', False)
376
        agentbase.XStartupBase.setUp(self, thintest.THINLINC_PATH + '/etc/xstartup.default')
377
377
378
    def runTest(self):
378
    def runTest(self):
379
        """Test that the default xstartup script is executed."""
379
        """Test that the default xstartup script is executed."""
(-)autotests/installedtree/test_installedfiles.py (-2 / +6 lines)
Lines 121-127 Link Here
121
                     "/opt/thinlinc/libexec/tl-mount-personal"]:
121
                     "/opt/thinlinc/libexec/tl-mount-personal"]:
122
                mode = 04755
122
                mode = 04755
123
            if f in ["/opt/thinlinc/libexec/functions",
123
            if f in ["/opt/thinlinc/libexec/functions",
124
                     "/opt/thinlinc/libexec/syscheck.sh"]:
124
                     "/opt/thinlinc/libexec/syscheck.sh",
125
                     "/opt/thinlinc/libexec/tl-run-xstartup.d",
126
                     "/opt/thinlinc/libexec/tl-run-xlogout.d"]:
125
                mode = 0644
127
                mode = 0644
126
            self.assertEqual(stat.S_IMODE(buf), mode, "%s does not have mode %o" % (f, mode))
128
            self.assertEqual(stat.S_IMODE(buf), mode, "%s does not have mode %o" % (f, mode))
127
129
Lines 549-561 Link Here
549
551
550
    def test_configfiles(self):
552
    def test_configfiles(self):
551
        """Configuration files should not be executable"""
553
        """Configuration files should not be executable"""
554
        exceptions = ["/opt/thinlinc/etc/xsession",
555
                      "/opt/thinlinc/etc/xstartup.default"]
552
        files = glob.glob("/opt/thinlinc/etc/*") + glob.glob("/opt/thinlinc/etc/conf.d/*")
556
        files = glob.glob("/opt/thinlinc/etc/*") + glob.glob("/opt/thinlinc/etc/conf.d/*")
553
        for f in files:
557
        for f in files:
554
            if os.path.isdir(f):
558
            if os.path.isdir(f):
555
                continue
559
                continue
556
            buf = os.stat(f)[stat.ST_MODE]
560
            buf = os.stat(f)[stat.ST_MODE]
557
            self.assert_(stat.S_ISREG(buf), "%s is not regular" % f)
561
            self.assert_(stat.S_ISREG(buf), "%s is not regular" % f)
558
            if f.startswith("/opt/thinlinc/etc/xstartup.d"):
562
            if f in exceptions:
559
                continue
563
                continue
560
            elif f in self.secret_600:
564
            elif f in self.secret_600:
561
                continue
565
                continue
(-)doc/external/commands.xml (-3 / +3 lines)
Lines 555-563 Link Here
555
        </term>
555
        </term>
556
556
557
        <listitem><para>
557
        <listitem><para>
558
          This command is run by the session startup file
558
          This command is run by the default session startup file
559
          (<filename>~/.thinlinc/xstartup</filename>) in its default form to
559
          (<filename>/opt/thinlinc/etc/xstartup.default</filename>) to execute
560
          execute all start scripts in the directory
560
          all start scripts in the directory
561
          <filename>/opt/thinlinc/etc/xstartup.d/</filename>. Files with the
561
          <filename>/opt/thinlinc/etc/xstartup.d/</filename>. Files with the
562
          suffix <filename>.sh</filename> will be sourced. All other files will
562
          suffix <filename>.sh</filename> will be sourced. All other files will
563
          be executed.
563
          be executed.
(-)doc/external/configuration.xml (-5 / +3 lines)
Lines 427-437 Link Here
427
              <note>
427
              <note>
428
428
429
                <para>
429
                <para>
430
                  Since <filename>xstartup</filename> is run through
430
                  <filename>xstartup</filename> is executed via a login shell,
431
                  <filename>/bin/bash --login</filename>, files in
431
                  which may modify the environment and override values in
432
                  <filename>/etc/profile.d</filename> will be sourced and may
432
                  <filename>[/vsmagent/default_environment]</filename>.
433
                  override values in
434
                  <filename>[/vsmagent/default_environment]</filename>
435
                </para>
433
                </para>
436
434
437
              </note>
435
              </note>
(-)vsm/noshell (+12 lines)
Lines 44-47 Link Here
44
        ;;
44
        ;;
45
esac
45
esac
46
46
47
# xstartup is invoked from inside a session, so this must be set
48
[ -n "${TLPREFIX}" ] || end
49
50
case "$2" in
51
    ~/.thinlinc/xstartup)
52
        exec ~/.thinlinc/xstartup
53
        ;;
54
    "${TLPREFIX}/etc/xstartup.default")
55
        exec "${TLPREFIX}/etc/xstartup.default"
56
        ;;
57
esac
58
47
end
59
end
(-)vsm/modules/thinlinc/vsm/sessionstart.py (-1 / +1 lines)
Lines 179-185 Link Here
179
        vncpasswdfile = locale_encode(self.vncpasswdfile)
179
        vncpasswdfile = locale_encode(self.vncpasswdfile)
180
180
181
        tlsession = os.path.join(self.session_env['TLPREFIX'], "libexec", "tl-session")
181
        tlsession = os.path.join(self.session_env['TLPREFIX'], "libexec", "tl-session")
182
        args = [tlsession, "/bin/bash", "--login", xstartupfile,
182
        args = [tlsession, xstartupfile,
183
                "--",
183
                "--",
184
                xvnc_binary, ":%d" % disp, "-depth", "24",
184
                xvnc_binary, ":%d" % disp, "-depth", "24",
185
                "-geometry", "%dx%d" % fbsize,
185
                "-geometry", "%dx%d" % fbsize,
(-)vsm/xsession (-8 / +6 lines)
Lines 1-12 Link Here
1
#!/bin/bash
1
#!/bin/bash
2
# -*- mode: shell-script; coding: utf-8 -*-
2
# -*- mode: shell-script; coding: utf-8 -*-
3
#
3
#
4
# Copyright 2002-2014 Cendio AB.
4
# Copyright 2002-2016 Cendio AB.
5
# For more information, see http://www.cendio.com
5
# For more information, see http://www.cendio.com
6
6
7
# Ignore SIGHUP, in case Xserver/xinit terminates
8
trap "" SIGHUP
9
10
# Set language on Debian based systems
7
# Set language on Debian based systems
11
if [ -r /etc/default/locale ]; then
8
if [ -r /etc/default/locale ]; then
12
    source /etc/default/locale
9
    source /etc/default/locale
Lines 17-25 Link Here
17
# Log system/distribution information
14
# Log system/distribution information
18
source ${TLPREFIX}/libexec/log_sysinfo.sh
15
source ${TLPREFIX}/libexec/log_sysinfo.sh
19
16
20
# Source xstartup script
17
# Custom xstartup script has priority
21
if [ -f ~/.thinlinc/xstartup ] ; then
18
if [ -f ~/.thinlinc/xstartup ] ; then
22
    source ~/.thinlinc/xstartup
19
    exec -l $SHELL -c ~/.thinlinc/xstartup
23
else
24
    source "${TLPREFIX}/etc/xstartup.default"
25
fi
20
fi
21
22
# Default xstartup script
23
exec -l $SHELL -c "${TLPREFIX}/etc/xstartup.default"
(-)vsm/Makefile (-1 / +1 lines)
Lines 224-230 Link Here
224
	$(INSTALL) -m 755 init.d/vsmagent $(ROOTDIR)/etc/init.d/
224
	$(INSTALL) -m 755 init.d/vsmagent $(ROOTDIR)/etc/init.d/
225
	$(INSTALL) -m 644 logrotate.d/thinlinc-vsm-agent $(ROOTDIR)/etc/logrotate.d/
225
	$(INSTALL) -m 644 logrotate.d/thinlinc-vsm-agent $(ROOTDIR)/etc/logrotate.d/
226
	$(INSTALL) -m 644 vsmagent.hconf $(PREFIX)/etc/conf.d/
226
	$(INSTALL) -m 644 vsmagent.hconf $(PREFIX)/etc/conf.d/
227
	$(INSTALL) -m 644 xsession $(PREFIX)/etc/
227
	$(INSTALL) -m 755 xsession $(PREFIX)/etc/
228
	$(INSTALL) -s encrypt-vnc-pw $(PREFIX)/sbin/
228
	$(INSTALL) -s encrypt-vnc-pw $(PREFIX)/sbin/
229
	$(INSTALL) -s tl-session tl-xinit $(PREFIX)/libexec/
229
	$(INSTALL) -s tl-session tl-xinit $(PREFIX)/libexec/
230
	$(OINSTALL) tl-set-sso-helper $(PREFIX)/libexec/
230
	$(OINSTALL) tl-set-sso-helper $(PREFIX)/libexec/

Return to bug 5099