summaryrefslogtreecommitdiffstats
path: root/usr.bin/at/privs.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/at/privs.h')
-rw-r--r--usr.bin/at/privs.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/usr.bin/at/privs.h b/usr.bin/at/privs.h
index f8520661..2108efb 100644
--- a/usr.bin/at/privs.h
+++ b/usr.bin/at/privs.h
@@ -1,20 +1,26 @@
-/*
- * privs.h - header for privileged operations
+/*
+ * privs.h - header for privileged operations
* Copyright (C) 1993 Thomas Koenig
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. The name of the author(s) may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _PRIVS_H
@@ -62,7 +68,7 @@ extern
#endif
uid_t real_uid, effective_uid;
-#ifndef MAIN
+#ifndef MAIN
extern
#endif
gid_t real_gid, effective_gid;
@@ -81,8 +87,8 @@ gid_t real_gid, effective_gid;
effective_uid = geteuid(); \
real_gid = (b); \
effective_gid = getegid(); \
- setreuid(effective_uid, real_uid); \
setregid(effective_gid, real_gid); \
+ setreuid(effective_uid, real_uid); \
}
#define PRIV_START {\
@@ -90,8 +96,8 @@ gid_t real_gid, effective_gid;
setregid(real_gid, effective_gid);
#define PRIV_END \
- setreuid(effective_uid, real_uid); \
setregid(effective_gid, real_gid); \
+ setreuid(effective_uid, real_uid); \
}
#define REDUCE_PRIV(a,b) {\
OpenPOWER on IntegriCloud