[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-questions
Subject:    Re: security/doas can't work with zsh alias
From:       alphachi <alphachi () mediaspirit ! org>
Date:       2017-06-27 8:48:18
Message-ID: CAJN5+Gu0b7qv+RrAOKM=b8N7BWGQP11QOWpFctagWVUHtwyC5g () mail ! gmail ! com
[Download RAW message or body]

So I think the simplest approach is: run "doas -s" and stay this shell for
dealing alias requirements.

Any other ideas?

2017年6月27日 14:13,"Polytropon" <freebsd@edvax.de>写道:

> On Mon, 26 Jun 2017 20:25:02 +0800, alphachi wrote:
> > I'm preparing to migrate to doas and the following commands are my test:
> >
> > % cat /usr/local/etc/doas.conf
> > permit nopass keepenv fbsd as root
> > permit nopass keepenv root as root
> > % id -nu
> > fbsd
> > % doas id -nu
> > root
> > % echo $SHELL
> > /usr/local/bin/zsh
> > % doas echo $SHELL
> > /usr/local/bin/zsh
> > % alias
> > vi=vim
> > % doas alias
> > %
> >
> > As this shows, doas doesn't know this alias, so "doas vi" can't invoke
> > installed vim.
> >
> > Is this reasonable or just my mistake? How to enable zsh alias for doas?
>
> A possible explanation is that the subshell that executes the
> "alias" (internal) command provided through doas does not inherit
> the environment that stored the alias for the user shell; in
> such a case, root's environment (without the alias) will be
> used while the doas shell is running, that's why the "vi=vim"
> setting is not in that environment.
>
> However, that exactly seems to conflict with the "keepenv"
> option provided by doas.conf, except of course aliases are
> being handled independently from environmental variables
> (which the "env" in "keepenv" could refer to).
>
>
>
> --
> Polytropon
> Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...
>
_______________________________________________
freebsd-questions@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic