Imported Debian patch 0.63.0-6
[hcoop/debian/courier-authlib.git] / auth_getuserinfo.3
CommitLineData
dd184caf 1.\" <!-- $Id: auth_getuserinfo.sgml,v 1.4 2007/07/21 20:05:53 mrsam Exp $ -->
d9898ee8 2.\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3.\" <!-- distribution information. -->
4.\" Title: auth_getuserinfo
5.\" Author:
8d138742
CE
6.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
7.\" Date: 08/23/2008
d9898ee8 8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
10.\"
8d138742 11.TH "AUTH_GETUSERINFO" "3" "08/23/2008" "Double Precision, Inc." "Double Precision, Inc."
d9898ee8 12.\" disable hyphenation
13.nh
14.\" disable justification (adjust text to left margin only)
15.ad l
16.SH "NAME"
8d138742 17auth_getuserinfo - Obtain account information
d9898ee8 18.SH "SYNOPSIS"
19.sp
20.RS 4
21.nf
8d138742 22#include <courierauth\.h>
d9898ee8 23.fi
24.RE
25.HP 24
dd184caf 26.BI "int rc=auth_getuserinfo(const\ char\ *" "userid" ", int\ " "(*callback_func)" "(struct\ authinfo\ *,\ void\ *), void\ *" "callback_arg" ");"
d9898ee8 27.SH "DESCRIPTION"
28.PP
29If
30\fIuserid\fR
31is a valid account name, retrieve the account particulars and invoke
8d138742 32\fIcallback_func\fR\.
d9898ee8 33.SH "RETURNS"
34.PP
35
36\fBcallback_func\fR
37will be invoked if
38\fIuserid\fR
39exists, and
8d138742 40\fBcallback_func\fR\'s return value becomes the return value from
d9898ee8 41\fBauth_getuserinfo\fR
8d138742 42(which should be 0, by convention)\.
d9898ee8 43\fBcallback_func\fR
44will not be invoked if an error occurs, which is reported by a non\-zero return value from
8d138742 45\fBauth_getuserinfo\fR\. By convention, a positive return value indicates an internal, temporary failure, such as the authentication daemon process not running; a negative return value indicates that this request was processed, but it failed (probably because
d9898ee8 46\fIuserid\fR
8d138742 47does not exist\.
d9898ee8 48.PP
49The second argument to
50\fBcallback_func\fR
51will be
8d138742
CE
52\fBcallback_arg\fR, which is not interpreted by this function in any way\. The first argument will be a pointer to the following structure:
53.PP
d9898ee8 54\fBExample\ 1.\ struct authinfo\fR
55.sp
56.RS 4
57.nf
58struct authinfo {
59 const char *sysusername;
60 const uid_t *sysuserid;
61 gid_t sysgroupid;
62 const char *homedir;
63
64 const char *address;
65 const char *fullname;
66 const char *maildir;
67 const char *quota;
68 const char *passwd;
69 const char *clearpasswd;
70
71 const char *options;
72
73 } ;
74.fi
75.RE
76.PP
77Description of the above fields:
78.PP
79address
80.RS 4
8d138742 81The authenticated login ID\.
d9898ee8 82.RE
83.PP
84sysusername
85.RS 4
8d138742
CE
86The authenticated account\'s userid and groupid can be looked up in the password file using
87address\. If this field is
d9898ee8 88NULL, obtain the userid and the groupid from
89sysuserid
90and
8d138742 91sysgroupid\.
d9898ee8 92.RE
93.PP
94sysuserid
95.RS 4
96
97sysuserid
98may be
99NULL
100if
101sysusername
8d138742 102is initialized, otherwise it\'s a pointer to the account\'s numeric userid\.
d9898ee8 103.RE
104.PP
105sysgroupid
106.RS 4
8d138742 107Account\'s numeric groupid\.
d9898ee8 108sysgroupid
109is only used when
110sysusername
111is
8d138742 112NULL\.
d9898ee8 113.RE
114.PP
115fullname
116.RS 4
8d138742
CE
117This is the account\'s full name\. This field is optional, it may be
118NULL\.
d9898ee8 119.RE
120.PP
121homedir
122.RS 4
8d138742
CE
123The account\'s home directory\. This field cannot be
124NULL\.
d9898ee8 125.RE
126.PP
127maildir
128.RS 4
8d138742 129The pathname to the account\'s mailbox\. This field is optional, it can be
d9898ee8 130NULL
8d138742 131in which case the default location is assumed\.
d9898ee8 132.RE
133.PP
134quota
135.RS 4
8d138742 136Optional maildir quota on the account\'s mailbox (and
d9898ee8 137NULL
8d138742 138if no quota is set)\.
d9898ee8 139.RE
140.PP
141passwd
142.RS 4
8d138742
CE
143The account\'s encrypted password, if available\. If the account has a cleartext password defined, this field can be set to
144NULL\. The encrypted password can take several formats:
145.sp
d9898ee8 146.RS 4
8d138742 147\h'-04'\(bu\h'+03'A traditional triple\-DES crypted password, or a MD5+salt\-hashed password, as used in Linux\.
d9898ee8 148.RE
8d138742 149.sp
d9898ee8 150.RS 4
151\h'-04'\(bu\h'+03'
152\(lq{MD5}\(rq
8d138742 153followed by a base64\-encoded MD5 hash of the password\.
d9898ee8 154.RE
8d138742 155.sp
d9898ee8 156.RS 4
157\h'-04'\(bu\h'+03'
158\(lq{SHA}\(rq
8d138742 159followed by a base64\-encoded SHA1 hash of the password\.
d9898ee8 160.RE
161.RE
162.PP
163clearpasswd
164.RS 4
8d138742
CE
165The account\'s cleartext password, if available\. If the account has an encrypted password defined, this field can be set to
166NULL\.
d9898ee8 167.RE
168.PP
169options
170.RS 4
8d138742 171A comma\-separated list of miscellaneous account options\. See below for more information\.
d9898ee8 172.RE
173.SS "Account options"
174.PP
8d138742
CE
175Depending on the configuration of the Courier authentication library, accounts may have individual options associated with them\. If the authentication library configuration does not implement account options, the option string will be
176NULL\. Otherwise it will be a comma\-separated list of
d9898ee8 177\(lq\fIoption\fR=\fIvalue\fR\(rq
8d138742 178settings\.
d9898ee8 179.sp
180.it 1 an-trap
181.nr an-no-space-flag 1
182.nr an-break-flag 1
183.br
8d138742 184Note
d9898ee8 185.PP
8d138742 186This is the account option implementation that\'s used by Courier, Courier\-IMAP, and SqWebMail packages\. Some of the following information is obviously not applicable for a particular package\. The inapplicable bits should be obvious\.
d9898ee8 187.PP
188The following options are recognized by the various Courier packages:
189.sp
190.it 1 an-trap
191.nr an-no-space-flag 1
192.nr an-break-flag 1
193.br
8d138742 194Note
d9898ee8 195.PP
196The application is responsible for enforcing all the
197\(lqdisabled\(rq
8d138742 198option\. An authentication request for service
d9898ee8 199\(lqimap\(rq, for example, will succeed provided that the userid and the password are valid, even if
200\(lqdisableimap=1\(rq
8d138742 201is set\. The application\'s
d9898ee8 202\fBcallback_func\fR
8d138742 203should check for this condition, and return a negative return code\.
d9898ee8 204.PP
205disableimap=\fIn\fR
206.RS 4
8d138742 207If "n" is 1, IMAP access to this account should be disabled\.
d9898ee8 208.RE
209.PP
210disablepop3=\fIn\fR
211.RS 4
8d138742 212If "n" is 1, POP3 access to this account should be disabled\.
d9898ee8 213.RE
214.PP
215disablewebmail=\fIn\fR
216.RS 4
8d138742 217If "n" is 1, webmail access to this account should be disabled\.
d9898ee8 218.RE
219.PP
220disableshared=\fIn\fR
221.RS 4
8d138742 222If "n" is 1, this account should not have access to shared folders or be able to share its own folders with other people\.
d9898ee8 223.RE
224.PP
225group=\fIname\fR
226.RS 4
227This account is a member of access group
8d138742
CE
228\fIname\fR\. Instead of granting access rights on individual mail folders to individual accounts, the access rights can be granted to an access group
229\(lqname\(rq, and all members of this group get the specified access rights\.
d9898ee8 230.sp
231The access group name
232\(lqadministrators\(rq
8d138742 233is a reserved group\. All accounts in the
d9898ee8 234administrators
8d138742 235group automatically receive all rights to all accessible folders\.
d9898ee8 236.sp
237.it 1 an-trap
238.nr an-no-space-flag 1
239.nr an-break-flag 1
240.br
8d138742
CE
241Note
242This option may be specified multiple times to specify that the account belongs to multiple account groups\.
d9898ee8 243.RE
244.PP
245sharedgroup=\fIname\fR
246.RS 4
8d138742 247Append "name" to the name of the top level virtual shared folder index file\. This setting restricts which virtual shared folders this account could possibly access (and that\'s on top of whatever else the access control lists say)\. See the virtual shared folder documentation for more information\.
d9898ee8 248.sp
8d138742 249For technical reasons, group names may not include comma, tab, "/" or "|" characters\.
d9898ee8 250.RE
251.SH "SEE ALSO"
252.PP
253
254\fI\fBauthlib\fR(3)\fR\&[1],
255\fI\fBauth_generic\fR(3)\fR\&[2],
256\fI\fBauth_login\fR(3)\fR\&[3],
257\fI\fBauth_enumerate\fR(3)\fR\&[4],
258\fI\fBauth_passwd\fR(3)\fR\&[5],
8d138742
CE
259\fI\fBauth_getoption\fR(3)\fR\&[6]\.
260.SH "NOTES"
d9898ee8 261.IP " 1." 4
262\fBauthlib\fR(3)
263.RS 4
264\%authlib.html
265.RE
266.IP " 2." 4
267\fBauth_generic\fR(3)
268.RS 4
269\%auth_generic.html
270.RE
271.IP " 3." 4
272\fBauth_login\fR(3)
273.RS 4
274\%auth_login.html
275.RE
276.IP " 4." 4
277\fBauth_enumerate\fR(3)
278.RS 4
279\%auth_enumerate.html
280.RE
281.IP " 5." 4
282\fBauth_passwd\fR(3)
283.RS 4
284\%auth_passwd.html
285.RE
286.IP " 6." 4
287\fBauth_getoption\fR(3)
288.RS 4
289\%auth_getoption.html
290.RE