All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: util-linux@vger.kernel.org, "Ángel González" <ingenit@zoho.com>,
	"Karel Zak" <kzak@redhat.com>
Subject: Re: [PATCH] Add setpriv, a tool to set privileges and such
Date: Sun, 09 Dec 2012 22:24:51 +0000	[thread overview]
Message-ID: <50C50FB3.7080903@draigBrady.com> (raw)
In-Reply-To: <5a4bb50baed87dbe00be9003dad7cc1ba59ca571.1354954632.git.luto@amacapital.net>

On 12/08/2012 08:19 AM, Andy Lutomirski wrote:
> This can set no_new_privs, uid, gid, groups, securebits, inheritable caps, the cap
> bounding set, securebits, and selinux and apparmor labels.

Thanks a lot for doing this.

> +.BR \--securebits=(+|-)securebit,...
> +Sets or clears securebits.  The valid securebits are \fInoroot\fP, \fInoroot_locked\fP,
> +\fIno_setuid_fixup\fP, \fIno_setuid_fixup_locked\fP, and \fIkeep_caps_locked\fP.
> +\fIkeep_caps\fP is cleared by
> +.BR execve (2)
> +and is therefore not allowed.

It might be good to at least mention this is in relation to
capabilities and add a cross reference to cap_ng(3)

> +
> +.TP
> +.BR \--selinux-label
> +Requests a particular SELinux transition (using a transition on exec, not dyntrans).
> +This will fail and cause
> +.BR setpriv (1)
> +to abort if SELinux is not in use, and the transition may be ignored or cause
> +.BR execve (2)
> +to fail at SELinux's whim.  (In particular, this is unlikely to work in conjunction
> +with \fIno_new_privs\fP.)

In general it could be good to reference specific tools
that can do the same thing. runcon(1) in this case.

> +.TP
> +.BR \-h , " \-\-help"
> +Print a help message,
> +.SH NOTES
> +If applying any specified option fails, \fIprogram\fP will not be run and
> +\fIsetpriv\fP will return with exit code 127.

It seems worth standardising on error.
Most commands that exec on behalf of another use something like
the following, which I snarfed from timeout(1):

      EXIT_CANCELED      125      internal error
      EXIT_CANNOT_INVOKE 126      error executing job
      EXIT_ENOENT        127      couldn't find job to exec

So I suppose you could use 125 if there was an error setting an option,
so that an exec wasn't even tried.

thanks again!
Pádraig.

  parent reply	other threads:[~2012-12-09 22:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 20:23 [PATCH] Add no_new_privs Andy Lutomirski
2012-11-23 21:14 ` Pádraig Brady
2012-11-26 10:08   ` Karel Zak
2012-11-26 12:45     ` Ángel González
2012-11-26 19:03     ` Andy Lutomirski
2012-11-27  1:39       ` Andy Lutomirski
2012-11-23 22:52 ` Ángel González
2012-12-08  8:19 ` [PATCH] Add setpriv, a tool to set privileges and such Andy Lutomirski
2012-12-08 16:23   ` Ángel González
2012-12-08 19:04     ` Andy Lutomirski
2012-12-09 22:24   ` Pádraig Brady [this message]
2012-12-09 23:12     ` Andy Lutomirski
2013-01-08  8:31   ` Karel Zak
2013-01-14 15:33     ` Andy Lutomirski
2013-01-14 15:58   ` [PATCH v2] " Andy Lutomirski
2013-01-26 14:29     ` [PATCH] setpriv: run a program with different Linux privilege settings Sami Kerola
2013-02-04 20:20       ` Andy Lutomirski
2013-02-05  9:05         ` Karel Zak
2013-02-05 10:51           ` Karel Zak
2013-02-06  1:07             ` [PATCH] setpriv: Fix an error message typo Andy Lutomirski
2013-02-06 11:32               ` Karel Zak

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=50C50FB3.7080903@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=ingenit@zoho.com \
    --cc=kzak@redhat.com \
    --cc=luto@amacapital.net \
    --cc=util-linux@vger.kernel.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.