Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Nov 2016 12:33:50 +0800
From:      iblis <iblis@hs.ntnu.edu.tw>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   r308432: Capsicumized `basename` make zsh prompt broken
Message-ID:  <5874fe09-4261-5616-9c0a-a71581c4d548@hs.ntnu.edu.tw>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5874fe09-4261-5616-9c0a-a71581c4d548>