From owner-p4-projects Thu Jan 2 10:16:52 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3FB1437B405; Thu, 2 Jan 2003 10:16:50 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBC4637B401 for ; Thu, 2 Jan 2003 10:16:49 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AF9743EC5 for ; Thu, 2 Jan 2003 10:16:49 -0800 (PST) (envelope-from green@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h02IGnfh065244 for ; Thu, 2 Jan 2003 10:16:49 -0800 (PST) (envelope-from green@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h02IGmIV065241 for perforce@freebsd.org; Thu, 2 Jan 2003 10:16:48 -0800 (PST) Date: Thu, 2 Jan 2003 10:16:48 -0800 (PST) Message-Id: <200301021816.h02IGmIV065241@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to green@freebsd.org using -f From: Brian Feldman Subject: PERFORCE change 23047 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=23047 Change 23047 by green@green_laptop_2 on 2003/01/02 10:15:51 * You won't be able to tell a single "enter" from an EOF from pam_prompt(3) without an error return value, so fix the openpam_ttyconv(3) function so that it returns error on EOF. Affected files ... .. //depot/projects/trustedbsd/mac/contrib/openpam/lib/openpam_ttyconv.c#10 edit .. //depot/projects/trustedbsd/mac/lib/libsebsd/query_user_context.c#3 edit Differences ... ==== //depot/projects/trustedbsd/mac/contrib/openpam/lib/openpam_ttyconv.c#10 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/mac/contrib/openpam/lib/openpam_ttyconv.c#9 $ + * $P4: //depot/projects/trustedbsd/mac/contrib/openpam/lib/openpam_ttyconv.c#10 $ */ #include @@ -89,7 +89,7 @@ sigaction(SIGALRM, &saved_action, NULL); sigprocmask(SIG_SETMASK, &saved_sigset, NULL); alarm(saved_alarm); - if (timed_out || ferror(stdin)) + if (timed_out || ferror(stdin) || feof(stdin)) return (NULL); /* trim trailing whitespace */ for (len = strlen(buf); len > 0; --len) ==== //depot/projects/trustedbsd/mac/lib/libsebsd/query_user_context.c#3 (text+ko) ==== @@ -62,11 +62,7 @@ "Enter number of choice: ")) return (-1); if (response == NULL) - continue; - if (response[0] == '\0') { /* EOF */ - free(response); return (-1); - } if (sscanf(response, "%d", &number_response) != 1 || number_response < 1 || number_response > length) { (void)pam_prompt(pamh, PAM_TEXT_INFO, &discard, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message