summaryrefslogtreecommitdiff
path: root/usr.sbin/timed/timedc/cmds.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-17 00:21:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-17 00:21:20 +0000
commitb50b24ebdbf3b4e9a94318ea9ccec55d94c23b6f (patch)
treed772af49f7fae604405347f0e6bb7e77543d6af6 /usr.sbin/timed/timedc/cmds.c
parentcfdd5d1adeb759236ca0fda1bec1606672e9336e (diff)
move setuid revocation closer to the start (make it more obvious); miod ok
Diffstat (limited to 'usr.sbin/timed/timedc/cmds.c')
-rw-r--r--usr.sbin/timed/timedc/cmds.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/usr.sbin/timed/timedc/cmds.c b/usr.sbin/timed/timedc/cmds.c
index cc776ac82e9..fb79d13124b 100644
--- a/usr.sbin/timed/timedc/cmds.c
+++ b/usr.sbin/timed/timedc/cmds.c
@@ -1,4 +1,4 @@
-/* $Id: cmds.c,v 1.13 2002/03/14 16:44:25 mpech Exp $ */
+/* $OpenBSD: cmds.c,v 1.14 2002/05/17 00:21:19 deraadt Exp $ */
/*-
* Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -38,7 +38,7 @@ static char sccsid[] = "@(#)cmds.c 5.1 (Berkeley) 5/11/93";
#endif /* not lint */
#ifdef sgi
-#ident "$Revision: 1.13 $"
+#ident "$Revision: 1.14 $"
#endif
#include "timedc.h"
@@ -571,36 +571,3 @@ tracing(int argc, char *argv[])
bail:
siginterrupt(SIGINT, 0);
}
-
-int
-priv_resources()
-{
- struct sockaddr_in sin;
-
- sock_raw = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
- if (sock_raw < 0) {
- perror("opening raw socket");
- return (-1);
- }
-
- (void) seteuid(getuid());
- (void) setuid(getuid());
-
- sock = socket(AF_INET, SOCK_DGRAM, 0);
- if (sock < 0) {
- perror("opening socket");
- (void)close(sock_raw);
- return (-1);
- }
-
- memset(&sin, 0, sizeof sin);
- sin.sin_family = AF_INET;
- sin.sin_addr.s_addr = INADDR_ANY;
- if (bind(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- fprintf(stderr, "all reserved ports in use\n");
- (void)close(sock_raw);
- return (-1);
- }
-
- return (1);
-}