]> git.saurik.com Git - apple/system_cmds.git/blobdiff - at.tproj/privs.h
system_cmds-735.20.1.tar.gz
[apple/system_cmds.git] / at.tproj / privs.h
index c7e029448487a8068e5ea62dbdb68ed9c2d4bc25..4a43b6cc98c18934663c075e71ee7f9c7589aee7 100644 (file)
@@ -1,5 +1,5 @@
-/* 
- *  privs.h - header for privileged operations 
+/*
+ *  privs.h - header for privileged operations
  *  Copyright (C) 1993  Thomas Koenig
  *
  * Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@ extern
 #endif
 uid_t real_uid, effective_uid;
 
-#ifndef MAIN 
+#ifndef MAIN
 extern
 #endif
 gid_t real_gid, effective_gid;
@@ -103,8 +103,8 @@ gid_t real_gid, effective_gid;
        PRIV_START \
        effective_uid = (a); \
        effective_gid = (b); \
-       if (setregid((gid_t)-1, effective_gid)<0) perr("cannot setregid"); \
-       if (setreuid((uid_t)-1, effective_uid)<0) perr("cannot setreuid"); \
+       if (setegid(effective_gid)<0) perr("cannot setegid"); \
+       if (seteuid(effective_uid)<0) perr("cannot seteuid"); \
        PRIV_END \
 }
 #endif