summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-11-18 23:39:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-11-18 23:39:19 +0000
commit77c3ec8597fc2749319d987267543fba284c40f1 (patch)
tree4554335bd8fcaf5bc92d633a7ce840cc5e03c098
parentd8a2b748ca93f4acae3931e8d26a3e2889992dd8 (diff)
blow away unused XIDLE signal race crap
-rw-r--r--libexec/rpc.rusersd/Makefile25
-rw-r--r--libexec/rpc.rusersd/rusers_proc.c64
2 files changed, 3 insertions, 86 deletions
diff --git a/libexec/rpc.rusersd/Makefile b/libexec/rpc.rusersd/Makefile
index e40273f2879..7a26af2c19a 100644
--- a/libexec/rpc.rusersd/Makefile
+++ b/libexec/rpc.rusersd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.2 2001/01/28 19:34:31 niklas Exp $
+# $OpenBSD: Makefile,v 1.3 2001/11/18 23:39:18 deraadt Exp $
PROG = rpc.rusersd
SRCS = rusersd.c rusers_proc.c
@@ -8,28 +8,5 @@ MLINKS= rpc.rusersd.8 rusersd.8
DPADD= ${LIBRPCSVC}
LDADD= -lrpcsvc
-.if exists(/usr/X11)
-XINCDIR= /usr/X11/include
-XLIBDIR= /usr/X11/lib
-.elif exists(/usr/X11R6)
-XINCDIR= /usr/X11R6/include
-XLIBDIR= /usr/X11R6/lib
-.elif exists(/usr/X11R5)
-XINCDIR= /usr/X11R5/include
-XLIBDIR= /usr/X11R5/lib
-.elif exists(/usr/X11R4)
-XINCDIR= /usr/X11R4/include
-XLIBDIR= /usr/X11R4/lib
-.elif exists(/usr/X386)
-XINCDIR= /usr/X386/include
-XLIBDIR= /usr/X386/lib
-.endif
-
-.if defined(XINCDIR) && exists($(XINCDIR)/X11/extensions/xidle.h)
-CFLAGS+= -I$(XINCDIR) -DXIDLE
-LDADD+= -L$(XLIBDIR) -lXext -lX11
-.endif
-
-
.include <bsd.prog.mk>
diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c
index 1e5665fae0b..2198ef970fd 100644
--- a/libexec/rpc.rusersd/rusers_proc.c
+++ b/libexec/rpc.rusersd/rusers_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers_proc.c,v 1.11 2001/08/18 21:38:55 deraadt Exp $ */
+/* $OpenBSD: rusers_proc.c,v 1.12 2001/11/18 23:39:18 deraadt Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -29,7 +29,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.11 2001/08/18 21:38:55 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.12 2001/11/18 23:39:18 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -37,26 +37,16 @@ static char rcsid[] = "$OpenBSD: rusers_proc.c,v 1.11 2001/08/18 21:38:55 deraad
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <signal.h>
#include <utmp.h>
#include <stdio.h>
#include <syslog.h>
#include <string.h>
#include <rpc/rpc.h>
-#ifdef XIDLE
-#include <setjmp.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/xidle.h>
-#endif
#include <rpcsvc/rusers.h> /* New version */
#include <rpcsvc/rnusers.h> /* Old version */
#define IGNOREUSER "sleeper"
-#ifdef OSF
-#define _PATH_UTMP UTMP_FILE
-#endif
-
#ifndef _PATH_UTMP
#define _PATH_UTMP "/etc/utmp"
#endif
@@ -92,52 +82,6 @@ extern int from_inetd;
FILE *ufp;
-#ifdef XIDLE
-Display *dpy;
-
-static sigjmp_buf openAbort;
-
-static void
-abortOpen()
-{
- siglongjmp(openAbort, 1); /* XXX signal/longjmp resource leaks */
-}
-
-XqueryIdle(display)
- char *display;
-{
- int first_event, first_error;
- Time IdleTime;
-
- (void) signal(SIGALRM, abortOpen);
- (void) alarm(10);
- if (!sigsetjmp(openAbort)) {
- if ((dpy = XOpenDisplay(display)) == NULL) {
- syslog(LOG_ERR, "cannot open display %s", display);
- return (-1);
- }
- if (XidleQueryExtension(dpy, &first_event, &first_error)) {
- if (!XGetIdleTime(dpy, &IdleTime)) {
- syslog(LOG_ERR, "%s: unable to get idle time", display);
- return (-1);
- }
- } else {
- syslog(LOG_ERR, "%s: Xidle extension not loaded", display);
- return (-1);
- }
- XCloseDisplay(dpy);
- } else {
- syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", display);
- return (-1);
- }
- (void) alarm(0);
- (void) signal(SIGALRM, SIG_DFL);
-
- IdleTime /= 1000;
- return ((IdleTime + 30) / 60);
-}
-#endif
-
static u_int
getidle(tty, display)
char *tty, *display;
@@ -151,10 +95,6 @@ getidle(tty, display)
* If this is an X terminal or console, then try the
* XIdle extension
*/
-#ifdef XIDLE
- if (display && *display && (idle = XqueryIdle(display)) >= 0)
- return (idle);
-#endif
idle = 0;
if (*tty == 'X') {
u_long kbd_idle, mouse_idle;