hcoop release
[hcoop/debian/courier-authlib.git] / auth_mkhomedir.3
1 '\" t
2 .\" <!-- Copyright 2015 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
4 .\" Title: auth_mkhomedir
5 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
6 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Date: 09/08/2017
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Double Precision, Inc.
10 .\" Language: English
11 .\"
12 .TH "AUTH_MKHOMEDIR" "3" "09/08/2017" "Double Precision, Inc." "Double Precision, Inc."
13 .\" -----------------------------------------------------------------
14 .\" * Define some portability stuff
15 .\" -----------------------------------------------------------------
16 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17 .\" http://bugs.debian.org/507673
18 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
19 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .ie \n(.g .ds Aq \(aq
21 .el .ds Aq '
22 .\" -----------------------------------------------------------------
23 .\" * set default formatting
24 .\" -----------------------------------------------------------------
25 .\" disable hyphenation
26 .nh
27 .\" disable justification (adjust text to left margin only)
28 .ad l
29 .\" -----------------------------------------------------------------
30 .\" * MAIN CONTENT STARTS HERE *
31 .\" -----------------------------------------------------------------
32 .SH "NAME"
33 auth_mkhomedir \- Autocreate a new account\*(Aqs home directory
34 .SH "SYNOPSIS"
35 .sp
36 .nf
37 #include <courierauth\&.h>
38 .fi
39 .HP \w'int\ rc=auth_mkhomedir('u
40 .BI "int rc=auth_mkhomedir(struct\ authinfo\ *" "auth" ");"
41 .SH "DESCRIPTION"
42 .PP
43 A
44 \fIcallback_func\fR
45 that\*(Aqs passed as a parameter to
46 \m[blue]\fB\fBauth_getuserinfo\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2
47 can invoke this function to automatically create a new account\*(Aqs home directory, if the authlib client is running as root, forwarding the
48 authinfo
49 pointer from the callback\&.
50 .PP
51 \fBauth_mkhomedir\fR() checks if the
52 \fBAUTH_MKHOMEDIR_SKEL\fR
53 environment variable is set, and if the authenticated account\*(Aqs home directory does not exist\&. If the environment variable is set it must point to a directory like
54 /etc/skel
55 that contains a template for the contents of a new account\*(Aqs home directory\&.
56 .PP
57 If
58 \fBAUTH_MKHOMEDIR_SKEL\fR
59 is not set, or if the home directory exists,
60 \fBauth_mkhomedir\fR() does nothing and returns 0\&. Otherwise the account\*(Aqs home directory gets created, and the contents of the
61 \fBAUTH_MKHOMEDIR_SKEL\fR
62 directory get recursively copied into the new home directory\&. The permissions of
63 \fBAUTH_MKHOMEDIR_SKEL\fR
64 and its contents are preserved, and the owner userid and groupid is set to the authenticated account\*(Aqs userid and groupid\&.
65 .SH "RETURNS"
66 .PP
67 \fBauth_mkhomedir\fR() returns a non\-zero value if an error occured while creating the new account\*(Aqs home directory\&.
68 \fBauth_mkhomedir\fR() returns zero if the new account\*(Aqs home directory was created successfully, or if the account\*(Aqs home directory already exists\&.
69 .SH "SEE ALSO"
70 .PP
71 \m[blue]\fB\fBauthlib\fR(3)\fR\m[]\&\s-2\u[2]\d\s+2,
72 \m[blue]\fB\fBauth_getuserinfo\fR(3)\fR\m[]\&\s-2\u[1]\d\s+2\&.
73 .SH "NOTES"
74 .IP " 1." 4
75 \fBauth_getuserinfo\fR(3)
76 .RS 4
77 \%http://www.courier-mta.org/authlib/auth_getuserinfo.html
78 .RE
79 .IP " 2." 4
80 \fBauthlib\fR(3)
81 .RS 4
82 \%http://www.courier-mta.org/authlib/authlib.html
83 .RE