From evanc@synapse.net Sat Nov 22 14:56:41 1997
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id OAA20146 for <bugs@RT-11.MIT.EDU>; Sat, 22 Nov 1997 14:56:40 -0500
Received: from conductor.synapse.net by MIT.EDU with SMTP
id AA17860; Sat, 22 Nov 97 14:56:37 EST
Received: (qmail 7656 invoked by uid 100); 22 Nov 1997 19:56:36 -0000
Message-Id: <19971122195636.7655.qmail@conductor.synapse.net>
Date: 22 Nov 1997 19:56:36 -0000
From: evanc@synapse.net
To: krb5-bugs@MIT.EDU
Cc: evanc@synapse.net
Subject: seteuid.c should not look for _POSIX_SAVED_IDS
X-Send-Pr-Version: 3.99
System: BSD/OS conductor.synapse.net 3.1 BSDI BSD/OS 3.1 Kernel #0: Tue Oct 28 19:45:49 EST 1997 evanc@piano.synapse.net:/usr/src/sys/compile/CONDUCTOR i386
This prevents seteuid() from being used on 4.4BSD systems, as none
of them define _POSIX_SAVED_IDS, and seteuid() is very often the
only set-effective-UID function that actually works. This is
definitely the case on all versions of BSD/OS.
Fix verified to not break anything on BSD/OS 3.1 and FreeBSD
3.0-current. I rather doubt it will break anything on other
platforms either.
--- src/lib/krb5util/seteuid.c Sat Nov 22 14:53:19 1997
***************
*** 38,44 ****
int euid_in;
{
uid_t euid = (uid_t) euid_in;
! #if defined(_POSIX_SAVED_IDS) && defined(HAVE_SETEUID)
return (seteuid(euid)) ;
#else
#if defined(HAVE_SETRESUID)
--- 38,44 ----
int euid_in;
{
uid_t euid = (uid_t) euid_in;
! #if defined(HAVE_SETEUID)
return (seteuid(euid)) ;
#else
#if defined(HAVE_SETRESUID)
From: Evan Champion <evanc@synapse.net>
To: krb5-bugs@MIT.EDU
Cc: Subject: krb5-libs/503: More on the BSD/OS setreuid()
Date: Sat, 6 Dec 1997 10:09:51 -0500 (EST)
As an FYI, I was digging through the BSD/OS kernel source to find out what
setreuid() _really_ does, and found this...
/*
* Partially emulate old setreuid usage of exchanging ruid and euid.
* We assume that the intent of setting ruid is to be able to get
* back setuid privilege. So we make sure that we will be able to
* do so, but do not actually set the ruid.
*/
setreuid() is actually implemented as seteuid(). The real uid is never
changed.
Now, this code is only included if you have COMPAT_43 or COMPAT_BSDI11
defined. COMPAT_43 is not defined by default, and my kernels don't have
COMPAT_BSDI11 defined.
Even more interesting, in libc's compat-43 part, setruid() is implemented
as setreuid(ruid, -1), when setreuid() never sets the real id :-)
Evan
Responsible-Changed-From-To: krb5-unassigned->tlyu
Responsible-Changed-By: tlyu
Responsible-Changed-When: Tue Jan 6 17:28:37 1998
Responsible-Changed-Why:
State-Changed-From-To: open-closed
State-Changed-By: tlyu
State-Changed-When: Tue Jan 6 17:28:49 1998
State-Changed-Why:
Fixed
src/lib/krb5util/seteuid.c 1.5
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id OAA20146 for <bugs@RT-11.MIT.EDU>; Sat, 22 Nov 1997 14:56:40 -0500
Received: from conductor.synapse.net by MIT.EDU with SMTP
id AA17860; Sat, 22 Nov 97 14:56:37 EST
Received: (qmail 7656 invoked by uid 100); 22 Nov 1997 19:56:36 -0000
Message-Id: <19971122195636.7655.qmail@conductor.synapse.net>
Date: 22 Nov 1997 19:56:36 -0000
From: evanc@synapse.net
To: krb5-bugs@MIT.EDU
Cc: evanc@synapse.net
Subject: seteuid.c should not look for _POSIX_SAVED_IDS
X-Send-Pr-Version: 3.99
Show quoted text
>Number: 503
>Category: krb5-libs
>Synopsis: seteuid.c should not look for _POSIX_SAVED_IDS
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: tlyu
>State: closed
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Sat Nov 22 14:57:01 EST 1997
>Last-Modified: Tue Jan 06 17:29:28 EST 1998
>Originator: Evan Champion
>Organization:
>Category: krb5-libs
>Synopsis: seteuid.c should not look for _POSIX_SAVED_IDS
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: tlyu
>State: closed
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Sat Nov 22 14:57:01 EST 1997
>Last-Modified: Tue Jan 06 17:29:28 EST 1998
>Originator: Evan Champion
>Organization:
Show quoted text
>Release: krb5-1.0.2
>Environment:
>Environment:
System: BSD/OS conductor.synapse.net 3.1 BSDI BSD/OS 3.1 Kernel #0: Tue Oct 28 19:45:49 EST 1997 evanc@piano.synapse.net:/usr/src/sys/compile/CONDUCTOR i386
Show quoted text
>Description:
lib/krb5util/seteuid.c should not be looking for _POSIX_SAVED_IDS.This prevents seteuid() from being used on 4.4BSD systems, as none
of them define _POSIX_SAVED_IDS, and seteuid() is very often the
only set-effective-UID function that actually works. This is
definitely the case on all versions of BSD/OS.
Fix verified to not break anything on BSD/OS 3.1 and FreeBSD
3.0-current. I rather doubt it will break anything on other
platforms either.
Show quoted text
>How-To-Repeat:
Show quoted text
>Fix:
*** /home/evanc/1/krb5-1.0.3/src/lib/krb5util/seteuid.c Mon Nov 17 22:49:40 1997--- src/lib/krb5util/seteuid.c Sat Nov 22 14:53:19 1997
***************
*** 38,44 ****
int euid_in;
{
uid_t euid = (uid_t) euid_in;
! #if defined(_POSIX_SAVED_IDS) && defined(HAVE_SETEUID)
return (seteuid(euid)) ;
#else
#if defined(HAVE_SETRESUID)
--- 38,44 ----
int euid_in;
{
uid_t euid = (uid_t) euid_in;
! #if defined(HAVE_SETEUID)
return (seteuid(euid)) ;
#else
#if defined(HAVE_SETRESUID)
Show quoted text
>Audit-Trail:
From: Evan Champion <evanc@synapse.net>
To: krb5-bugs@MIT.EDU
Cc: Subject: krb5-libs/503: More on the BSD/OS setreuid()
Date: Sat, 6 Dec 1997 10:09:51 -0500 (EST)
As an FYI, I was digging through the BSD/OS kernel source to find out what
setreuid() _really_ does, and found this...
/*
* Partially emulate old setreuid usage of exchanging ruid and euid.
* We assume that the intent of setting ruid is to be able to get
* back setuid privilege. So we make sure that we will be able to
* do so, but do not actually set the ruid.
*/
setreuid() is actually implemented as seteuid(). The real uid is never
changed.
Now, this code is only included if you have COMPAT_43 or COMPAT_BSDI11
defined. COMPAT_43 is not defined by default, and my kernels don't have
COMPAT_BSDI11 defined.
Even more interesting, in libc's compat-43 part, setruid() is implemented
as setreuid(ruid, -1), when setreuid() never sets the real id :-)
Evan
Responsible-Changed-From-To: krb5-unassigned->tlyu
Responsible-Changed-By: tlyu
Responsible-Changed-When: Tue Jan 6 17:28:37 1998
Responsible-Changed-Why:
State-Changed-From-To: open-closed
State-Changed-By: tlyu
State-Changed-When: Tue Jan 6 17:28:49 1998
State-Changed-Why:
Fixed
src/lib/krb5util/seteuid.c 1.5
Show quoted text
>Unformatted: