]> git.armaanb.net Git - opendoas.git/blobdiff - libopenbsd/setresuid.c
libopenbsd: remove MacOSX compat functions, its not supported anyways
[opendoas.git] / libopenbsd / setresuid.c
diff --git a/libopenbsd/setresuid.c b/libopenbsd/setresuid.c
deleted file mode 100644 (file)
index a62b19a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2015 Nathan Holstein <nathan.holstein@gmail.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/types.h>
-#include <errno.h>
-#include <unistd.h>
-
-/* I don't think we can actually mimic the right semantics? */
-int
-setresuid(uid_t ruid, uid_t euid, uid_t suid)
-{
-       int ret;
-       if (suid != ruid) {
-               errno = EPERM;
-               return -1;
-       }
-       if ((ret = setuid(ruid)) != 0)
-               return ret;
-       if ((ret = seteuid(euid)) != 0)
-               return ret;
-       return 0;
-}
-