PR/4848: Kimmo Suominen: rpc_rusersd tries to open remote host as display

- change LOG_ERR to LOG_DEBUG because xdisplay access fails most
	  of the time.
	- only try the display code if the ut_host field has a :
This commit is contained in:
christos 1998-01-20 17:39:14 +00:00
parent 9fab7a4ffa
commit 36e588a416

View File

@ -1,4 +1,4 @@
/* $NetBSD: rusers_proc.c,v 1.15 1997/09/19 00:50:04 thorpej Exp $ */ /* $NetBSD: rusers_proc.c,v 1.16 1998/01/20 17:39:14 christos Exp $ */
/*- /*-
* Copyright (c) 1993 John Brezak * Copyright (c) 1993 John Brezak
@ -30,7 +30,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: rusers_proc.c,v 1.15 1997/09/19 00:50:04 thorpej Exp $"); __RCSID("$NetBSD: rusers_proc.c,v 1.16 1998/01/20 17:39:14 christos Exp $");
#endif /* not lint */ #endif /* not lint */
#include <stdio.h> #include <stdio.h>
@ -131,23 +131,23 @@ XqueryIdle(display)
(void) alarm(10); (void) alarm(10);
if (!sigsetjmp(openAbort, 0)) { if (!sigsetjmp(openAbort, 0)) {
if ((dpy = XOpenDisplay(display)) == NULL) { if ((dpy = XOpenDisplay(display)) == NULL) {
syslog(LOG_ERR, "cannot open display %s", display); syslog(LOG_DEBUG, "cannot open display %s", display);
return (-1); return (-1);
} }
if (XidleQueryExtension(dpy, &first_event, &first_error)) { if (XidleQueryExtension(dpy, &first_event, &first_error)) {
if (!XGetIdleTime(dpy, &IdleTime)) { if (!XGetIdleTime(dpy, &IdleTime)) {
syslog(LOG_ERR, "%s: unable to get idle time", syslog(LOG_DEBUG, "%s: unable to get idle time",
display); display);
return (-1); return (-1);
} }
} else { } else {
syslog(LOG_ERR, "%s: Xidle extension not loaded", syslog(LOG_DEBUG, "%s: Xidle extension not loaded",
display); display);
return (-1); return (-1);
} }
XCloseDisplay(dpy); XCloseDisplay(dpy);
} else { } else {
syslog(LOG_ERR, "%s: server grabbed for over 10 seconds", syslog(LOG_DEBUG, "%s: server grabbed for over 10 seconds",
display); display);
return (-1); return (-1);
} }
@ -173,7 +173,8 @@ getidle(tty, display)
* XIdle extension * XIdle extension
*/ */
#ifdef XIDLE #ifdef XIDLE
if (display && *display && (idle = XqueryIdle(display)) >= 0) if (display && *display && strchr(display, ':') != NULL &&
(idle = XqueryIdle(display)) >= 0)
return (idle); return (idle);
#endif #endif
idle = 0; idle = 0;