zsh-users
 help / color / mirror / code / Atom feed
From: Dominik Vogt <dominik.vogt@gmx.de>
To: Zsh Users <zsh-users@zsh.org>
Subject: DISPLAY problem with zsh + fvwm + firejail
Date: Wed, 1 Jan 2020 21:58:33 +0100	[thread overview]
Message-ID: <20200101205833.puf6pb3cylcd47qt@gmx.de> (raw)

Running commands in firejail (an enhanced sandbox similar to
chroot), there is a problem with a certain way of starting
programs.

Working setup:
--------------

 # Running zsh inside an Rxvt managed by fvwm.
 $ firejail --debug set

Shows (with some added debug output), that zsh was used to run
"set", and that the display variable ist set:

  # args passed to execvp by firejail
  DISPLAY=':0'
  arg0: '/usr/bin/zsh'
  arg1: '-c'
  arg2: ''set' '
  # output of set shell builtin
  DISPLAY=':0'

Failing setup:
--------------

Run the command by the window manager.  Make a menu entry or open
FvwmConsole and type

  exec firejail --debug set

(exec is fvwm's command to run an external command).  Now, the
DISPLAY is set to an empty string:

  # args passed to execvp by firejail
  DISPLAY=':0'
  arg0: '/usr/bin/zsh'
  arg1: '-c'
  arg2: ''set' '
  # output of set shell builtin
  DISPLAY=''     <-------- empty string

--

I can't firgure out what's going on.  For some reason, DISPLAY is
set to an empty string between the final execvp() call in firejail
and the place that uses the value, and the shell may or may not be
involved in this problem.  Note that the same occurs if any shell
is set explicitly:

  exec firejail --debug bash -c xterm -> fails

But it works fine if firejail is told to omit the shell:

  exec firejail --debug xterm -> works

--

One more detail about the way fvwm calls external programs:

  rxvt
  -> zsh
  -> firejail
  -> execvp zsh -c 'firejail command'
  -> zsh
  -> firejail
  -> execvp
  -> zsh -c 'command'
  -> exec?
  -> command
  GOOD

 fvwm
  -> execvp
  -> sh -c 'firejail ...'
  -> sh
  -> firejail
  -> execvp zsh -c 'command'
  -> zsh
  -> exec?
  -> command
  BAD

(Note that you can tell fvwm to use zsh nstead of sh with
"execuseshell /bin/zsh".  This doesn't change anything.)

So, what is the cause of the different bevaviour and/or how can I
debug it?

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt

             reply	other threads:[~2020-01-01 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-01 20:58 Dominik Vogt [this message]
2020-01-02  2:16 ` dana
2020-01-02  2:51   ` Dominik Vogt
2020-01-02  3:18     ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200101205833.puf6pb3cylcd47qt@gmx.de \
    --to=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).