Bug 657 - Priv seperation causes setreuid error
Summary: Priv seperation causes setreuid error
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 3.7.1p1
Hardware: ix86 BSDI
: P2 critical
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
: 674 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-18 01:55 AEST by Matthew M. Gamble
Modified: 2004-04-14 12:24 AEST (History)
1 user (show)

See Also:


Attachments
Add defines to configure.ac for BSDi (611 bytes, patch)
2003-09-19 21:16 AEST, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew M. Gamble 2003-09-18 01:55:09 AEST
Running sshd with DEBUG3 logging, the following is displayed whenever 
connections are made: 

setreuid 101: Operation not permitted

User 101 is the sshd user.

If required, I can post ktrace outputs as well as full logs.  I can also 
provide access to a BSDi box if needed.  

Our BSDi version is 4.3.1 (with all patches)
Comment 1 Darren Tucker 2003-09-18 09:20:26 AEST
Try adding:
#define SETEUID_BREAKS_SETUID 1
#define BROKEN_SETREUID 1
#define BROKEN_SETREGID 1

to your config.h and recompiling (don't re-run configure)
Comment 2 Matthew M. Gamble 2003-09-18 10:17:51 AEST
That fixed it.  Perhaps that should be noted somewhere?  Perhaps a README.BSDi 
file?
Comment 3 Darren Tucker 2003-09-18 11:33:44 AEST
The bug shouldn't be closed until we fix configure to automatically define
those.  What does configure report for the "system type" for your BSDi box?
Comment 4 Darren Tucker 2003-09-18 11:40:23 AEST
*** Bug 674 has been marked as a duplicate of this bug. ***
Comment 5 Markus Friedl 2003-09-18 23:49:45 AEST
it should be this:


              Host: i386-pc-bsdi4.3.1

same for other bsd/os versions. e.g 4.3, 4.2, 4.0.2
and probably 5.0, but i did not test.
Comment 6 Markus Friedl 2003-09-18 23:57:24 AEST
bsdos 5.0  (all patches) needs the same defines.
Comment 7 Dave Yadallee 2003-09-19 02:05:57 AEST
Here is what I am getting

1) doctor.nl2k.ab.ca//etc/mail$ sshd -d -d -d
debug2: read_server_config: filename /usr/contrib/etc/sshd_config
debug1: sshd version OpenSSH_3.7.1p1
debug1: private host key: #0 type 0 RSA1
debug3: Not a RSA1 key file /usr/contrib/etc/ssh_host_rsa_key.
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug3: Not a RSA1 key file /usr/contrib/etc/ssh_host_dsa_key.
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
debug1: setgroups() failed: Invalid argument
debug1: Bind to port 22 on ::.
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
Cannot bind any address.
You have new mail in /var/mail/root
doctor.nl2k.ab.ca//etc/mail$

2)  doctor.nl2k.ab.ca/~$less typescriot
typescriot: No such file or directory
doctor.nl2k.ab.ca/~$less typescript
Script started on Wed Sep 17 06:20:55 2003
doctor.nl2k.ab.ca/~$ssh -v -2 -i ~doctor/.ssh/id_rsa -l doctor uucp
OpenSSH_3.7.1p1, SSH protocols 1.5/2.0, OpenSSL 0.9.6j [engine] 10 Apr 2003
debug1: Reading configuration data /usr/contrib/etc/ssh_config^M
debug1: Connecting to uucp [204.209.81.3] port 22.^M
debug1: Connection established.^M
debug1: identity file /usr/home/doctor/.ssh/id_rsa type 1^M
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p1^M
debug1: match: OpenSSH_3.7.1p1 pat OpenSSH*^M
debug1: Enabling compatibility mode for protocol 2.0^M
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p1^M
debug1: SSH2_MSG_KEXINIT sent^M
Connection closed by 204.209.81.3^M
debug1: Calling cleanup 0x80608b0(0x0)^M
doctor.nl2k.ab.ca/~$exit
exit

Script done on Wed Sep 17 06:21:34 2003
Comment 8 Darren Tucker 2003-09-19 21:16:17 AEST
Created attachment 435 [details]
Add defines to configure.ac for BSDi

Please try the attached patch.	You will need to run autoconf to rebuild
configure.
Comment 9 Darren Tucker 2003-09-22 11:22:12 AEST
Thanks for the report.  This has been fixed (both in HEAD and the 3.7 branch). 
Please try tomorrow's snapshot (which you can get from one of the mirrors) and
see if it works correctly out-of-the-box.

http://www.openssh.com/portable.html#mirrors
Comment 10 Damien Miller 2004-04-14 12:24:19 AEST
Mass change of RESOLVED bugs to CLOSED