zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: dana <dana@dana.is>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Issue with set built-in in 5.8 (?)
Date: Mon, 17 Feb 2020 09:02:36 +0000	[thread overview]
Message-ID: <20200217090236.17a82c53@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <6908034E-BC9E-41B3-8457-111F275AF3A7@dana.is>

dana wrote on Sun, 16 Feb 2020 20:19 -0600:
> Most of these errors are useful, but i'm not sure they should unconditionally
> abort the shell.
> @Daniel, we talked about the first one before, but this particular concern
> didn't come up at the time — what do you reckon?

Considerations:

- Compatibility with what zshoptions(1) has promised would work, though
  that didn't work before 5.8.

- Consistency with POSIX.  (POSIX doesn't specify -p, but still.)

- Consistency with other shells.

- Consistency between «set» and «setopt».

- On the one hand, "Errors should never pass silently".  On the other
  hand, in the shell language there are few other cases of aborting the
  shell just because a syscall returned an error.

- Regardless of what we choose, the other behaviour is achievable: if
  we make the error fatal people can use «eval» to make it non-fatal,
  and if we make the error non-fatal people can use «… || exit 1» to
  make it fatal.

I'm not sure what these add up to, but these are the addends I have
in mind.

Cheers,

Daniel


> % sudo perl -e '$< = 1; $> = 2; exec("zsh", "-fc", "id; unsetopt privileged; echo still here");'
> uid=1(daemon) gid=1(daemon) euid=2 egid=0(wheel) groups=...
> zsh:unsetopt:1: PRIVILEGED: supplementary group list not changed due to lack of permissions: EUID=2
> zsh:unsetopt:1: can't change option: privileged
> still here
> 
> % sudo perl -e '$< = 1; $> = 2; exec("zsh", "-fc", "id; set +p; echo still here");'
> uid=1(daemon) gid=1(daemon) euid=2 egid=0(wheel) groups=...
> zsh:unsetopt:1: PRIVILEGED: supplementary group list not changed due to lack of permissions: EUID=2
> zsh:set:1: can't change option: -p
> 


  reply	other threads:[~2020-02-17  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17  2:19 dana
2020-02-17  9:02 ` Daniel Shahaf [this message]
2020-02-18 20:01   ` dana
2020-02-19  9:37     ` Peter Stephenson
2020-02-19 19:25       ` dana
2020-02-20  9:30         ` Peter Stephenson

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=20200217090236.17a82c53@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=dana@dana.is \
    --cc=zsh-workers@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).