diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2001-01-22 06:07:28 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2001-01-22 06:07:28 +0000 |
commit | 9fb9393ede4ee9d43ff841557f95ed2af7d1a15f (patch) | |
tree | 34a3323fac5906ceb5aa54b5d482090bdaba47c0 /doc | |
parent | e6d5049a8d484fb7a764a125d830b23f59a0c685 (diff) | |
download | pam-9fb9393ede4ee9d43ff841557f95ed2af7d1a15f.tar.gz pam-9fb9393ede4ee9d43ff841557f95ed2af7d1a15f.tar.bz2 pam-9fb9393ede4ee9d43ff841557f95ed2af7d1a15f.zip |
Relevant BUGIDs: 129027, 128576
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/pam_appl.sgml | 87 | ||||
-rw-r--r-- | doc/pam_modules.sgml | 28 | ||||
-rw-r--r-- | doc/pam_source.sgml | 2 |
3 files changed, 71 insertions, 46 deletions
diff --git a/doc/pam_appl.sgml b/doc/pam_appl.sgml index 16c4f468..b1010203 100644 --- a/doc/pam_appl.sgml +++ b/doc/pam_appl.sgml @@ -45,8 +45,8 @@ DAMAGE. <article> <title>The Linux-PAM Application Developers' Guide -<author>Andrew G. Morgan, <tt>morgan@linux.kernel.org</tt> -<date>DRAFT v0.73 2000/12/02 +<author>Andrew G. Morgan, <tt>morgan@kernel.org</tt> +<date>DRAFT v0.74 2001/01/21 <abstract> This manual documents what an application developer needs to know about the <bf>Linux-PAM</bf> library. It describes how an application @@ -316,33 +316,41 @@ extern int pam_set_item(pam_handle_t *pamh, int item_type, <tag><tt/PAM_USER/</tag> The user name +<tag><tt/PAM_USER_PROMPT/</tag> + The string used when prompting for a user's name. The default +value for this string is ``Please enter username: ''. + <tag><tt/PAM_TTY/</tag> The terminal name: prefixed by <tt>/dev/</tt> if it is a device file; for graphical, X-based, applications the value for this item should be the <tt/$DISPLAY/ variable. +<tag><tt/PAM_RUSER/</tag> + The requesting user's username + <tag><tt/PAM_RHOST/</tag> - The remote host name + The requesting hostname (the hostname of the machine from which + the <tt/PAM_RUSER/ is requesting service) <tag><tt/PAM_CONV/</tag> The conversation structure (see section <ref id="the-conversation-function" name="below">) -<tag><tt/PAM_RUSER/</tag> - The remote user name - -<tag><tt/PAM_USER_PROMPT/</tag> - The string used when prompting for a user's name. The default -value for this string is ``Please enter username: ''. +<tag><tt/PAM_FAIL_DELAY/</tag> A function pointer to redirect + centrally managed failure delays (see section <ref + id="the-failure-delay-function" name="below">). </descrip> <p> -For all <tt/item_type/s, other than <tt/PAM_CONV/, <tt/item/ is a -pointer to a <tt><NUL></tt> terminated character string. In the -case of <tt/PAM_CONV/, <tt/item/ points to an initialized -<tt/pam_conv/ structure (see section <ref -id="the-conversation-function" name="below">). +For all <tt/item_type/s, other than <tt/PAM_CONV/ and +<tt/PAM_FAIL_DELAY/, <tt/item/ is a pointer to a <tt><NUL></tt> +terminated character string. In the case of <tt/PAM_CONV/, <tt/item/ +points to an initialized <tt/pam_conv/ structure (see section <ref +id="the-conversation-function" name="below">). In the case of +<tt/PAM_FAIL_DELAY/, <tt/item/ is a function pointer: <tt/void +(*delay_fn)(int retval, unsigned usec_delay, void *appdata_ptr)/ (see +section <ref id="the-failure-delay-function" name="below">). <p> A successful call to this function returns <tt/PAM_SUCCESS/. However, @@ -350,13 +358,17 @@ the application should expect one of the following errors: <p> <descrip> +<tag><tt/PAM_SYSTEM_ERR/</tag> + The <tt/pam_handle_t/ passed as a first argument to this + function was invalid. <tag><tt/PAM_PERM_DENIED/</tag> An attempt was made to replace the conversation structure with -a <tt/NULL/ value. + a <tt/NULL/ value. <tag><tt/PAM_BUF_ERR/</tag> The function ran out of memory making a copy of the item. <tag><tt/PAM_BAD_ITEM/</tag> - The application attempted to set an undefined item. + The application attempted to set an undefined or inaccessible + item. </descrip> <sect2>Getting PAM items @@ -375,9 +387,31 @@ This function is used to obtain the value of the indicated <tt/item_type/. Upon successful return, <tt/*item/ contains a pointer to the value of the corresponding item. Note, this is a pointer to the <em/actual/ data and should <em/not/ be <tt/free()/'ed or -over-written! A successful call is signaled by a return value of -<tt/PAM_SUCCESS/. If an attempt is made to get an undefined item, -<tt/PAM_BAD_ITEM/ is returned. +over-written! + +<p> +A successful call is signaled by a return value of <tt/PAM_SUCCESS/. +However, the application should expect one of the following errors: + +<p> +<descrip> +<tag><tt/PAM_SYSTEM_ERR/</tag> + The <tt/pam_handle_t/ passed as a first argument to this + function was invalid. +<tag><tt/PAM_PERM_DENIED/</tag> + The value of <tt/item/ was <tt/NULL/. +<tag><tt/PAM_BAD_ITEM/</tag> + The application attempted to set an undefined or inaccessible + item. +</descrip> + +<p> +Note, in the case of an error, the contents of <tt/item/ is not +modified - that is, it retains its pre-call value. One should take +care to initialize this value prior to calling +<tt/pam_get_item()/. Since, if its value - despite the +<tt/pam_get_item()/ function failing - is to be used the consequences +are undefined. <sect2>Understanding errors <label id="pam-strerror-section"> @@ -395,6 +429,7 @@ error associated with the argument <tt/errnum/. If the error is not recognized ``<tt/Unknown Linux-PAM error/'' is returned. <sect2>Planning for delays +<label id="the-failure-delay-function"> <p> <tscreen> @@ -410,9 +445,9 @@ is returned to the application. When using this function the application programmer should check if it is available with, <tscreen> <verb> -#ifdef HAVE_PAM_FAIL_DELAY +#ifdef PAM_FAIL_DELAY .... -#endif /* HAVE_PAM_FAIL_DELAY */ +#endif /* PAM_FAIL_DELAY */ </verb> </tscreen> @@ -463,7 +498,7 @@ void (*delay_fn)(int retval, unsigned usec_delay, void *appdata_ptr); The arguments being the <tt/retval/ return code of the module stack, the <tt/usec_delay/ micro-second delay that libpam is requesting and the <tt/appdata_ptr/ that the application has associated with the -current <tt/pamh/ (/tt/pam_handle_t/). This last value was set by the +current <tt/pamh/ (<tt/pam_handle_t/). This last value was set by the application when it called <tt/pam_start/ or explicitly with <tt/pam_set_item(... , PAM_CONV, ...)/. Note, if <tt/PAM_FAIL_DELAY/ is unset (or set to <tt/NULL/), then <tt/libpam/ will perform any @@ -746,14 +781,6 @@ extern int pam_putenv(pam_handle_t *pamh, const char *name_value); </tscreen> <p> -<em> -Warning, the environment support in <bf/Linux-PAM/ is based solely -on a six line email from the developers at Sun. Its interface is -likely to be generally correct, however, the details are likely to be -changed as more information becomes available. -</em> - -<p> This function attempts to (re)set a <bf/Linux-PAM/ environment variable. The <tt/name_value/ argument is a single <tt/NUL/ terminated string of one of the following forms: diff --git a/doc/pam_modules.sgml b/doc/pam_modules.sgml index 8d313261..694eff85 100644 --- a/doc/pam_modules.sgml +++ b/doc/pam_modules.sgml @@ -48,8 +48,8 @@ DAMAGE. <article> <title>The Linux-PAM Module Writers' Guide -<author>Andrew G. Morgan, <tt>morgan@linux.kernel.org</tt> -<date>DRAFT v0.73 2000/12/02 +<author>Andrew G. Morgan, <tt>morgan@kernel.org</tt> +<date>DRAFT v0.74 2001/01/21 <abstract> This manual documents what a programmer needs to know in order to write a module that conforms to the <bf/Linux-PAM/ standard. It also @@ -207,10 +207,9 @@ Setting items Synopsis: <tscreen> <verb> -extern int pam_set_item(pam_handle_t *pamh - , int item_type - , const void *item - ); +extern int pam_set_item(pam_handle_t *pamh, + int item_type, + const void *item); </verb> </tscreen> @@ -227,8 +226,8 @@ following two <tt/item_type/s: <descrip> <tag><tt/PAM_AUTHTOK/</tag> -The authentication token (password). This token should be ignored by -all module functions besides <tt/pam_sm_authenticate()/ and +The authentication token (often a password). This token should be +ignored by all module functions besides <tt/pam_sm_authenticate()/ and <tt/pam_sm_chauthtok()/. In the former function it is used to pass the most recent authentication token from one stacked module to another. In the latter function the token is used for another @@ -258,10 +257,9 @@ Getting items Synopsis: <tscreen> <verb> -extern int pam_get_item(const pam_handle_t *pamh - , int item_type - , const void **item - ); +extern int pam_get_item(const pam_handle_t *pamh, + int item_type, + const void **item); </verb> </tscreen> @@ -413,7 +411,7 @@ extern int pam_putenv(pam_handle_t *pamh, const char *name_value); </tscreen> <p> -<bf/Linux-PAM/ (0.54+) comes equipped with a series of functions for +<bf/Linux-PAM/ comes equipped with a series of functions for maintaining a set of <em/environment/ variables. The environment is initialized by the call to <tt/pam_start()/ and is <bf/erased/ with a call to <tt/pam_end()/. This <em/environment/ is associated with the @@ -531,9 +529,9 @@ is returned to the application. When using this function the module programmer should check if it is available with, <tscreen> <verb> -#ifdef HAVE_PAM_FAIL_DELAY +#ifdef PAM_FAIL_DELAY .... -#endif /* HAVE_PAM_FAIL_DELAY */ +#endif /* PAM_FAIL_DELAY */ </verb> </tscreen> diff --git a/doc/pam_source.sgml b/doc/pam_source.sgml index 346082b0..f3be802e 100644 --- a/doc/pam_source.sgml +++ b/doc/pam_source.sgml @@ -46,7 +46,7 @@ DAMAGE. <title>The Linux-PAM System Administrators' Guide <author>Andrew G. Morgan, <tt>morgan@kernel.org</tt> -<date>DRAFT v0.73 2000/11/03 +<date>DRAFT v0.74 2001/01/21 <abstract> This manual documents what a system-administrator needs to know about the <bf>Linux-PAM</bf> library. It covers the correct syntax of the |