Debian Codegraph @

upstream/debian-unstable/man3/pam_putenv.3

raw
1 '\" t
2 .\" Title: pam_putenv
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_PUTENV" "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_putenv \- set or change PAM environment variable
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_putenv('u
40 .BI "int pam_putenv(pam_handle_t\ *" "pamh" ", const\ char\ *" "name_value" ");"
41 .SH "DESCRIPTION"
42 .PP
43 The
44 \fBpam_putenv\fR
45 function is used to add or change the value of PAM environment variables as associated with the
46 \fIpamh\fR
47 handle\&.
48 .PP
49 The
50 \fIpamh\fR
51 argument is an authentication handle obtained by a prior call to pam_start()\&. The
52 \fIname_value\fR
53 argument is a single NUL terminated string of one of the following forms:
54 .PP
55 NAME=value of variable
56 .RS 4
57 In this case the environment variable of the given NAME is set to the indicated value:
58 \fIvalue of variable\fR\&. If this variable is already known, it is overwritten\&. Otherwise it is added to the PAM environment\&.
59 .RE
60 .PP
61 NAME=
62 .RS 4
63 This function sets the variable to an empty value\&. It is listed separately to indicate that this is the correct way to achieve such a setting\&.
64 .RE
65 .PP
66 NAME
67 .RS 4
68 Without an \*(Aq=\*(Aq the
69 \fBpam_putenv\fR() function will delete the corresponding variable from the PAM environment\&.
70 .RE
71 .PP
72 \fBpam_putenv\fR() operates on a copy of
73 \fIname_value\fR, which means in contrast to
74 \fBputenv\fR(3), the application is responsible for freeing the data\&.
75 .SH "RETURN VALUES"
76 .PP
77 PAM_PERM_DENIED
78 .RS 4
79 Argument
80 \fIname_value\fR
81 given is a NULL pointer\&.
82 .RE
83 .PP
84 PAM_BAD_ITEM
85 .RS 4
86 Variable requested (for deletion) is not currently set\&.
87 .RE
88 .PP
89 PAM_ABORT
90 .RS 4
91 The
92 \fIpamh\fR
93 handle is corrupt\&.
94 .RE
95 .PP
96 PAM_BUF_ERR
97 .RS 4
98 Memory buffer error\&.
99 .RE
100 .PP
101 PAM_SUCCESS
102 .RS 4
103 The environment variable was successfully updated\&.
104 .RE
105 .SH "SEE ALSO"
106 .PP
107 \fBpam_start\fR(3),
108 \fBpam_getenv\fR(3),
109 \fBpam_getenvlist\fR(3),
110 \fBpam_strerror\fR(3),
111 \fBpam\fR(7)