diff options
author | ache <ache@FreeBSD.org> | 1995-04-15 22:08:10 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-04-15 22:08:10 +0000 |
commit | 01787c4b0d94087dcae610c5d718dd901143620a (patch) | |
tree | 7ab42361d1620dfb5d299ac29ed73a4574596eef /usr.bin/at/privs.h | |
parent | 3f3f7b26718c2044111a8f6218809200c005facf (diff) | |
download | FreeBSD-src-01787c4b0d94087dcae610c5d718dd901143620a.zip FreeBSD-src-01787c4b0d94087dcae610c5d718dd901143620a.tar.gz |
Fight over non-working setruid
Diffstat (limited to 'usr.bin/at/privs.h')
-rw-r--r-- | usr.bin/at/privs.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/at/privs.h b/usr.bin/at/privs.h index 34fd690..5ed6c50 100644 --- a/usr.bin/at/privs.h +++ b/usr.bin/at/privs.h @@ -41,6 +41,15 @@ */ #define setreuid(r, e) seteuid(e) #define setregid(r, e) setegid(e) +#define SET_REAL_PRIV(a, b) {\ + setgid(b); \ + setuid(a); \ + } +#else +#define SET_REAL_PRIV(a. b) {\ + setregid((b), real_gid); \ + setreuid((a), real_uid); \ + } #endif /* Relinquish privileges temporarily for a setuid or setgid program @@ -114,7 +123,6 @@ gid_t real_gid, effective_gid; setregid(real_gid, effective_gid); \ effective_uid = (a); \ effective_gid = (b); \ - setregid(effective_gid, real_gid); \ - setreuid(effective_uid, real_uid); \ + SET_REAL_PRIV(a, b); \ } #endif |