aboutsummaryrefslogtreecommitdiff
path: root/libpam_misc/misc_conv.c
Commit message (Collapse)AuthorAgeFilesLines
* Include pam_i18n.h where i18n definitions are requiredDmitry V. Levin2024-08-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Do not include <libintl.h> and other i18n stuff via config.h which is included into every compilation unit, include "pam_i18n.h" explicitly where necessary. * configure.ac (AH_BOTTOM): Remove. * libpam/pam_get_authtok.c: Include "pam_i18n.h". * libpam/pam_item.c: Likewise. * libpam/pam_strerror.c: Likewise. * libpam_misc/misc_conv.c: Likewise. * modules/pam_exec/pam_exec.c: Likewise. * modules/pam_faillock/main.c: Likewise. * modules/pam_faillock/pam_faillock.c: Likewise. * modules/pam_lastlog/pam_lastlog.c: Likewise. * modules/pam_limits/pam_limits.c: Likewise. * modules/pam_mail/pam_mail.c: Likewise. * modules/pam_mkhomedir/pam_mkhomedir.c: Likewise. * modules/pam_pwhistory/pam_pwhistory.c: Likewise. * modules/pam_selinux/pam_selinux.c: Likewise. * modules/pam_selinux/pam_selinux_check.c: Likewise. * modules/pam_timestamp/pam_timestamp.c: Likewise. * modules/pam_unix/pam_unix_acct.c: Likewise. * modules/pam_unix/pam_unix_passwd.c: Likewise. * modules/pam_userdb/pam_userdb.c: Likewise.
* libpam_misc: Use ECHOCTL in the terminal inputStanislav Brabec2024-08-071-2/+3
| | | | | | | | | | Use the canonical terminal mode (line mode) and set ECHOCTL to prevent cursor escape from the login prompt using arrows or escape sequences. ICANON is the default in most cases anyway. ECHOCTL is default on tty, but for example not on pty, allowing cursor to escape. Stanislav Brabec <sbrabec@suse.com>
* treewide: fix typos in comments and documentationTobias Stoeckmann2023-12-181-2/+2
| | | | Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* libpam_misc: use sig_atomic_t instead of intTobias Stoeckmann2023-12-051-1/+1
| | | | | | | Technically it's identical on pretty much all available systems, but let's follow C specifications. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* treewide: do not cast calloc/malloc/reallocTobias Stoeckmann2023-11-121-2/+1
| | | | | | | It is not required to cast the results of calloc, malloc, realloc, etc. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* libpam_misc: make use of secure memory erasureChristian Göttsche2023-02-281-4/+5
|
* pam_misc: make length of misc_conv() configurableJeff Squyres2021-06-141-1/+1
| | | | | | | | Add --with-misc-conv-bufsize=<number> option to configure to allow a longer buffer size for libpam_misc's misc_conv() function (it still defaults to 512 bytes). Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
* misc_conv: Flush the terminal input after the password is readTomas Mraz2021-04-121-2/+2
| | | | | | | Fixes #347 * libpam_misc/misc_conv.c (read_string): Use TCSAFLUSH instead of TCSADRAIN when resetting the terminal echo state
* misc_conv: fix potential information leak on error pathDmitry V. Levin2020-07-021-1/+3
| | | | | * libpam_misc/misc_conv.c (read_string): Clear the stack buffer from data read earlier from stdin in case of a read error.
* misc_conv: fix potential stack buffer overflowikerexxe2020-07-011-1/+1
| | | | | | | | [ldv: rewrote commit message] * libpam_misc/misc_conv.c (read_string): Use _pam_overwrite_n instead of _pam_overwrite to clear stack buffer "line" because the latter does not have to be null-terminated.
* misc_conv: remove redundant checkDmitry V. Levin2020-06-301-1/+1
| | | | | * libpam_misc/misc_conv.c (read_string): Remove redundant nc > 0 check as it has already been tested in the previous condition.
* Fix various typos found using codespell toolDmitry V. Levin2020-03-281-1/+1
|
* misc_conv: Use PAM_MAX_RESP_SIZE to limit the length of the inputTomas Mraz2020-02-241-1/+1
|
* libpam_misc: fix an inconsistency in handling memory allocation errorsDmitry V. Levin2014-01-221-1/+5
| | | | | | | | | | | | When misc_conv fails to allocate memory for pam_response array, it returns PAM_CONV_ERR. However, when read_string fails to allocate memory for a response string, it loses the response string and silently ignores the error, with net result as if EOF has been read. * libpam_misc/misc_conv.c (read_string): Use strdup instead of x_strdup, the latter is of no benefit in this case. Do not ignore potential memory allocation errors returned by strdup, forward them to misc_conv.
* Fix whitespace issuesDmitry V. Levin2011-10-261-1/+1
| | | | | | Cleanup trailing whitespaces, indentation that uses spaces before tabs, and blank lines at EOF. Make the project free of warnings reported by git diff --check 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD
* Relevant BUGIDs: Debian bug #1708Steve Langasek2007-09-031-2/+1
| | | | | | | | | | | | | Purpose of commit: cleanup (behavior change) Commit summary: --------------- 2007-09-03 Steve Langasek <vorlon@debian.org> * libpam_misc/misc_conv.c: don't block SIGINT in misc_conv; it's perfectly valid to allow the user to interrupt at a prompt. If an application wants prompts to not be interruptable, the application should take responsibility for blocking SIGINT.
* Relevant BUGIDs:Thorsten Kukuk2006-01-131-4/+4
| | | | | | | | | | | | | | | | | Purpose of commit: bugfix Commit summary: --------------- 2006-01-13 Thorsten Kukuk <kukuk@thkukuk.de> * libpam_misc/misc_conv.c (misc_conv): Fix strict aliasing error. * modules/pam_umask/pam_umask.c (search_key): Don't ignore EOF/error return value from fgets(). * configure.in: Check for getline and getdelim
* Relevant BUGIDs: noneDmitry V. Levin2005-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Purpose of commit: cleanup Commit summary: --------------- 2005-11-24 Dmitry V. Levin <ldv@altlinux.org> * configure.in: Do not check for strerror. * libpam_misc/misc_conv.c (read_string): Replace strerror() call with %m specifier. * libpamc/pamc_converse.c (pamc_converse): Likewise. * modules/pam_echo/pam_echo.c (pam_echo): Likewise. * modules/pam_localuser/pam_localuser.c (pam_sm_authenticate): Likewise. * modules/pam_selinux/pam_selinux.c (security_label_tty): Likewise. (security_restorelabel_tty, security_label_tty): Append %m specifier where appropriate. * modules/pam_selinux/pam_selinux_check.c (main): Replace strerror() call with %m specifier. * modules/pam_unix/pam_unix_passwd.c (save_old_password, _update_passwd, _update_shadow): Likewise. * modules/pam_unix/support.c (_unix_run_helper_binary): Likewise. * modules/pam_unix/unix_chkpwd.c (_update_shadow): Likewise. * po/Linux-PAM.pot: Update strings from pam_selinux. * po/cs.po: Likewise. * po/de.po: Likewise. * po/es.po: Likewise. * po/fi.po: Likewise. * po/fr.po: Likewise. * po/hu.po: Likewise. * po/it.po: Likewise. * po/ja.po: Likewise. * po/nb.po: Likewise. * po/pa.po: Likewise. * po/pl.po: Likewise. * po/pt.po: Likewise. * po/pt_BR.po: Likewise. * po/zh_CN.po: Likewise. * po/zh_TW.po: Likewise.
* Relevant BUGIDs: 562730, 435990Tomas Mraz2005-11-091-1/+12
| | | | | | | | | | | | | | | | | | Purpose of commit: bugfix Commit summary: --------------- * modules/pam_access/pam_access.c (pam_sm_acct_mgmt): Parse correctly full path tty name. * modules/pam_time/pam_time.c (pam_sm_acct_mgmt): Parse correctly full path tty name. Allow unset tty. (logic_member): Allow matching ':' in tty name. * modules/pam_group/pam_group.c (pam_sm_acct_mgmt): Parse correctly full path tty name. Allow unset tty. (logic_member): Allow matching ':' in tty name. * libpam_misc/misc_conv.c (read_string): Read only up to EOL if stdin is not terminal.
* Relevant BUGIDs: noneThorsten Kukuk2005-09-141-2/+2
| | | | | | | | | | | | | Purpose of commit: bugfix Commit summary: --------------- pam_vsyslog: Restore errno after each asprintf. misc_conv.c: don't use special control characters, non-ascii terminal can run into problems with them. de.po: Translate some more strings. *.po: Adjust translations for misc_conv.c.
* Relevant BUGIDs: noneThorsten Kukuk2005-08-161-2/+2
| | | | | | | | | Purpose of commit: new feature Commit summary: --------------- Big "automake/autoconf/libtool" commit
* Relevant BUGIDs: noneThorsten Kukuk2005-07-201-9/+8
| | | | | | | | | Purpose of commit: new feature Commit summary: --------------- Mark message strings for translation
* Relevant BUGIDs: noneThorsten Kukuk2005-07-201-1/+1
| | | | | | | | | Purpose of commit: cleanup Commit summary: --------------- Rename _pam_aconf.h to config.h.
* Relevant BUGIDs: Red Hat bz #150537Tomas Mraz2005-04-081-2/+2
| | | | | | | | | Purpose of commit: bugfix Commit summary: --------------- misc_conv: flush input first then print the prompt - fixes problem with expect scripts
* Relevant BUGIDs:Thorsten Kukuk2004-09-221-17/+23
| | | | | | | | | Purpose of commit: Commit summary: --------------- bugfix 1032604: differentiate between Ctrl-D and Return
* Relevant BUGIDs: 463984Andrew G. Morgan2001-10-111-4/+18
| | | | | | | | | | | | | | Purpose of commit: bugfix Commit summary: --------------- The last fix to the conversation function was less than marginal: it didn't actually work! This second commit adds the all important 'return the user's input' bit! Also added some more D() stuff to pam_misc to help locate the problem and finally cleaned up the Makefile in the examples/ directory. I used xsh to do the testing.
* Relevant BUGIDs: 449203Andrew G. Morgan2001-09-191-8/+39
| | | | | | | | | Purpose of commit: new support Commit summary: --------------- Include some BSD changes (to the conversation function) and fix a few gcc warnings.
* Relevant BUGIDs: 108786Andrew G. Morgan2001-01-201-38/+32
| | | | | | | | | Purpose of commit: cleanup Commit summary: --------------- This brings the binary prompt hooks in libpam_misc's conversation function into line with the current libpamc library.
* Relevant BUGIDs: task 15788, bugs 108297, 117476, 117474Andrew G. Morgan2000-11-191-4/+1
| | | | | | | | | | | | | | Purpose of commit: autoconf support for Linux-PAM Commit summary: --------------- This is a merge of the autoconf support that was developed against a 0-72 branch. [Note, because CVS has some issues, this is actually only 95% of the actual commit. The other files were actually committed when the preparation branch Linux-PAM-0-73pre-autoconf was updated. Hopefully, this will complete the merge.]
* Initial revisionAndrew G. Morgan2000-06-201-0/+344