diff options
author | Kevin Steves <stevesk@pobox.com> | 2001-04-09 14:50:52 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@pobox.com> | 2001-04-09 14:50:52 +0000 |
commit | cb17e99faeea6823a630b9769a1c8906ea0766b3 (patch) | |
tree | dca63d3267b9b24cfb7f2f18d65aec6fb8808044 /openbsd-compat/bsd-misc.c | |
parent | 393d2f782d4137873c7d5e96bb8a439767a9ac74 (diff) |
- (stevesk) use setresgid() for setegid() if needed
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r-- | openbsd-compat/bsd-misc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 6f92e064f..eb3a5407e 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "xmalloc.h" | 26 | #include "xmalloc.h" |
27 | #include "ssh.h" | 27 | #include "ssh.h" |
28 | 28 | ||
29 | RCSID("$Id: bsd-misc.c,v 1.3 2001/03/13 23:38:20 mouring Exp $"); | 29 | RCSID("$Id: bsd-misc.c,v 1.4 2001/04/09 14:50:56 stevesk Exp $"); |
30 | 30 | ||
31 | char *get_progname(char *argv0) | 31 | char *get_progname(char *argv0) |
32 | { | 32 | { |
@@ -70,6 +70,13 @@ int seteuid(uid_t euid) | |||
70 | } | 70 | } |
71 | #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ | 71 | #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ |
72 | 72 | ||
73 | #if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) | ||
74 | int setegid(uid_t egid) | ||
75 | { | ||
76 | return(setresgid(-1,egid,-1)); | ||
77 | } | ||
78 | #endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */ | ||
79 | |||
73 | #if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR) | 80 | #if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR) |
74 | const char *strerror(int e) | 81 | const char *strerror(int e) |
75 | { | 82 | { |