public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: The eternal uid issue
Date: Wed, 23 Jul 2014 15:24:00 -0000	[thread overview]
Message-ID: <20140723152357.GA24446@calimero.vinschen.de> (raw)
In-Reply-To: <53CF9E0F.F596FC60@boland.nl>

[-- Attachment #1: Type: text/plain, Size: 3727 bytes --]

On Jul 23 13:35, D. Boland wrote:
> Corinna Vinschen wrote:
> > Not in relation to the uid.  In contrast to Linux we don't have the one
> > single root user.  We have potentially endless numbers of them, and one
> > of them, not necessarily SYSTEM, is used to run the service.  Keep in
> > mind that there may also be company policy in place which disallows
> > installing services under specific accounts unless absolutely necessary.
> > 
> > Therefore, while we mostly strive to make Cygwin accommodate user
> > space, we're not able to do it related to the root uid.
> 
> Thanks for your lengthly and detailed answer. I appreciate that. But
> don't you think upstream maintainers will raise at least one eyebrow
> if we propose code that makes any user who starts the program the
> root/admin user?  You suggest only those who are in the admin group.
> But that will soon be any service that starts up.

You're getting this wrong.  Cygwin is not the OS.  We do not make
every user an admin since we're in no position to do that.  We can't
give the user any more rights the OS is already giving the user.

The idea of such a test is to make the test independent of the actual
uid.  There are two cases.  One is to check if the user has admin
rights to perform certain actions, the other is to check if a file
ownership is safe.  A safe ownership is one where the file belongs
to the user running the service.  On Linux or BSD systems that's
usually the root user, in our case it's some arbitrary user account.
The check is basically the same.

> It actually is my solution to running Sendmail: create the Sendmail
> user, called 'smmsp' and make it an Administrator, so it can
> impersonate users on my system.  But I don't like my solution, because
> this would mean I have to create an admin-user for any Linux service
> that I install. So now my Cygwin setup would be crowded with highly
> privileged daemons, listening, waiting to get hacked.

That's what the cyg_server account is meant for.  It's the one account
which has the right to change the user context even when using method 1
from the setuid overview of the User's Guide.

Other services don't need this permissions, they just have to have
the right to create certain objects.  Cygserver is such a service,
for instance.  It's perfectly fine for cygserver to run under SYSTEM
or, FWIW, any other account with local administrative privileges.

> The more elegant solution would be to create only one secondary
> privileged user, let's call it 'root' ;-). Now Sendmail can start as
> root, switch to the totally *unprivileged* 'smmsp' user and receive
> mail.  Of course the real bonus is that these unprivileged users
> wouldn't need passwords, since they are impersonated, not logged on.
> These would consequently be *super-secure* users, because it is
> impossible to login with an empty password.

Same thing with cyg_server.

> Why is this related to the uid issue? I already tested the second
> solution. I found out that if I assign my 'root' user the '0' id in
> /etc/passwd, it actually works. I was delighted, because I could
> roll-back all these weird changes I put in the
> Sendmail/procmail/mail.local source to fix the getuid != 0 problem.

Yes, you can do that and it was always possible, but it requires
unnecessary user changes.  Also, passwd and group files are going
to become entirely superfluous at one point, and there's not a 
single account which is translated to uid 0 on the fly.  There
simply isn't one.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2014-07-23 15:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23  8:01 D. Boland
2014-07-23  8:19 ` Linda Walsh
2014-07-23  8:34   ` D. Boland
2014-07-26  2:07     ` The deprecated uid issue: use caps Linda Walsh
2014-07-26 13:29       ` D. Boland
2014-07-23  9:14 ` The eternal uid issue Corinna Vinschen
2014-07-23 11:31   ` D. Boland
2014-07-23 15:13     ` Larry Hall (Cygwin)
2014-07-23 15:24     ` Corinna Vinschen [this message]
2014-07-24  6:48       ` D. Boland
2014-07-24 13:52         ` Corinna Vinschen
2014-07-24 21:38           ` D. Boland
2014-07-24 22:18             ` Jeffrey Altman
2014-07-25 12:42             ` Corinna Vinschen
2014-07-25 12:47               ` Corinna Vinschen
2014-07-25 14:01                 ` D. Boland
2014-07-28  8:03               ` D. Boland
2014-07-28  9:14                 ` Corinna Vinschen
2014-07-28 11:38                   ` D. Boland
2014-07-28 11:53                     ` Corinna Vinschen
2014-07-28 12:04                       ` Corinna Vinschen
2014-07-29 14:02                       ` D. Boland
2014-07-30 13:10                         ` Corinna Vinschen
2014-07-31 12:48                           ` D. Boland
2014-07-23 16:20     ` Andrey Repin
2014-07-23 16:27       ` Christopher Faylor
2014-07-24  9:30         ` D. Boland
2014-07-24 13:20           ` Andrey Repin

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=20140723152357.GA24446@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /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 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 read-only IMAP folder(s) and NNTP newsgroup(s).