PERFORCE change 23047 for review
Brian Feldman
green at freebsd.org
Thu Jan 2 18:16:48 GMT 2003
http://perforce.freebsd.org/chv.cgi?CH=23047
Change 23047 by green at 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 at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list