Revision: 2606
          http://tmux.svn.sourceforge.net/tmux/?rev=2606&view=rev
Author:   tcunha
Date:     2011-10-02 11:32:24 +0000 (Sun, 02 Oct 2011)
Log Message:
-----------
Sync OpenBSD patchset 960:

Reject $SHELL if it is not a full path.

Modified Paths:
--------------
    trunk/tmux.c
    trunk/window.c

Modified: trunk/tmux.c
===================================================================
--- trunk/tmux.c        2011-10-02 11:31:34 UTC (rev 2605)
+++ trunk/tmux.c        2011-10-02 11:32:24 UTC (rev 2606)
@@ -101,8 +101,10 @@
 int
 checkshell(const char *shell)
 {
-       if (shell == NULL || *shell == '\0' || areshell(shell))
+       if (shell == NULL || *shell == '\0' || *shell != '/')
                return (0);
+       if (areshell(shell))
+               return (0);
        if (access(shell, X_OK) != 0)
                return (0);
        return (1);

Modified: trunk/window.c
===================================================================
--- trunk/window.c      2011-10-02 11:31:34 UTC (rev 2605)
+++ trunk/window.c      2011-10-02 11:32:24 UTC (rev 2606)
@@ -694,7 +694,7 @@
                if (*wp->cmd != '\0') {
                        /* Set SHELL but only if it is currently not useful. */
                        shell = getenv("SHELL");
-                       if (shell == NULL || *shell == '\0' || areshell(shell))
+                       if (checkshell(shell))
                                setenv("SHELL", wp->shell, 1);
 
                        execl(_PATH_BSHELL, "sh", "-c", wp->cmd, (char *) NULL);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to