diff options
author | Sam Hartman <hartmans@debian.org> | 2024-12-02 09:55:34 -0700 |
---|---|---|
committer | Sam Hartman <hartmans@debian.org> | 2024-12-02 09:55:34 -0700 |
commit | 4f3cfaf827bfa42a239c255092a128a3a02198bf (patch) | |
tree | eac7f023f043739b79b2a51bd68c3006acb12964 /libpam_misc/misc_conv.c | |
parent | 6408d4b1baff9a7e58fd66e1d1c0871be0823777 (diff) | |
parent | 7c9fb6472dcfae34ddbf4fbc9ecfafae2cf173c3 (diff) | |
download | pam-4f3cfaf827bfa42a239c255092a128a3a02198bf.tar.gz pam-4f3cfaf827bfa42a239c255092a128a3a02198bf.tar.bz2 pam-4f3cfaf827bfa42a239c255092a128a3a02198bf.zip |
Update upstream source from tag 'upstream/1.7.0'
Update to upstream version '1.7.0'
with Debian dir 0b3cd490884352e14273caeca2f05c6a525499fa
Diffstat (limited to 'libpam_misc/misc_conv.c')
-rw-r--r-- | libpam_misc/misc_conv.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c index dbcd6aec..fa3848e3 100644 --- a/libpam_misc/misc_conv.c +++ b/libpam_misc/misc_conv.c @@ -17,7 +17,9 @@ #include <security/pam_appl.h> #include <security/pam_misc.h> + #include "pam_inline.h" +#include "pam_i18n.h" #define INPUTSIZE PAM_MISC_CONV_BUFSIZE /* maximum length of input+1 */ #define CONV_ECHO_ON 1 /* types of echo state */ @@ -56,7 +58,7 @@ void (*pam_binary_handler_free)(void *appdata, pamc_bp_t *prompt_p) /* the following code is used to get text input */ -static volatile int expired=0; +static volatile sig_atomic_t expired=0; /* return to the previous signal handling */ static void reset_alarm(struct sigaction *o_ptr) @@ -97,7 +99,7 @@ static int get_delay(void) expired = 0; /* reset flag */ (void) time(&now); - /* has the quit time past? */ + /* has the quit time passed? */ if (pam_misc_conv_die_time && now >= pam_misc_conv_die_time) { fprintf(stderr,"%s",pam_misc_conv_die_line); @@ -105,7 +107,7 @@ static int get_delay(void) return -1; /* time is up */ } - /* has the warning time past? */ + /* has the warning time passed? */ if (pam_misc_conv_warn_time && now >= pam_misc_conv_warn_time) { fprintf(stderr, "%s", pam_misc_conv_warn_line); pam_misc_conv_warn_time = 0; /* reset warn_time */ @@ -145,9 +147,10 @@ static int read_string(int echo, const char *prompt, char **retstr) return -1; } memcpy(&term_tmp, &term_before, sizeof(term_tmp)); - if (!echo) { + if (echo) + term_tmp.c_lflag |= ICANON | ECHOCTL; + else term_tmp.c_lflag &= ~(ECHO); - } have_term = 1; /* @@ -285,8 +288,7 @@ int misc_conv(int num_msg, const struct pam_message **msgm, D(("allocating empty response structure array.")); - reply = (struct pam_response *) calloc(num_msg, - sizeof(struct pam_response)); + reply = calloc(num_msg, sizeof(struct pam_response)); if (reply == NULL) { D(("no memory for responses")); return PAM_CONV_ERR; |