summaryrefslogtreecommitdiff
path: root/usr.bin/rdist/common.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-07-05 07:22:19 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-07-05 07:22:19 +0000
commit982e43a92518875f6eb7d2c97822d247873bc350 (patch)
treeb704f1b36129dedf1025c52c7f9cc726d9d7c0ea /usr.bin/rdist/common.c
parent36a585351ccbc9f83d48929b4091fe0afaba0b3a (diff)
Assume POSIX: lchown(), fchown(), fchmod(), fchmodat()
Assume we have rcmdsh()
Diffstat (limited to 'usr.bin/rdist/common.c')
-rw-r--r--usr.bin/rdist/common.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c
index 1e3acfb55cd..9e17558fe63 100644
--- a/usr.bin/rdist/common.c
+++ b/usr.bin/rdist/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.29 2014/07/05 06:55:29 guenther Exp $ */
+/* $OpenBSD: common.c,v 1.30 2014/07/05 07:22:18 guenther Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -616,52 +616,7 @@ notilde:
return(pw_dir);
}
-#if defined(DIRECT_RCMD)
-/*
- * Set our effective user id to the user running us.
- * This should be the uid we do most of our work as.
- */
-int
-becomeuser(void)
-{
- int r = 0;
-
-#if defined(HAVE_SAVED_IDS)
- r = seteuid(userid);
-#else
- r = setreuid(0, userid);
-#endif /* HAVE_SAVED_IDS */
-
- if (r < 0)
- error("becomeuser %u failed: %s (ruid = %u euid = %u)",
- userid, SYSERR, getuid(), geteuid());
-
- return(r);
-}
-#endif /* DIRECT_RCMD */
-#if defined(DIRECT_RCMD)
-/*
- * Set our effective user id to "root" (uid = 0)
- */
-int
-becomeroot(void)
-{
- int r = 0;
-
-#if defined(HAVE_SAVED_IDS)
- r = seteuid(0);
-#else
- r = setreuid(userid, 0);
-#endif /* HAVE_SAVED_IDS */
-
- if (r < 0)
- error("becomeroot failed: %s (ruid = %u euid = %u)",
- SYSERR, getuid(), geteuid());
-
- return(r);
-}
-#endif /* DIRECT_RCMD */
/*
* Set access and modify times of a given file