From a38a8eae25ee1d7adb5a5eafcf1c41e94974ed90 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Tue, 6 Nov 2007 14:46:57 +0000 Subject: Relevant BUGIDs: 1822779 Purpose of commit: bugfix Commit summary: --------------- 2007-11-06 Thorsten Kukuk * libpam/pam_static_modules.h: Fix name of pam_namespace variable. 2007-10-30 Peter Breitenlohner * tests/tst-dlopen.c: Return 77 in case of static modules, such that all modules/pam_*/tst-pam_* tests yield SKIP instead of FAIL. * libpam/Makefile.am (libpam_la_LIBADD): Use "$(shell ls ...)" instead of "`ls ...`", to allow for static modules. * libpam/pam_static_modules.h: Make pam_keyinit module depend on HAVE_KEY_MANAGEMENT; correct name of pam_faildelay pam_module struct. * modules/pam_faildelay/pam_faildelay.c: Correct name of pam_module struct. --- ChangeLog | 15 +++ doc/man/pam.conf.5 | 152 +++++++++++++------------ libpam/Makefile.am | 2 +- libpam/pam_static_modules.h | 10 +- modules/pam_faildelay/pam_faildelay.c | 2 +- modules/pam_tally/README | 6 +- modules/pam_tally/pam_tally.8 | 205 ++++++++++++++++++++-------------- tests/tst-dlopen.c | 4 + 8 files changed, 230 insertions(+), 166 deletions(-) diff --git a/ChangeLog b/ChangeLog index 782fd160..446b1f33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2007-11-06 Thorsten Kukuk + + * libpam/pam_static_modules.h: Fix name of pam_namespace variable. + +2007-10-30 Peter Breitenlohner + + * tests/tst-dlopen.c: Return 77 in case of static modules, such that + all modules/pam_*/tst-pam_* tests yield SKIP instead of FAIL. + * libpam/Makefile.am (libpam_la_LIBADD): Use "$(shell ls ...)" instead + of "`ls ...`", to allow for static modules. + * libpam/pam_static_modules.h: Make pam_keyinit module depend on + HAVE_KEY_MANAGEMENT; correct name of pam_faildelay pam_module struct. + * modules/pam_faildelay/pam_faildelay.c: Correct name of pam_module + struct. + 2007-10-25 Steve Langasek * modules/pam_tally/pam_tally.c: fix the definition of OPT_AUDIT diff --git a/doc/man/pam.conf.5 b/doc/man/pam.conf.5 index 850a8fa1..11fd86e7 100644 --- a/doc/man/pam.conf.5 +++ b/doc/man/pam.conf.5 @@ -1,34 +1,34 @@ .\" Title: pam.conf .\" Author: -.\" Generator: DocBook XSL Stylesheets v1.71.1 -.\" Date: 01/16/2007 -.\" Manual: Linux\-PAM Manual -.\" Source: Linux\-PAM Manual +.\" Generator: DocBook XSL Stylesheets v1.73.1 +.\" Date: 11/06/2007 +.\" Manual: Linux-PAM Manual +.\" Source: Linux-PAM Manual .\" -.TH "PAM.CONF" "5" "01/16/2007" "Linux\-PAM Manual" "Linux\-PAM Manual" +.TH "PAM\.CONF" "5" "11/06/2007" "Linux-PAM Manual" "Linux-PAM Manual" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" -pam.conf, pam.d \- PAM configuration files +pam.conf, pam.d - PAM configuration files .SH "DESCRIPTION" .PP When a \fIPAM\fR -aware privilege granting application is started, it activates its attachment to the PAM\-API. This activation performs a number of tasks, the most important being the reading of the configuration file(s): -\fI/etc/pam.conf\fR. Alternatively, this may be the contents of the -\fI/etc/pam.d/\fR -directory. The presence of this directory will cause Linux\-PAM to ignore -\fI/etc/pam.conf\fR. +aware privilege granting application is started, it activates its attachment to the PAM\-API\. This activation performs a number of tasks, the most important being the reading of the configuration file(s): +\fI/etc/pam\.conf\fR\. Alternatively, this may be the contents of the +\fI/etc/pam\.d/\fR +directory\. The presence of this directory will cause Linux\-PAM to ignore +\fI/etc/pam\.conf\fR\. .PP These files list the \fIPAM\fRs that will do the authentication tasks required by this service, and the appropriate behavior of the PAM\-API in the event that individual -\fIPAM\fRs fail. +\fIPAM\fRs fail\. .PP The syntax of the -\fI/etc/pam.conf\fR -configuration file is as follows. The file is made up of a list of rules, each rule is typically placed on a single line, but may be extended with an escaped end of line: `\\'. Comments are preceded with `#' marks and extend to the next end of line. +\fI/etc/pam\.conf\fR +configuration file is as follows\. The file is made up of a list of rules, each rule is typically placed on a single line, but may be extended with an escaped end of line: `\e\'\. Comments are preceded with `#\' marks and extend to the next end of line\. .PP The format of each rule is a space separated collection of tokens, the first three being case\-insensitive: .PP @@ -36,19 +36,19 @@ The format of each rule is a space separated collection of tokens, the first thr \fB service type control module\-path module\-arguments\fR .PP The syntax of files contained in the -\fI/etc/pam.d/\fR +\fI/etc/pam\.d/\fR directory, are identical except for the absence of any \fIservice\fR -field. In this case, the +field\. In this case, the \fIservice\fR is the name of the file in the -\fI/etc/pam.d/\fR -directory. This filename must be in lower case. +\fI/etc/pam\.d/\fR +directory\. This filename must be in lower case\. .PP An important feature of \fIPAM\fR, is that a number of rules may be \fIstacked\fR -to combine the services of a number of PAMs for a given authentication task. +to combine the services of a number of PAMs for a given authentication task\. .PP The \fIservice\fR @@ -56,42 +56,42 @@ is typically the familiar name of the corresponding application: \fIlogin\fR and \fIsu\fR -are good examples. The +are good examples\. The \fIservice\fR\-name, \fIother\fR, is reserved for giving \fIdefault\fR -rules. Only lines that mention the current service (or in the absence of such, the +rules\. Only lines that mention the current service (or in the absence of such, the \fIother\fR -entries) will be associated with the given service\-application. +entries) will be associated with the given service\-application\. .PP The \fItype\fR -is the management group that the rule corresponds to. It is used to specify which of the management groups the subsequent module is to be associated with. Valid entries are: +is the management group that the rule corresponds to\. It is used to specify which of the management groups the subsequent module is to be associated with\. Valid entries are: .PP account .RS 4 -this module type performs non\-authentication based account management. It is typically used to restrict/permit access to a service based on the time of day, currently available system resources (maximum number of users) or perhaps the location of the applicant user \-\- 'root' login only on the console. +this module type performs non\-authentication based account management\. It is typically used to restrict/permit access to a service based on the time of day, currently available system resources (maximum number of users) or perhaps the location of the applicant user \-\- \'root\' login only on the console\. .RE .PP auth .RS 4 -this module type provides two aspects of authenticating the user. Firstly, it establishes that the user is who they claim to be, by instructing the application to prompt the user for a password or other means of identification. Secondly, the module can grant group membership or other privileges through its credential granting properties. +this module type provides two aspects of authenticating the user\. Firstly, it establishes that the user is who they claim to be, by instructing the application to prompt the user for a password or other means of identification\. Secondly, the module can grant group membership or other privileges through its credential granting properties\. .RE .PP password .RS 4 -this module type is required for updating the authentication token associated with the user. Typically, there is one module for each 'challenge/response' based authentication (auth) type. +this module type is required for updating the authentication token associated with the user\. Typically, there is one module for each \'challenge/response\' based authentication (auth) type\. .RE .PP session .RS 4 -this module type is associated with doing things that need to be done for the user before/after they can be given service. Such things include the logging of information concerning the opening/closing of some data exchange with a user, mounting directories, etc. +this module type is associated with doing things that need to be done for the user before/after they can be given service\. Such things include the logging of information concerning the opening/closing of some data exchange with a user, mounting directories, etc\. .RE .PP The third field, -\fIcontrol\fR, indicates the behavior of the PAM\-API should the module fail to succeed in its authentication task. There are two types of syntax for this control field: the simple one has a single simple keyword; the more complicated one involves a square\-bracketed selection of +\fIcontrol\fR, indicates the behavior of the PAM\-API should the module fail to succeed in its authentication task\. There are two types of syntax for this control field: the simple one has a single simple keyword; the more complicated one involves a square\-bracketed selection of \fIvalue=action\fR -pairs. +pairs\. .PP For the simple (historical) syntax valid \fIcontrol\fR @@ -104,13 +104,13 @@ failure of such a PAM will ultimately lead to the PAM\-API returning failure but modules (for this \fIservice\fR and -\fItype\fR) have been invoked. +\fItype\fR) have been invoked\. .RE .PP requisite .RS 4 like -\fIrequired\fR, however, in the case that such a module returns a failure, control is directly returned to the application. The return value is that associated with the first required or requisite module to fail. Note, this flag can be used to protect against the possibility of a user getting the opportunity to enter a password over an unsafe medium. It is conceivable that such behavior might inform an attacker of valid accounts on a system. This possibility should be weighed against the not insignificant concerns of exposing a sensitive password in a hostile environment. +\fIrequired\fR, however, in the case that such a module returns a failure, control is directly returned to the application\. The return value is that associated with the first required or requisite module to fail\. Note, this flag can be used to protect against the possibility of a user getting the opportunity to enter a password over an unsafe medium\. It is conceivable that such behavior might inform an attacker of valid accounts on a system\. This possibility should be weighed against the not insignificant concerns of exposing a sensitive password in a hostile environment\. .RE .PP sufficient @@ -118,18 +118,31 @@ sufficient success of such a module is enough to satisfy the authentication requirements of the stack of modules (if a prior \fIrequired\fR module has failed the success of this one is -\fIignored\fR). A failure of this module is not deemed as fatal to satisfying the application that this type has succeeded. If the module succeeds the PAM framework returns success to the application immediately without trying any other modules. +\fIignored\fR)\. A failure of this module is not deemed as fatal to satisfying the application that this type has succeeded\. If the module succeeds the PAM framework returns success to the application immediately without trying any other modules\. .RE .PP optional .RS 4 the success or failure of this module is only important if it is the only module in the stack associated with this -\fIservice\fR+\fItype\fR. +\fIservice\fR+\fItype\fR\. .RE .PP include .RS 4 -include all lines of given type from the configuration file specified as an argument to this control. +include all lines of given type from the configuration file specified as an argument to this control\. +.RE +.PP +substack +.RS 4 +include all lines of given type from the configuration file specified as an argument to this control\. This differs from +\fIinclude\fR +in that evaluation of the +\fIdone\fR +and +\fIdie\fR +actions in a substack does not cause skipping the rest of the complete module stack, but only of the substack\. Jumps in a substack also can not make evaluation jump out of it, and the whole substack is counted as one module when the jump is done in a parent stack\. The +\fIreset\fR +action will reset the state of a module stack to the state it was in as of beginning of the substack evaluation\. .RE .PP For the more complicated syntax valid @@ -138,14 +151,14 @@ values have the following form: .sp .RS 4 .nf - [value1=action1 value2=action2 ...] + [value1=action1 value2=action2 \.\.\.] .fi .RE .PP Where \fIvalueN\fR -corresponds to the return code from the function invoked in the module for which the line is defined. It is selected from one of these: +corresponds to the return code from the function invoked in the module for which the line is defined\. It is selected from one of these: \fIsuccess\fR, \fIopen_err\fR, \fIsymbol_err\fR, @@ -177,52 +190,51 @@ corresponds to the return code from the function invoked in the module for which \fImodule_unknown\fR, \fIbad_item\fR, \fIconv_again\fR, -\fIincomplete\fR, -and -\fIdefault\fR. +\fIincomplete\fR, and +\fIdefault\fR\. .PP The last of these, -\fIdefault\fR, implies 'all -\fIvalueN\fR's not mentioned explicitly. Note, the full list of PAM errors is available in -\fI/usr/include/security/_pam_types.h\fR. The +\fIdefault\fR, implies \'all +\fIvalueN\fR\'s not mentioned explicitly\. Note, the full list of PAM errors is available in +\fI/usr/include/security/_pam_types\.h\fR\. The \fIactionN\fR can be: an unsigned integer, -\fIn\fR, signifying an action of 'jump over the next +\fIn\fR, signifying an action of \'jump over the next \fIn\fR -modules in the stack', or take one of the following forms: +modules in the stack\'; or take one of the following forms: .PP ignore .RS 4 -when used with a stack of modules, the module's return status will not contribute to the return code the application obtains. +when used with a stack of modules, the module\'s return status will not contribute to the return code the application obtains\. .RE .PP bad .RS 4 -this action indicates that the return code should be thought of as indicative of the module failing. If this module is the first in the stack to fail, its status value will be used for that of the whole stack. +this action indicates that the return code should be thought of as indicative of the module failing\. If this module is the first in the stack to fail, its status value will be used for that of the whole stack\. .RE .PP die .RS 4 -equivalent to bad with the side effect of terminating the module stack and PAM immediately returning to the application. +equivalent to bad with the side effect of terminating the module stack and PAM immediately returning to the application\. .RE .PP ok .RS 4 -this tells PAM that the administrator thinks this return code should contribute directly to the return code of the full stack of modules. In other words, if the former state of the stack would lead to a return of -\fIPAM_SUCCESS\fR, the module's return code will override this value. Note, if the former state of the stack holds some value that is indicative of a modules failure, this 'ok' value will not be used to override that value. +this tells PAM that the administrator thinks this return code should contribute directly to the return code of the full stack of modules\. In other words, if the former state of the stack would lead to a return of +\fIPAM_SUCCESS\fR, the module\'s return code will override this value\. Note, if the former state of the stack holds some value that is indicative of a modules failure, this \'ok\' value will not be used to override that value\. .RE .PP done .RS 4 -equivalent to ok with the side effect of terminating the module stack and PAM immediately returning to the application. +equivalent to ok with the side effect of terminating the module stack and PAM immediately returning to the application\. .RE .PP reset .RS 4 -clear all memory of the state of the module stack and start again with the next stacked module. +clear all memory of the state of the module stack and start again with the next stacked module\. .RE .PP -Each of the four keywords: required; requisite; sufficient; and optional, have an equivalent expression in terms of the [...] syntax. They are as follows: +Each of the four keywords: required; requisite; sufficient; and optional, have an equivalent expression in terms of the [\.\.\.] syntax\. They are as follows: .PP required .RS 4 @@ -246,43 +258,43 @@ optional .PP \fImodule\-path\fR -is either the full filename of the PAM to be used by the application (it begins with a '/'), or a relative pathname from the default module location: +is either the full filename of the PAM to be used by the application (it begins with a \'/\'), or a relative pathname from the default module location: \fI/lib/security/\fR or -\fI/lib64/security/\fR, depending on the architecture. +\fI/lib64/security/\fR, depending on the architecture\. .PP \fImodule\-arguments\fR -are a space separated list of tokens that can be used to modify the specific behavior of the given PAM. Such arguments will be documented for each individual module. Note, if you wish to include spaces in an argument, you should surround that argument with square brackets. +are a space separated list of tokens that can be used to modify the specific behavior of the given PAM\. Such arguments will be documented for each individual module\. Note, if you wish to include spaces in an argument, you should surround that argument with square brackets\. .sp .RS 4 .nf - squid auth required pam_mysql.so user=passwd_query passwd=mada \\ - db=eminence [query=select user_name from internet_service \\ - where user_name='%u' and password=PASSWORD('%p') and \\ - service='web_proxy'] + squid auth required pam_mysql\.so user=passwd_query passwd=mada \e + db=eminence [query=select user_name from internet_service \e + where user_name=\'%u\' and password=PASSWORD(\'%p\') and \e + service=\'web_proxy\'] .fi .RE .PP -When using this convention, you can include `[' characters inside the string, and if you wish to include a `]' character inside the string that will survive the argument parsing, you should use `\\['. In other words: +When using this convention, you can include `[\' characters inside the string, and if you wish to include a `]\' character inside the string that will survive the argument parsing, you should use `\e]\'\. In other words: .sp .RS 4 .nf - [..[..\\]..] \-\-> ..[..].. + [\.\.[\.\.\e]\.\.] \-\-> \.\.[\.\.]\.\. .fi .RE .PP -Any line in (one of) the configuration file(s), that is not formatted correctly, will generally tend (erring on the side of caution) to make the authentication process fail. A corresponding error is written to the system log files with a call to -\fBsyslog\fR(3). +Any line in (one of) the configuration file(s), that is not formatted correctly, will generally tend (erring on the side of caution) to make the authentication process fail\. A corresponding error is written to the system log files with a call to +\fBsyslog\fR(3)\. .PP More flexible than the single configuration file is it to configure libpam via the contents of the -\fI/etc/pam.d/\fR -directory. In this case the directory is filled with files each of which has a filename equal to a service\-name (in lower\-case): it is the personal configuration file for the named service. +\fI/etc/pam\.d/\fR +directory\. In this case the directory is filled with files each of which has a filename equal to a service\-name (in lower\-case): it is the personal configuration file for the named service\. .PP -The syntax of each file in /etc/pam.d/ is similar to that of the -\fI/etc/pam.conf\fR +The syntax of each file in /etc/pam\.d/ is similar to that of the +\fI/etc/pam\.conf\fR file and is made up of lines of the following form: .sp .RS 4 @@ -292,11 +304,11 @@ type control module\-path module\-arguments .fi .RE .PP -The only difference being that the service\-name is not present. The service\-name is of course the name of the given configuration file. For example, -\fI/etc/pam.d/login\fR +The only difference being that the service\-name is not present\. The service\-name is of course the name of the given configuration file\. For example, +\fI/etc/pam\.d/login\fR contains the configuration for the \fBlogin\fR -service. +service\. .SH "SEE ALSO" .PP diff --git a/libpam/Makefile.am b/libpam/Makefile.am index a0955441..0c188fdc 100644 --- a/libpam/Makefile.am +++ b/libpam/Makefile.am @@ -24,7 +24,7 @@ libpam_la_LDFLAGS = -no-undefined -version-info 81:9:81 libpam_la_LIBADD = @LIBAUDIT@ $(LIBPRELUDE_LIBS) @LIBDL@ if STATIC_MODULES - libpam_la_LIBADD += `ls ../modules/pam_*/*.lo` \ + libpam_la_LIBADD += $(shell ls ../modules/pam_*/*.lo) \ @LIBDB@ @LIBCRYPT@ @LIBNSL@ @LIBCRACK@ -lutil endif if HAVE_VERSIONING diff --git a/libpam/pam_static_modules.h b/libpam/pam_static_modules.h index 27b70826..5445c5fe 100644 --- a/libpam/pam_static_modules.h +++ b/libpam/pam_static_modules.h @@ -45,7 +45,9 @@ extern struct pam_module _pam_filter_modstruct; extern struct pam_module _pam_ftp_modstruct; extern struct pam_module _pam_group_modstruct; extern struct pam_module _pam_issue_modstruct; +#ifdef HAVE_KEY_MANAGEMENT extern struct pam_module _pam_keyinit_modstruct; +#endif extern struct pam_module _pam_lastlog_modstruct; extern struct pam_module _pam_limits_modstruct; extern struct pam_module _pam_listfile_modstruct; @@ -55,7 +57,7 @@ extern struct pam_module _pam_mail_modstruct; extern struct pam_module _pam_mkhomedir_modstruct; extern struct pam_module _pam_motd_modstruct; #ifdef HAVE_UNSHARE -extern struct pam_module _pam_namespace; +extern struct pam_module _pam_namespace_modstruct; #endif extern struct pam_module _pam_nologin_modstruct; extern struct pam_module _pam_permit_modstruct; @@ -92,12 +94,14 @@ static struct pam_module *static_modules[] = { &_pam_echo_modstruct, &_pam_env_modstruct, &_pam_exec_modstruct, - &_pam_faildelay, + &_pam_faildelay_modstruct, &_pam_filter_modstruct, &_pam_ftp_modstruct, &_pam_group_modstruct, &_pam_issue_modstruct, +#ifdef HAVE_KEY_MANAGEMENT &_pam_keyinit_modstruct, +#endif &_pam_lastlog_modstruct, &_pam_limits_modstruct, &_pam_listfile_modstruct, @@ -107,7 +111,7 @@ static struct pam_module *static_modules[] = { &_pam_mkhomedir_modstruct, &_pam_motd_modstruct, #ifdef HAVE_UNSHARE - &_pam_namespace, + &_pam_namespace_modstruct, #endif &_pam_nologin_modstruct, &_pam_permit_modstruct, diff --git a/modules/pam_faildelay/pam_faildelay.c b/modules/pam_faildelay/pam_faildelay.c index 16cb7458..072b7dd3 100644 --- a/modules/pam_faildelay/pam_faildelay.c +++ b/modules/pam_faildelay/pam_faildelay.c @@ -216,7 +216,7 @@ int pam_sm_setcred(pam_handle_t *pamh UNUSED, int flags UNUSED, /* static module data */ -struct pam_module _pam_rootok_modstruct = { +struct pam_module _pam_faildelay_modstruct = { "pam_faildelay", pam_sm_authenticate, pam_sm_setcred, diff --git a/modules/pam_tally/README b/modules/pam_tally/README index cfd8a468..d3bf5354 100644 --- a/modules/pam_tally/README +++ b/modules/pam_tally/README @@ -39,7 +39,7 @@ GLOBAL OPTIONS audit - Will display the username typed if the user is not found. + Will log the user name into the system log if the user is not found. AUTH OPTIONS @@ -81,10 +81,6 @@ AUTH OPTIONS Root account can become unavailable. - even_deny_root_account - - Root account can become unavailable. - per_user If /var/log/faillog contains a non-zero .fail_max/.fail_locktime field diff --git a/modules/pam_tally/pam_tally.8 b/modules/pam_tally/pam_tally.8 index a4476b6b..69b95624 100644 --- a/modules/pam_tally/pam_tally.8 +++ b/modules/pam_tally/pam_tally.8 @@ -1,133 +1,158 @@ .\" Title: pam_tally .\" Author: -.\" Generator: DocBook XSL Stylesheets v1.70.1 -.\" Date: 06/18/2006 -.\" Manual: Linux\-PAM Manual -.\" Source: Linux\-PAM Manual +.\" Generator: DocBook XSL Stylesheets v1.73.1 +.\" Date: 10/12/2007 +.\" Manual: Linux-PAM Manual +.\" Source: Linux-PAM Manual .\" -.TH "PAM_TALLY" "8" "06/18/2006" "Linux\-PAM Manual" "Linux\-PAM Manual" +.TH "PAM_TALLY" "8" "10/12/2007" "Linux-PAM Manual" "Linux\-PAM Manual" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" -pam_tally \- The login counter (tallying) module +pam_tally - The login counter (tallying) module .SH "SYNOPSIS" .HP 13 -\fBpam_tally.so\fR [file=\fI/path/to/counter\fR] [onerr=[\fIfail\fR|\fIsucceed\fR]] [magic_root] [even_deny_root_account] [deny=\fIn\fR] [lock_time=\fIn\fR] [unlock_time=\fIn\fR] [per_user] [no_lock_time] [no_reset] [audit] +\fBpam_tally\.so\fR [file=\fI/path/to/counter\fR] [onerr=[\fIfail\fR|\fIsucceed\fR]] [magic_root] [even_deny_root_account] [deny=\fIn\fR] [lock_time=\fIn\fR] [unlock_time=\fIn\fR] [per_user] [no_lock_time] [no_reset] [audit] .HP 10 \fBpam_tally\fR [\-\-file\ \fI/path/to/counter\fR] [\-\-user\ \fIusername\fR] [\-\-reset[=\fIn\fR]] [\-\-quiet] .SH "DESCRIPTION" .PP -This module maintains a count of attempted accesses, can reset count on success, can deny access if too many attempts fail. +This module maintains a count of attempted accesses, can reset count on success, can deny access if too many attempts fail\. .PP pam_tally comes in two parts: -\fBpam_tally.so\fR +\fBpam_tally\.so\fR and -\fBpam_tally\fR. The former is the PAM module and the latter, a stand\-alone program. +\fBpam_tally\fR\. The former is the PAM module and the latter, a stand\-alone program\. \fBpam_tally\fR -is an (optional) application which can be used to interrogate and manipulate the counter file. It can display users' counts, set individual counts, or clear all counts. Setting artificially high counts may be useful for blocking users without changing their passwords. For example, one might find it useful to clear all counts every midnight from a cron job. The +is an (optional) application which can be used to interrogate and manipulate the counter file\. It can display users\' counts, set individual counts, or clear all counts\. Setting artificially high counts may be useful for blocking users without changing their passwords\. For example, one might find it useful to clear all counts every midnight from a cron job\. The \fBfaillog\fR(8) -command can be used instead of pam_tally to to maintain the counter file. +command can be used instead of pam_tally to to maintain the counter file\. .PP Normally, failed attempts to access \fIroot\fR will \fBnot\fR -cause the root account to become blocked, to prevent denial\-of\-service: if your users aren't given shell accounts and root may only login via +cause the root account to become blocked, to prevent denial\-of\-service: if your users aren\'t given shell accounts and root may only login via \fBsu\fR -or at the machine console (not telnet/rsh, etc), this is safe. +or at the machine console (not telnet/rsh, etc), this is safe\. .SH "OPTIONS" -.TP 3n +.PP GLOBAL OPTIONS +.RS 4 This can be used for \fIauth\fR and \fIaccount\fR -services. -.RS 3n -.TP 3n +services\. +.PP \fBonerr=[\fR\fB\fIfail\fR\fR\fB|\fR\fB\fIsucceed\fR\fR\fB]\fR +.RS 4 If something weird happens (like unable to open the file), return with \fBPAM_SUCESS\fR if \fBonerr=\fR\fB\fIsucceed\fR\fR -is given, else with the corresponding PAM error code. -.TP 3n +is given, else with the corresponding PAM error code\. +.RE +.PP \fBfile=\fR\fB\fI/path/to/counter\fR\fR -File where to keep counts. Default is -\fI/var/log/faillog\fR. -.TP 3n +.RS 4 +File where to keep counts\. Default is +\fI/var/log/faillog\fR\. +.RE +.PP \fBaudit\fR -Will display the username typed if the user is not found. +.RS 4 +Will log the user name into the system log if the user is not found\. +.RE .RE -.TP 3n +.PP AUTH OPTIONS -Authentication phase first checks if user should be denied access and if not it increments attempted login counter. Then on call to +.RS 4 +Authentication phase first checks if user should be denied access and if not it increments attempted login counter\. Then on call to \fBpam_setcred\fR(3) -it resets the attempts counter. -.RS 3n -.TP 3n +it resets the attempts counter\. +.PP \fBdeny=\fR\fB\fIn\fR\fR +.RS 4 Deny access if tally for this user exceeds -\fIn\fR. -.TP 3n +\fIn\fR\. +.RE +.PP \fBlock_time=\fR\fB\fIn\fR\fR +.RS 4 Always deny for \fIn\fR -seconds after failed attempt. -.TP 3n +seconds after failed attempt\. +.RE +.PP \fBunlock_time=\fR\fB\fIn\fR\fR +.RS 4 Allow access after \fIn\fR -seconds after failed attempt. If this option is used the user will be locked out for the specified amount of time after he exceeded his maximum allowed attempts. Otherwise the account is locked until the lock is removed by a manual intervention of the system administrator. -.TP 3n +seconds after failed attempt\. If this option is used the user will be locked out for the specified amount of time after he exceeded his maximum allowed attempts\. Otherwise the account is locked until the lock is removed by a manual intervention of the system administrator\. +.RE +.PP \fBmagic_root\fR -If the module is invoked by a user with uid=0 the counter is not incremented. The sys\-admin should use this for user launched services, like -\fBsu\fR, otherwise this argument should be omitted. -.TP 3n +.RS 4 +If the module is invoked by a user with uid=0 the counter is not incremented\. The sys\-admin should use this for user launched services, like +\fBsu\fR, otherwise this argument should be omitted\. +.RE +.PP \fBno_lock_time\fR -Do not use the .fail_locktime field in +.RS 4 +Do not use the \.fail_locktime field in \fI/var/log/faillog\fR -for this user. -.TP 3n +for this user\. +.RE +.PP \fBno_reset\fR -Don't reset count on successful entry, only decrement. -.TP 3n -\fBeven_deny_root_account\fR -Root account can become unavailable. -.TP 3n +.RS 4 +Don\'t reset count on successful entry, only decrement\. +.RE +.PP \fBeven_deny_root_account\fR -Root account can become unavailable. -.TP 3n +.RS 4 +Root account can become unavailable\. +.RE +.PP \fBper_user\fR +.RS 4 If \fI/var/log/faillog\fR -contains a non\-zero .fail_max/.fail_locktime field for this user then use it instead of +contains a non\-zero \.fail_max/\.fail_locktime field for this user then use it instead of \fBdeny=\fR\fB\fIn\fR\fR/ \fBlock_time=\fR\fB\fIn\fR\fR -parameter. -.TP 3n +parameter\. +.RE +.PP \fBno_lock_time\fR -Don't use .fail_locktime filed in +.RS 4 +Don\'t use \.fail_locktime filed in \fI/var/log/faillog\fR -for this user. +for this user\. +.RE .RE -.TP 3n +.PP ACCOUNT OPTIONS +.RS 4 Account phase resets attempts counter if the user is \fBnot\fR -magic root. This phase can be used optionaly for services which don't call +magic root\. This phase can be used optionaly for services which don\'t call \fBpam_setcred\fR(3) -correctly or if the reset should be done regardless of the failure of the account phase of other modules. -.RS 3n -.TP 3n +correctly or if the reset should be done regardless of the failure of the account phase of other modules\. +.PP \fBmagic_root\fR -If the module is invoked by a user with uid=0 the counter is not incremented. The sys\-admin should use this for user launched services, like -\fBsu\fR, otherwise this argument should be omitted. -.TP 3n +.RS 4 +If the module is invoked by a user with uid=0 the counter is not incremented\. The sys\-admin should use this for user launched services, like +\fBsu\fR, otherwise this argument should be omitted\. +.RE +.PP \fBno_reset\fR -Don't reset count on successful entry, only decrement. +.RS 4 +Don\'t reset count on successful entry, only decrement\. +.RE .RE .SH "MODULE SERVICES PROVIDED" .PP @@ -135,47 +160,55 @@ The \fBauth\fR and \fBaccount\fR -services are supported. +services are supported\. .SH "RETURN VALUES" -.TP 3n +.PP PAM_AUTH_ERR -A invalid option was given, the module was not able to retrive the user name, no valid counter file was found, or too many failed logins. -.TP 3n +.RS 4 +A invalid option was given, the module was not able to retrive the user name, no valid counter file was found, or too many failed logins\. +.RE +.PP PAM_SUCCESS -Everything was successfull. -.TP 3n +.RS 4 +Everything was successfull\. +.RE +.PP PAM_USER_UNKNOWN -User not known. +.RS 4 +User not known\. +.RE .SH "EXAMPLES" .PP Add the following line to -\fI/etc/pam.d/login\fR -to lock the account after too many failed logins. The number of allowed fails is specified by +\fI/etc/pam\.d/login\fR +to lock the account after too many failed logins\. The number of allowed fails is specified by \fI/var/log/faillog\fR and needs to be set with pam_tally or \fBfaillog\fR(8) -before. +before\. .sp -.RS 3n +.RS 4 .nf -auth required pam_securetty.so -auth required pam_tally.so per_user -auth required pam_env.so -auth required pam_unix.so -auth required pam_nologin.so -account required pam_unix.so -password required pam_unix.so -session required pam_limits.so -session required pam_unix.so -session required pam_lastlog.so nowtmp -session optional pam_mail.so standard +auth required pam_securetty\.so +auth required pam_tally\.so per_user +auth required pam_env\.so +auth required pam_unix\.so +auth required pam_nologin\.so +account required pam_unix\.so +password required pam_unix\.so +session required pam_limits\.so +session required pam_unix\.so +session required pam_lastlog\.so nowtmp +session optional pam_mail\.so standard .fi .RE .SH "FILES" -.TP 3n +.PP \fI/var/log/faillog\fR +.RS 4 failure logging file +.RE .SH "SEE ALSO" .PP @@ -185,4 +218,4 @@ failure logging file \fBpam\fR(8) .SH "AUTHOR" .PP -pam_tally was written by Tim Baverstock and Tomas Mraz. +pam_tally was written by Tim Baverstock and Tomas Mraz\. diff --git a/tests/tst-dlopen.c b/tests/tst-dlopen.c index 272d58bc..e4770eea 100644 --- a/tests/tst-dlopen.c +++ b/tests/tst-dlopen.c @@ -19,6 +19,9 @@ /* Simple program to see if dlopen() would succeed. */ int main(int argc, char **argv) { +#ifdef PAM_STATIC + return 77; +#else int i; struct stat st; char buf[PATH_MAX]; @@ -40,5 +43,6 @@ int main(int argc, char **argv) } } return 0; +#endif } -- cgit v1.2.3