return 0;
static int accept_client(rfbClientPtr client) {	char xmessage[200], *cmd = NULL;	char *addr = client->host;	char *action = NULL;	if (accept_cmd == NULL || *accept_cmd == '\0') {		return 1;	/* no command specified, so we accept */	}	if (addr == NULL || addr[0] == '\0') {		addr = "unknown-host";	}	if (strstr(accept_cmd, "popup") == accept_cmd) {		/* use our builtin popup button */		/* (popup|popupkey|popupmouse)[+-X+-Y][:timeout] */		int ret, timeout = 120;		int x = -64000, y = -64000;		char *p, *mode;		char *userhost = ident_username(client);		/* extract timeout */		if ((p = strchr(accept_cmd, ':')) != NULL) {			int in;			if (sscanf(p+1, "%d", &in) == 1) {				timeout = in;			}		}		/* extract geometry */		if ((p = strpbrk(accept_cmd, "+-")) != NULL) {			int x1, y1;			if (sscanf(p, "+%d+%d", &x1, &y1) == 2) {				x = x1;				y = y1;			} else if (sscanf(p, "+%d-%d", &x1, &y1) == 2) {				x = x1;				y = -y1;			} else if (sscanf(p, "-%d+%d", &x1, &y1) == 2) {				x = -x1;				y = y1;			} else if (sscanf(p, "-%d-%d", &x1, &y1) == 2) {				x = -x1;				y = -y1;			}		}		/* find mode: mouse, key, or both */		if (strstr(accept_cmd, "popupmouse") == accept_cmd) {			mode = "mouse_only";		} else if (strstr(accept_cmd, "popupkey") == accept_cmd) {			mode = "key_only";		} else {			mode = "both";		}		rfbLog("accept_client: using builtin popup for: %s\n", addr);		if ((ret = ugly_accept_window(addr, userhost, x, y, timeout,		    mode))) {			free(userhost);			if (ret == 2) {				rfbLog("accept_client: viewonly: %s\n", addr);				client->viewOnly = TRUE;			}			rfbLog("accept_client: popup accepted: %s\n", addr);			return 1;		} else {			free(userhost);			rfbLog("accept_client: popup rejected: %s\n", addr);			return 0;		}	} else if (!strcmp(accept_cmd, "xmessage")) {		/* make our own command using xmessage(1) */		if (view_only) {			sprintf(xmessage, "xmessage -buttons yes:0,no:2 -center"			    " 'x11vnc: accept connection from %s?'", addr);		} else {			sprintf(xmessage, "xmessage -buttons yes:0,no:2,"			    "view-only:3 -center" " 'x11vnc: accept connection"			    " from %s?'", addr);			action = "yes:0,no:*,view:3";		}		cmd = xmessage;			} else {		/* use the user supplied command: */		cmd = accept_cmd;		/* extract any action prefix:  yes:N,no:M,view:K */		if (strstr(accept_cmd, "yes:") == accept_cmd) {			char *p;			if ((p = strpbrk(accept_cmd, " \t")) != NULL) {				int i;				cmd = p;				p = accept_cmd;				for (i=0; i<200; i++) {					if (*p == ' ' || *p == '\t') {						xmessage[i] = '\0';						break;					}					xmessage[i] = *p;					p++;				}				xmessage[200-1] = '\0';				action = xmessage;			}		}	}	if (cmd) {		int rc;		rfbLog("accept_client: using cmd for: %s\n", addr);		rc = run_user_command(cmd, client, "accept");		if (action) {			int result;			if (rc < 0) {				rfbLog("accept_client: cannot use negative "				    "rc: %d, action %s\n", rc, action);				result = 2;			} else {				result = action_match(action, rc);			}			if (result == 1) {				rc = 0;			} else if (result == 2) {				rc = 1;			} else if (result == 3) {				rc = 0;				rfbLog("accept_client: viewonly: %s\n", addr);				client->viewOnly = TRUE;			} else {				rc = 1;	/* NOTREACHED */			}		}		if (rc == 0) {			rfbLog("accept_client: accepted: %s\n", addr);			return 1;		} else {			rfbLog("accept_client: rejected: %s\n", addr);			return 0;		}	} else {		rfbLog("accept_client: no command, rejecting %s\n", addr);		return 0;	}	return 0;	/* NOTREACHED */}