From: Houder <houder@xs4all.nl>
To: cygwin@cygwin.com
Subject: Re: sshd: fatal: seteuid XXX : No such device or address
Date: Fri, 15 Mar 2019 19:39:00 -0000 [thread overview]
Message-ID: <7dcabfa538edb7ed869b8b26205aeee9@smtp-cloud7.xs4all.net> (raw)
In-Reply-To: <20190315134247.GR3785@calimero.vinschen.de>
On Fri, 15 Mar 2019 14:42:47, Corinna Vinschen wrote:
> On Mar 15 14:06, Houder wrote:
> > One is forced to create the exact same environment (system) as the
> > person who is complaining, fire up the debugger (like sticking
> > a thermometer in a patient's rear end) in order to find out where
> > the code failed ...
> >
> > Meaning, within the context of the recent sshd problems, possibly only
^^^^
> > you know where the error ERROR_FILE_INVALID (resulting in the error
^^^
strace, yes. But only if one has the exact same "network" at one's disposal
as the one where the problem occurred (like you have at your place; while I
only have one simple computer) ... That is decisive.
> > message "No such device or address") was generated ... (and by which
> > Windows function).
>
> The only interface an application has is by checking the POSIX
> errno value. This is what Cygwin is about :)
>
> If you need more details what's going on under the hood, you have
> to use strace.
>
> > Oh well, this cannot be helped ...
>
> Well, there *is* a solution by using strace. And hey, we now know what
> ENXIO returned from seteuid means, don't we? It's not all bad :)
You do! I do not :-) (as I do not have the machinery at my disposal that
is required to provoke this error).
A simple STC to emphasize my statement (i.e. a problem that I can strace
on my computer).
int
main()
{
errno = 0;
if (seteuid( (uid_t)1004) != 0) { // 1004, not being me :-)
printf("seteuid: errno = %d, errstr = %s\n", errno, strerror(errno) );
// seteuid: errno = 13, errstr = Permission denied => EACCES
// ... while only EPERM en EINVAL are documented ...
} else printf("1004, OK\n");
}
64-@@ ./seteuid
seteuid: errno = 13, errstr = Permission denied ... huh?
On Linux this simple "Simple Test Case" will result in:
seteuid: errno = 1, errstr = Operation not permitted ... Got it!
Fortunately, I have now have the strace output at my disposal:
... studying the strace output and the source code, I am now able to
tell what is going on ... see below:
seteuid (syscalls.cc)
.lsaprivkeyauth (sec_auth.cc) <==== fails; as result NULL (token)
is returned by lsaprivkeyauth ...
...lsa_open_policy (sec_auth.cc) <==== fails; as result NULL (lsa)
is returned by lsa_open_policy ...
# errno, set by lsa_open_policy, is ignored
# seteuid() chooses NOT to bail out, but
# to attempt "Service For User Logon" (s4u) ...
.s4uauth (sec_auth.cc) <==== fails (because LsaRegisterLogonProcess
fails), returning the status (0xC0000041)
to seteuid()
# /usr/include/w32api/ntstatus.h:
# defines STATUS_PORT_CONNECTION_REFUSED ((NTSTATUS)0xC0000041)
# now seteuid chooses to bail out (i.e. setuid() fails)
Q: errno?
s4uauth calls __seterrno_from_nt_status (0xC0000041), which in turn
calls RtlNtStatusToDosError(0xC0000041), which in turn
calls geterrno_from_win_error(5,...):
0xC0000041 is mapped to 5, which in turn is mapped to 13 (EACCES).
Henri
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2019-03-15 19:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 11:39 renaud.rolles
2019-03-14 12:10 ` Corinna Vinschen
2019-03-14 13:26 ` renaud.rolles
2019-03-14 13:53 ` Corinna Vinschen
2019-03-14 14:03 ` renaud.rolles
2019-03-14 14:20 ` Andrey Repin
2019-03-14 14:24 ` David Dombrowsky
2019-03-14 14:27 ` Corinna Vinschen
2019-03-14 14:50 ` Andrey Repin
2019-03-14 14:38 ` renaud.rolles
2019-03-14 15:07 ` Andrey Repin
2019-03-14 15:29 ` renaud.rolles
2019-07-10 16:10 ` schleprock
2019-03-14 15:53 ` Houder
2019-03-14 17:29 ` Corinna Vinschen
2019-03-15 13:06 ` Houder
2019-03-15 13:42 ` Corinna Vinschen
2019-03-15 19:39 ` Houder [this message]
2019-03-15 20:41 ` Corinna Vinschen
2019-03-16 9:21 ` Houder
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=7dcabfa538edb7ed869b8b26205aeee9@smtp-cloud7.xs4all.net \
--to=houder@xs4all.nl \
--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).