Mailing List Archive

[Bug 645] Configure mis-identifies setresgid
http://bugzilla.mindrot.org/show_bug.cgi?id=645

Summary: Configure mis-identifies setresgid
Product: Portable OpenSSH
Version: -current
Platform: ix86
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Build system
AssignedTo: openssh-bugs@mindrot.org
ReportedBy: tigerwolf@tigerden.com


Compiled on linux gcc 2.7.2.3, kernel 2.0.38 on i586. Latest zlib and openssl
packages were in place.

Compile completes apparently successfully. When logging in, the password is
accepted, the system MOTD is displayed; but then, the connection immediately
closes.

Errors in syslog show:
sshd[7319]: fatal: setresgid 100: Function not implemented

Configure says 'yes' to the check for setresgid and sets the define
HAVE_SETRESGID in config.h.

Commenting out the define seems to fix the problem.

I wos told by someone more knowlegeable than I that the setresgid function
wasn't implemented until later kernels, implying the test done by ./configure
dosen't properly yield the right answer.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From dtucker@zip.com.au 2003-09-17 17:04 -------
Created an attachment (id=406)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=406&action=view)
Test setresuid call

We need a way to detect this at build time without needing root privs to build.
What does the attached program return?

This is what I get from RH 8.
$ gcc setresgidtest.c
$ ./a.out
setresgid returned 0, errno 0
setresuid returned 0, errno 0



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From djm@mindrot.org 2003-09-17 17:21 -------
The problem is that your libc is advertising the availability of a setresuid
library routing, but not actually implementing it. This is a thouroughly broken
state of affairs.

What distribution are you using?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From tigerwolf@tigerden.com 2003-09-18 01:17 -------
The distribution was originally slackware, but various parts upgraded now and
then, usually to deal with something like inability to compile some needed
routine (typically, some security patch issue such as this round). libc
shows
libc.so.4.7.6 and libc.so.5.4.44

The machine is a main server with over 100 accounts and other functions, so not
easily replaced. It's been rock solid for years with uptimes over 450 days and
that was cut short when the ups ran down. I'm half scared to mess with it
except in a crisis! :)

The test provided won't compile, either:

tiger:~# gcc setresgidtest.c
/tmp/cca015121.o: In function `main':
/tmp/cca015121.o(.text+0x5f): undefined reference to `setresuid'





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From tim@newmoonnine.com 2003-09-20 02:53 -------
I've got the same issue on an old x86 RedHat box with a 2.0.35 kernel. The box
is scheduled to retire soon (for like 3 years now). Not important, to me anyway,
but these comments may or may not help others. 3.6.1p2 works fine.
If it seems a worthy cause I can post the output of strace or perform other tests.

gcc-2.7.2.3-13
glibc-2.0.7-19

# gcc setresgidtest.c
# ./a.out
setresgid returned -1, errno 0
setresuid returned -1, errno 38






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From dtucker@zip.com.au 2003-09-22 11:33 -------
It looks like that test program catches the problem (the fact that it doesn't
compile in comment #3 is good since we want to detect a failure).

Any volunteers to do a patch and test it?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From tim@newmoonnine.com 2003-09-23 01:40 -------
I am willing to try the patch if it makes sense to you. setresgidtest.c
compiled fine on my target sys (as a non root user too), but fails to execute
properly (comment 4).

Otherwise the system has the same symptoms the original poster described.
(builds fine, but all logins fail with authentication failed errors).








------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From tim@newmoonnine.com 2003-09-23 02:09 -------
correction: "but all logins fail with authentication failed errors" is wrong
-that was another unrelated issue.

"fatal: setresgid nnn: Function not implemented" is the reported error.








------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
[Bug 645] Configure mis-identifies setresgid [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=645





------- Additional Comments From tim@newmoonnine.com 2003-09-25 02:08 -------