From owner-freebsd-current@freebsd.org Mon Nov 28 04:39:29 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA18AC59F56 for ; Mon, 28 Nov 2016 04:39:29 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: from mail.hs.ntnu.edu.tw (mail.hs.ntnu.edu.tw [140.131.149.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8A01383 for ; Mon, 28 Nov 2016 04:39:28 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: by mail.hs.ntnu.edu.tw (Postfix, from userid 800) id 518A11C6471; Mon, 28 Nov 2016 12:33:51 +0800 (CST) Received: from [140.113.215.9] (IP-215-9.cs.nctu.edu.tw [140.113.215.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: iblis@hs.ntnu.edu.tw) by mail.hs.ntnu.edu.tw (Postfix) with ESMTPSA id 35B171C644A for ; Mon, 28 Nov 2016 12:33:51 +0800 (CST) From: iblis Subject: r308432: Capsicumized `basename` make zsh prompt broken To: FreeBSD Current Message-ID: <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw> Date: Mon, 28 Nov 2016 12:33:50 +0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.497480, version=1.2.4 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 04:39:29 -0000 Hi, Here is a minimal config of zsh prompt invoking `basename`: ``` └─[iblis@abeing]% cat /home/ib-test/.zshenv function set_prompt { prompt="$(basename $HOME) >" } function zle-line-init zle-keymap-select { set_prompt zle reset-prompt } zle -N zle-line-init zle -N zle-keymap-select set_prompt ``` and launching zsh will get something like this: ``` └─[iblis@abeing]% sudo su ib-test ib-test >basename: capsicum: Bad file descriptor > >basename: capsicum: Bad file descriptor > ``` To be honest, I have no idea about what casper/caspicum is. I just changed the `basename.c` and zsh work again. Index: basename.c =================================================================== --- basename.c (revision 309213) +++ basename.c (working copy) @@ -65,7 +65,7 @@ setlocale(LC_ALL, ""); - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (cap_enter() < 0 && errno != ENOSYS) err(1, "capsicum"); aflag = 0; Any idea? -- Iblis Lin