| 1 |
'\" t |
| 2 |
.\" Title: pam_setcred |
| 3 |
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/> |
| 5 |
.\" Date: 06/29/2025 |
| 6 |
.\" Manual: Linux-PAM Manual |
| 7 |
.\" Source: Linux-PAM |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "PAM_SETCRED" "3" "06/29/2025" "Linux\-PAM" "Linux\-PAM Manual" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
pam_setcred \- establish / delete user credentials |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.ft B |
| 35 |
.nf |
| 36 |
#include <security/pam_appl\&.h> |
| 37 |
.fi |
| 38 |
.ft |
| 39 |
.HP \w'int\ pam_setcred('u |
| 40 |
.BI "int pam_setcred(pam_handle_t\ *" "pamh" ", int\ " "flags" ");" |
| 41 |
.SH "DESCRIPTION" |
| 42 |
.PP |
| 43 |
The |
| 44 |
\fBpam_setcred\fR |
| 45 |
function is used to establish, maintain and delete the credentials of a user\&. It should be called to set the credentials after a user has been authenticated and before a session is opened for the user (with |
| 46 |
\fBpam_open_session\fR(3))\&. The credentials should be deleted after the session has been closed (with |
| 47 |
\fBpam_close_session\fR(3))\&. |
| 48 |
.PP |
| 49 |
A credential is something that the user possesses\&. It is some property, such as a |
| 50 |
\fIKerberos\fR |
| 51 |
ticket, or a supplementary group membership that make up the uniqueness of a given user\&. On a Linux system the user\*(Aqs |
| 52 |
\fIUID\fR |
| 53 |
and |
| 54 |
\fIGID\fR\*(Aqs are credentials too\&. However, it has been decided that these properties (along with the default supplementary groups of which the user is a member) are credentials that should be set directly by the application and not by PAM\&. Such credentials should be established, by the application, prior to a call to this function\&. For example, |
| 55 |
\fBinitgroups\fR(2) |
| 56 |
(or equivalent) should have been performed\&. |
| 57 |
.PP |
| 58 |
Valid |
| 59 |
\fIflags\fR, any one of which, may be logically OR\*(Aqd with |
| 60 |
\fBPAM_SILENT\fR, are: |
| 61 |
.PP |
| 62 |
PAM_ESTABLISH_CRED |
| 63 |
.RS 4 |
| 64 |
Initialize the credentials for the user\&. |
| 65 |
.RE |
| 66 |
.PP |
| 67 |
PAM_DELETE_CRED |
| 68 |
.RS 4 |
| 69 |
Delete the user\*(Aqs credentials\&. |
| 70 |
.RE |
| 71 |
.PP |
| 72 |
PAM_REINITIALIZE_CRED |
| 73 |
.RS 4 |
| 74 |
Fully reinitialize the user\*(Aqs credentials\&. |
| 75 |
.RE |
| 76 |
.PP |
| 77 |
PAM_REFRESH_CRED |
| 78 |
.RS 4 |
| 79 |
Extend the lifetime of the existing credentials\&. |
| 80 |
.RE |
| 81 |
.SH "RETURN VALUES" |
| 82 |
.PP |
| 83 |
PAM_BUF_ERR |
| 84 |
.RS 4 |
| 85 |
Memory buffer error\&. |
| 86 |
.RE |
| 87 |
.PP |
| 88 |
PAM_CRED_ERR |
| 89 |
.RS 4 |
| 90 |
Failed to set user credentials\&. |
| 91 |
.RE |
| 92 |
.PP |
| 93 |
PAM_CRED_EXPIRED |
| 94 |
.RS 4 |
| 95 |
User credentials are expired\&. |
| 96 |
.RE |
| 97 |
.PP |
| 98 |
PAM_CRED_UNAVAIL |
| 99 |
.RS 4 |
| 100 |
Failed to retrieve user credentials\&. |
| 101 |
.RE |
| 102 |
.PP |
| 103 |
PAM_SUCCESS |
| 104 |
.RS 4 |
| 105 |
Data was successful stored\&. |
| 106 |
.RE |
| 107 |
.PP |
| 108 |
PAM_SYSTEM_ERR |
| 109 |
.RS 4 |
| 110 |
A NULL pointer was submitted as PAM handle, the function was called by a module or another system error occurred\&. |
| 111 |
.RE |
| 112 |
.PP |
| 113 |
PAM_USER_UNKNOWN |
| 114 |
.RS 4 |
| 115 |
User is not known to an authentication module\&. |
| 116 |
.RE |
| 117 |
.SH "SEE ALSO" |
| 118 |
.PP |
| 119 |
\fBpam_authenticate\fR(3), |
| 120 |
\fBpam_open_session\fR(3), |
| 121 |
\fBpam_close_session\fR(3), |
| 122 |
\fBpam_strerror\fR(3) |