Mail Archives: cygwin-developers/2003/03/07/10:44:56
On Fri, Mar 07, 2003 at 09:33:35AM -0500, Pierre A. Humblet wrote:
> Corinna Vinschen wrote:
> > I even tried reverting the uid/gid to SYSTEM but it still fails in the
> > same way.
>
> Where in the code did you revert? Did you try setting the gid to Admins?
Everywhere. I tried
revert_ids
close(fd2)
close(fd)
close(fd2)
revert_ids
close(fd)
revert_ids
close(fd)
close(fd2)
close(fd)
revert_ids
close(fd2)
Reverting means, setting back to the original uid/gid pair system/admins.
> > And as you wrote, running under gdb or strace, everything's fine.
>
> My hypothesis about that is that strace starts everyting fresh from
> Windows. Otherwise we start from (ba)sh (or cygrunsrv), which may have
> setup/opened "things" for us.
Might be but what "things"? The both sockets are also "fresh" and not
shared with any other application.
> > Removing the setgroups() call doesn't change anything. But removing
> > one of setuid/setgid let the error disappear.
>
> That's strange because in Jason's environment 4.10 works fine. The main
> difference is that there is no setgroups() in 4.10. Also the close order
> is reversed, but that doesn't seem to matter.
Removing setgroups() is one of the things I did to reduce the code to the
absolutely necessary. Just FYI, in my environment I used 1004/513 as ids
which is sshd and, obviously, None. I also tried setting the group to 545
(Users) and 547 (Power Users) which didn't change anything. sshd is not a
member of any other group besides the inevitable None and Users.
So the situation as I can see (but not understand) is that creating and
using a nonpriv'd token "somehow" disturbs WinSock. Calling RevertToSelf
(I checked that it gets called) doesn't help. Waiting a while doesn't help.
But as you guessed, calling the test application from a plain Win app *does*
help. I started a ssh session under system account, switched to cmd.exe
and called the test app and the error disappears.
Baffled,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
- Raw text -