public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Windows Server 2012R2 64bit and 32bit Cygwin sshd
Date: Wed, 03 Sep 2014 13:26:00 -0000	[thread overview]
Message-ID: <20140903132616.GK6056@calimero.vinschen.de> (raw)
In-Reply-To: <loom.20140903T084528-450@post.gmane.org>

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

On Sep  3 07:17, Achim Gratz wrote:
> Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:
> > Don't use privilege separation, then the non-privileged sshd user won't
> > matter at all.  Privsep on Cygwin is only half-useful on Cygwin anyway,
> > if at all.
> 
> I've switched privilege separateion off completely, but no dice.  The Access
> Denied comes from trying to switch from primary group "MACHINE+None" to
> "Domain Users".  That is expected to happen, what I still don't get is why
> the parent process winds up with the exception instead of the originating
> process as on 64bit.

As I wrote, this is a red herring.  A failing setgid is no error at
all.  It has nothing to do with the exception, except for the debug
output preceeding the exception occurance.  Note the

  get_logon_server: DC: server: \\SC301

between them.  This, and the subsequent seterrno_from_win_error in the
parent sshd are a pretty sure sign that the exception is triggered by
the NetUserXXX calls.

> > As for the local cyg_server account, I'm not sure.  Usually,
> > a local machine account has no or only limited access to AD information.
> > As an account which needs AD to get user information it's a bit
> > unfortunate if it doesn't have access.
> 
> When the process comes to this point it has already verified the user via AD.

Yes, but this has nothing to do with it.  Before calling setuid (which
it calls a couple of times during login), sshd calls initgroups for the
new user, POSIX-like.  Initgroups in turn has to call NetUserGetGroups
and NetUserGetLocalGroups on the DC to fetch the full list of groups for
a user.  From the strace it *seems* that the call to NetUserGetGroups in
the grand child sshd process results in simply terminating the process.
The fact that there's no more output *at all* from the grand child
points to Windows killing the process hard.  Lacking any hint why this
occurs, it's just an assumption, of course.

> > The strace shows that it doesn't even *try* to start bash, but it's
> > entirely unclear why.
> 
> Is it possible to run sshd in gdb?

Yes, but Windows/Cygwin gdb don't allow to follow the child process
so it's very tricky.


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-09-03 13:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18 17:26 Achim Gratz
2014-08-19 13:37 ` Achim Gratz
2014-08-19 17:02   ` Corinna Vinschen
2014-08-19 17:21     ` Achim Gratz
2014-08-19 19:09       ` Corinna Vinschen
2014-08-19 19:21         ` Achim Gratz
2014-09-02 11:52 ` Achim Gratz
2014-09-02 14:07   ` Corinna Vinschen
2014-09-02 15:16     ` Achim Gratz
2014-09-02 15:38       ` Corinna Vinschen
2014-09-02 17:32         ` Achim Gratz
2014-09-03  7:17         ` Achim Gratz
2014-09-03 13:03           ` Achim Gratz
2014-09-03 13:37             ` Corinna Vinschen
2014-09-04 11:24               ` Achim Gratz
2014-09-04 12:28                 ` Corinna Vinschen
2014-09-04 14:12                   ` Achim Gratz
2014-09-04 14:59                     ` Achim Gratz
2014-09-05 11:16                     ` Corinna Vinschen
2014-09-05 11:56                       ` Corinna Vinschen
2014-09-05 18:17                         ` Achim Gratz
2014-09-03 13:26           ` Corinna Vinschen [this message]
2014-09-02 16:25     ` Achim Gratz
2014-09-02 19:14       ` Corinna Vinschen

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=20140903132616.GK6056@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).