From 982e43a92518875f6eb7d2c97822d247873bc350 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Sat, 5 Jul 2014 07:22:19 +0000 Subject: Assume POSIX: lchown(), fchown(), fchmod(), fchmodat() Assume we have rcmdsh() --- usr.bin/rdist/common.c | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'usr.bin/rdist/common.c') 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 -- cgit v1.2.3