From owner-svn-src-all@FreeBSD.ORG Sat Aug 17 07:12:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D665616; Sat, 17 Aug 2013 07:12:53 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADD9294C; Sat, 17 Aug 2013 07:12:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7H7CrvR089637; Sat, 17 Aug 2013 07:12:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7H7CrYi089636; Sat, 17 Aug 2013 07:12:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201308170712.r7H7CrYi089636@svn.freebsd.org> From: Hiroki Sato Date: Sat, 17 Aug 2013 07:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254440 - head/usr.sbin/rwhod X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Aug 2013 07:12:53 -0000 Author: hrs Date: Sat Aug 17 07:12:52 2013 New Revision: 254440 URL: http://svnweb.freebsd.org/changeset/base/254440 Log: Unbreak rwhod(8): - It did not work with GENERIC kernel after r250603 because options PROCDESC was required for pdfork(2). It now just uses fork(2) instead when this syscall is not available. - Fix verify(). This function was broken in r250602 because the outermost "()" was removed from the condition !(isalnum() || ispunct()). It prevented hostnames including "-", for example. Modified: head/usr.sbin/rwhod/rwhod.c Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Sat Aug 17 07:10:01 2013 (r254439) +++ head/usr.sbin/rwhod/rwhod.c Sat Aug 17 07:12:52 2013 (r254440) @@ -274,6 +274,15 @@ main(int argc, char *argv[]) exit(1); if (!quiet_mode) { pid_child_receiver = pdfork(&fdp, 0); + if (pid_child_receiver == -1) { + if (errno != ENOSYS) { + syslog(LOG_ERR, "pdfork: %m"); + exit(1); + } else { + pid_child_receiver = fork(); + fdp = -1; + } + } if (pid_child_receiver == 0) { receiver_process(); } else if (pid_child_receiver > 0) { @@ -328,7 +337,7 @@ verify(char *name, int maxlen) size = 0; while (*name != '\0' && size < maxlen - 1) { - if (!isascii(*name) || !isalnum(*name) || ispunct(*name)) + if (!isascii(*name) || !(isalnum(*name) || ispunct(*name))) return (0); name++; size++;