Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jan 2003 10:16:48 -0800 (PST)
From:      Brian Feldman <green@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 23047 for review
Message-ID:  <200301021816.h02IGmIV065241@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/types.h>
@@ -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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301021816.h02IGmIV065241>