- (stevesk) use setresgid() for setegid() if needed

This commit is contained in:
Kevin Steves 2001-04-09 14:50:52 +00:00
parent 393d2f782d
commit cb17e99fae
4 changed files with 17 additions and 5 deletions

View File

@ -1,4 +1,5 @@
20010409
- (stevesk) use setresgid() for setegid() if needed
- (stevesk) configure.in: typo
- OpenBSD CVS Sync
- stevesk@cvs.openbsd.org 2001/04/08 16:01:36
@ -4965,4 +4966,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
$Id: ChangeLog,v 1.1086 2001/04/08 22:50:44 stevesk Exp $
$Id: ChangeLog,v 1.1087 2001/04/09 14:50:52 stevesk Exp $

View File

@ -1,4 +1,4 @@
# $Id: configure.in,v 1.273 2001/04/08 22:50:43 stevesk Exp $
# $Id: configure.in,v 1.274 2001/04/09 14:50:54 stevesk Exp $
AC_INIT(ssh.c)
@ -471,7 +471,7 @@ AC_ARG_WITH(tcp-wrappers,
)
dnl Checks for library functions.
AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell glob inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_sa clock fchown fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getgrouplist getnameinfo getrlimit getrusage getttyent getusershell glob inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv setegid seteuid setlogin setproctitle setresgid setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strmode strsep strtok_r sysconf tcgetpgrp utimes vsnprintf vhangup vis waitpid _getpty __b64_ntop)
dnl Checks for time functions
AC_CHECK_FUNCS(gettimeofday time)
dnl Checks for libutil functions

View File

@ -26,7 +26,7 @@
#include "xmalloc.h"
#include "ssh.h"
RCSID("$Id: bsd-misc.c,v 1.3 2001/03/13 23:38:20 mouring Exp $");
RCSID("$Id: bsd-misc.c,v 1.4 2001/04/09 14:50:56 stevesk Exp $");
char *get_progname(char *argv0)
{
@ -70,6 +70,13 @@ int seteuid(uid_t euid)
}
#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
int setegid(uid_t egid)
{
return(setresgid(-1,egid,-1));
}
#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
const char *strerror(int e)
{

View File

@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* $Id: bsd-misc.h,v 1.2 2001/02/09 01:55:36 djm Exp $ */
/* $Id: bsd-misc.h,v 1.3 2001/04/09 14:50:56 stevesk Exp $ */
#ifndef _BSD_MISC_H
#define _BSD_MISC_H
@ -52,6 +52,10 @@ int innetgr(const char *netgroup, const char *host,
int seteuid(uid_t euid);
#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
int setegid(uid_t egid);
#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
const char *strerror(int e);
#endif