svn commit: r367831 - in vendor/openpam/dist: . lib/libpam

Dag-Erling Smørgrav des at FreeBSD.org
Thu Nov 19 05:44:42 UTC 2020


Author: des
Date: Thu Nov 19 05:44:41 2020
New Revision: 367831
URL: https://svnweb.freebsd.org/changeset/base/367831

Log:
  Merge upstream r948: fix race condition in openpam_ttyconv(3).

Modified:
  vendor/openpam/dist/CREDITS
  vendor/openpam/dist/lib/libpam/openpam_ttyconv.c

Modified: vendor/openpam/dist/CREDITS
==============================================================================
--- vendor/openpam/dist/CREDITS	Thu Nov 19 04:28:39 2020	(r367830)
+++ vendor/openpam/dist/CREDITS	Thu Nov 19 05:44:41 2020	(r367831)
@@ -18,6 +18,7 @@ ideas:
 	Ankita Pal <pal.ankita.ankita at gmail.com>
 	Baptiste Daroussin <bapt at freebsd.org>
 	Brian Fundakowski Feldman <green at freebsd.org>
+	Brooks Davis <brooks at freebsd.org>
 	Christos Zoulas <christos at netbsd.org>
 	Daniel Richard G. <skunk at iskunk.org>
 	Darren J. Moffat <darren.moffat at sun.com>

Modified: vendor/openpam/dist/lib/libpam/openpam_ttyconv.c
==============================================================================
--- vendor/openpam/dist/lib/libpam/openpam_ttyconv.c	Thu Nov 19 04:28:39 2020	(r367830)
+++ vendor/openpam/dist/lib/libpam/openpam_ttyconv.c	Thu Nov 19 05:44:41 2020	(r367831)
@@ -94,12 +94,6 @@ prompt_tty(int ifd, int ofd, const char *message, char
 	int pos, ret;
 	char ch;
 
-	/* write prompt */
-	if (write(ofd, message, strlen(message)) < 0) {
-		openpam_log(PAM_LOG_ERROR, "write(): %m");
-		return (-1);
-	}
-
 	/* turn echo off if requested */
 	slflag = 0; /* prevent bogus uninitialized variable warning */
 	if (!echo) {
@@ -113,6 +107,12 @@ prompt_tty(int ifd, int ofd, const char *message, char
 			openpam_log(PAM_LOG_ERROR, "tcsetattr(): %m");
 			return (-1);
 		}
+	}
+
+	/* write prompt */
+	if (write(ofd, message, strlen(message)) < 0) {
+		openpam_log(PAM_LOG_ERROR, "write(): %m");
+		return (-1);
 	}
 
 	/* install signal handlers */


More information about the svn-src-all mailing list