slapo-homedir.5 4.42 KB
Newer Older
Ondřej Kuzník's avatar
Ondřej Kuzník committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.TH SLAPO-HOMEDIR 5 "RELEASEDATE" "OpenLDAP LDVERSION"
.\" Copyright 1998-2021 The OpenLDAP Foundation, All Rights Reserved.
.\" Copying restrictions apply.  See the COPYRIGHT file.
.\" $OpenLDAP$
.SH NAME
slapo\-homedir \- Home directory provisioning overlay
.SH SYNOPSIS
ETCDIR/slapd.conf
.SH DESCRIPTION
The
.B homedir
overlay causes
.BR slapd (8)
to notice changes involving RFC-2307bis style user-objects and make
appropriate changes to the local filesystem.  This can be performed
on both master and replica systems, so it is possible to perform
remote home directory provisioning.
.SH CONFIGURATION
Both slapd.conf and back-config style configuration is supported.
.TP
.B overlay homedir
This directive adds the homedir overlay to the current database,
or to the frontend, if used before any database instantiation; see
.BR slapd.conf (5)
for details.
.TP
.B homedir\-skeleton\-path <pathname>
.TP
.B olcSkeletonPath: pathname
These options set the path to the skeleton account directory.
(Generally, /etc/skel) Files in this directory will be copied into
newly created home directories.  Copying is recursive and handles
symlinks and fifos, but will skip most specials.
.TP
.B homedir\-min\-uidnumber <user id number>
.TP
.B olcMinimumUidNumber: number
These options configure the minimum userid to use in any home
directory attempt.  This is a basic safety measure to prevent
accidently using system accounts.  See REPLICATION for more flexible
options for selecting accounts.
.TP
.B homedir\-regexp <regexp> <path>
.TP
.B olcHomedirRegexp: regexp path
These options configure a set of regular expressions to use for
matching and optionally remapping incoming
.B homeDirectory
attribute values to pathnames on the local filesystem.  $number
expansion is supported to access values captured in parentheses.

For example, to accept any directory starting with \/home and use it
verbatim on the local filesystem:

.B homedir-regexp ^(/home/[\-_/a\-z0\-9]+)$ $1

To match the same set of directories, but create them instead under
\/export\/home, as is popular on Solaris NFS servers:

.B homedir-regexp ^(/home/[\-_/a\-z0\-9]+)$ /export$1
.TP
.B homedir\-delete\-style style
.TP
.B olcHomedirDeleteStyle: style
These options configure how deletes of posixAccount entries or their
attributes are handled; valid styles are
.B IGNORE,
which does nothing, and
.B DELETE,
which immediately performs a recursive delete on the home directory,
and
.B ARCHIVE,
which archives the home directory contents in a TAR file for later
examination.  The default is IGNORE.  Use with caution.  ARCHIVE
requires homedir-archive-path to be set, or it functions similar to
IGNORE.
.TP
.B homedir\-archive\-path <pathname>
.TP
.B olcArchivePath: pathname
These options specify the destination path for TAR files created by
the ARCHIVE delete style.
.SH REPLICATION
The homedir overlay can operate on either master or replica systems
with no changes.  See
.BR slapd.conf (5)
or
.BR slapd\-config (5)
for more information on configure syncrepl.

Partial replication (e.g. with filters) is especially useful for
providing different provisioning options to different sets of users.
.SH BUGS
DELETE, MOD, and MODRDN operations that remove the unix attributes
when delete style is set to DELETE will recursively delete the (regex
modified) home directory from the disk.  Please be careful when
deleting or changing values.

MOD and MODRDN will correctly respond to homeDirectory changes and
perform a non-destructive rename() operation on the filesystem, but
this does not correctly retry with a recursive copy when moving
between filesystems.

The recursive copy/delete/chown/tar functions are not aware of ACLs,
extended attributes, forks, sparse files, or hard links.  Block and
character device archival is non-portable, but should not be an issue
in home directories, hopefully.

Copying and archiving may not support files larger than 2GiB on some
architectures.  Bare POSIX UStar archives cannot support internal
files larger than 8GiB.  The current tar generator does not attempt to
resolve uid/gid into symbolic names.

No attempt is made to try to mkdir() the parent directories needed for
a given home directory or archive path.
.SH FILES
.TP
ETCDIR/slapd.conf
default slapd configuration file
.TP
/etc/skel (or similar)
source of new homedir files.
.SH SEE ALSO
.BR slapd.conf (5),
.BR slapd\-config (5),
.BR slapd (8),
RFC-2307, RFC-2307bis.
.SH ACKNOWLEDGEMENTS
.P
This module was written in 2009 by Emily Backes for Symas Corporation.