source: trunk/athena/lib/al/al_acct_create.3 @ 11758

Revision 11758, 4.8 KB checked in by danw, 26 years ago (diff)
Fix 'roff lossage reported by kretch
Line 
1.\" $Id: al_acct_create.3,v 1.6 1998-07-16 13:00:58 danw Exp $
2.\"
3.\" Copyright 1997 by the Massachusetts Institute of Technology.
4.\"
5.\" Permission to use, copy, modify, and distribute this
6.\" software and its documentation for any purpose and without
7.\" fee is hereby granted, provided that the above copyright
8.\" notice appear in all copies and that both that copyright
9.\" notice and this permission notice appear in supporting
10.\" documentation, and that the name of M.I.T. not be used in
11.\" advertising or publicity pertaining to distribution of the
12.\" software without specific, written prior permission.
13.\" M.I.T. makes no representations about the suitability of
14.\" this software for any purpose.  It is provided "as is"
15.\" without express or implied warranty.
16.\"
17.TH AL_ACCT_CREATE 3 "18 September 1997"
18.SH NAME
19al_acct_create \- Set up a local account for a user
20.SH SYNOPSIS
21.nf
22.B #include <al.h>
23.PP
24.B
25int al_acct_create(const char *\fIusername\fP, const char *\fIcryptpw\fP,
26.B      pid_t \fIsessionpid\fP, int \fIhavecred\fP, int \fItmphomedir\fP,
27.B      int **\fIwarnings\fP)
28.PP
29.B cc file.c -lal -lhesiod
30.fi
31.SH DESCRIPTION
32This function ensures that local account information is set up for
33.IR username .
34After successful completion, the user will have information in the
35local passwd and group databases and will have a home directory
36accessible by the current process.  Changes to local system databases
37are recorded in the sessions database (see sessions(5)) so that they
38may be reverted later by
39.I al_acct_revert
40or
41.IR al_acct_cleanup .
42.PP
43The meanings of the arguments to
44.I al_acct_create
45are as follows:
46.TP 15
47.I username
48Gives the name of the user whose local account is to be created.
49.TP 15
50.I cryptpw
51If an entry is added to the local passwd database, it will use the
52value of
53.I cryptpw
54as the encrypted passwd field if
55.I cryptpw
56is not NULL and if
57.I /etc/nocrack
58is not present.
59.TP 15
60.I sessionpid
61Gives the pid of the login session (which should generally always be
62the current process pid) to be recorded in the sessions database.
63.TP 15
64.I havecred
65Should be nonzero if the user has cached Kerberos credentials.  If
66.I havecred
67is zero,
68.I al_acct_create
69does not attempt to get authorization to access the user's home
70directory.
71.TP 15
72.I tmphomedir
73Specifies whether to create a temporary home directory if the user's
74home directory cannot be attached.
75.TP 15
76.I warnings
77Points to a variable which may be set to an allocated array (which the
78caller must free) of warning codes giving a list of possible non-fatal
79error codes.  The variable will otherwise be set to NULL.  The caller
80may pass a NULL pointer if it does not want warning codes.
81.PP
82The caller may invoke
83.I al_acct_create
84multiple times with the same
85.I username
86and
87.IR sessionpid ,
88e.g. once before credentials are acquired and once afterwards.
89Generally,
90.I tmphomedir
91should be set to false for all but the last invocation, or warning
92values may become confused.
93.SH RETURN VALUES
94.I al_acct_create
95may return the following values:
96.TP 15
97.I AL_SUCCESS
98Account creation succeeded.
99.TP 15
100.I AL_ENOUSER
101No local or Hesiod passwd entry is available for
102.IR username .
103.TP 15
104.I AL_EPASSWD
105The user could not be added to the local passwd database.
106.TP 15
107.I AL_ESESSION
108The user's session record could not be modified.
109.TP 15
110.I AL_ENOMEM
111Memory was exhausted.
112.TP 15
113.I AL_WARNINGS
114Account creation succeeded but some suboptimal condition occurred.
115If
116.I warnings
117is non-NULL, the variable it points to is set to an allocated array of
118warning codes terminated by
119.IR AL_SUCCESS .
120The caller must free this array.
121.SH WARNINGS
122Possible warning codes are:
123.TP 15
124.I AL_WBADSESSION
125The user's session record was corrupt and treated as if it did not
126exist.
127.TP 15
128.I AL_WGROUP
129The user could not be added to the group file.
130.TP 15
131.I AL_WXTMPDIR
132The user has a temporary home directory from a currently existing
133login session.
134.TP 15
135.I AL_WTMPDIR
136The user's home directory could not be attached; a temporary home
137directory was created instead.
138.TP 15
139.I AL_WNOHOMEDIR
140The user's home directory could not be attached and a temporary home
141directory was not created.  The user has no home directory.
142.TP 15
143.I AL_WNOATTACH
144The user's home directory was not attached because
145.I /etc/noattach
146is present.
147.PP
148If the user has a local passwd entry with a home directory which is
149different from the user's Hesiod passwd entry, no home directory
150attach is attempted and no homedir-related warning codes can occur.
151Thus, the login application may assume that homedir-related warning
152codes refer to an Athena home directory, but the application must be
153handle possible errors when changing to the user's home directory.
154.SH SEE ALSO
155al_acct_revert(3), al_login_allowed(3), al_strerror(3), sessions(5)
156.SH AUTHOR
157Greg Hudson, MIT Information Systems
158.br
159Copyright 1997 by the Massachusetts Institute of Technology.
Note: See TracBrowser for help on using the repository browser.