aboutsummaryrefslogtreecommitdiff
path: root/libpam/pam_delay.c
Commit message (Collapse)AuthorAgeFilesLines
* libpam: fix typo in commentTobias Stoeckmann2024-01-161-1/+1
| | | | Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* libpam: use getrandom if possibleTobias Stoeckmann2024-01-051-1/+14
| | | | | | | | Use getrandom to retrieve random numbers for delay calculation. If it fails or is not available, keep using current algorithm. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* libpam: handle long delays properlyTobias Stoeckmann2024-01-051-7/+13
| | | | | | | | | | | | | | | | | | | | If a delay close to UINT_MAX has been set, then the delay computation might overflow the value due to added randomness. Systems where linux-pam is in use should generally have a 32 bit unsigned int and a 64 bit unsigned long long, and a time_t of either 64 bit or 32 bit. Under these assumptions, using the result for delay is safe because of the division before assigning it to tv_sec (time_t). Thought about using uint64_t type here but as long as "unsigned int" is part of the API instead of uint32_t, no proper guarantees could be made anyway. Unfortunately we have to supply an unsigned int if a PAM_FAIL_DELAY function has been set. In such a case, supply a UINT_MAX if delay is larger than that. It's the best we can do without breaking the API. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* treewide: fix typos in comments and documentationTobias Stoeckmann2023-12-181-1/+1
| | | | Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* libpam: simplify IF_NO_PAMHTobias Stoeckmann2023-11-121-1/+1
| | | | | | | | | | | | | The first argument of IF_NO_PAMH is supposed to be the name of the function which was called with pamh being NULL. With __FUNCTION__ the name can be inserted automatically by the compiler which is also already done with D macro. Fixes a bug in which _pam_drop_env erroneously logs with the function name _pam_make_env. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* Fix various typos found using codespell toolDmitry V. Levin2020-03-281-2/+2
|
* Update a function commentlifecrisis2019-09-061-3/+5
| | | | | | | The function comment for "_pam_await_timer()" does not mention the intended behavior of prioritizing the "PAM_FAIL_DELAY" item. I updated the comment to make this intention clear.
* Adjust documentation (Ticket#36)Thorsten Kukuk2015-03-241-1/+1
| | | | | * libpam/pam_delay.c: Change 25% in comment to 50% as used in code. * doc/man/pam_fail_delay.3.xml: Change 25% to 50%
* Fix whitespace issuesDmitry V. Levin2011-10-261-1/+0
| | | | | | 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: 770645Steve Langasek2003-07-131-1/+1
| | | | | | | | | | | | | Purpose of commit: cleanup Commit summary: --------------- Fix the many compile-time warnings caused by features.h being included before our _pam_aconf.h. This should make it much easier to find other bugs. Also, call config.status instead of configure, to allow rebuilding generated files with the same options.
* Relevant BUGIDs: 485454Andrew G. Morgan2001-11-261-0/+1
| | | | | | | | | | Purpose of commit: revive feature Commit summary: --------------- malloc et al. debugging was not supported by the new autoconf setup, this commit rectifies that. It also adds a couple of header file inclusions that seem to be needed with recent glibc headers.
* Relevant BUGIDs: 449203Andrew G. Morgan2001-09-191-1/+1
| | | | | | | | | Purpose of commit: new support Commit summary: --------------- Include some BSD changes (to the conversation function) and fix a few gcc warnings.
* Relevant BUGIDs: 129027, 128576Andrew G. Morgan2001-01-221-1/+1
| | | | | | | | | | Purpose of commit: new feature + documentation Commit summary: --------------- Cleaned up the handling of AUTHTOK items and pam_[gs]et_data() functions. Added more clear documentation about the pam_[gs]et_item() functions to the pam_appl and pam_modules programmer guides.
* Relevant BUGIDs: 124391Jan Rekorajski2000-12-041-10/+0
| | | | | | | | Purpose of commit: cleanup Commit summary: --------------- * removed unnecessary CVS Log tags from all over the source
* Initial revisionAndrew G. Morgan2000-06-201-0/+168