source: vendor/current/docs/manpages/idmap_script.8

Last change on this file was 989, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.7

File size: 4.4 KB
Line 
1'\" t
2.\" Title: idmap_script
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5.\" Date: 10/25/2016
6.\" Manual: System Administration tools
7.\" Source: Samba 4.4
8.\" Language: English
9.\"
10.TH "IDMAP_SCRIPT" "8" "10/25/2016" "Samba 4\&.4" "System Administration tools"
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"
31idmap_script \- Samba\*(Aqs idmap_script Backend for Winbind
32.SH "DESCRIPTION"
33.PP
34The idmap_script plugin is a substitute for the idmap_tdb2 backend used by winbindd for storing SID/uid/gid mapping tables in clustered environments with Samba and CTDB\&. It is a read only backend that uses a script to perform mapping\&.
35.PP
36It was developed out of the idmap_tdb2 back end and does not store SID/uid/gid mappings in a TDB, since the winbind_cache tdb will store the mappings once they are provided\&.
37.SH "IDMAP OPTIONS"
38.PP
39range = low \- high
40.RS 4
41Defines the available matching uid and gid range for which the backend is authoritative\&.
42.RE
43.PP
44script
45.RS 4
46This option can be used to configure an external program for performing id mappings\&.
47.RE
48.SH "IDMAP SCRIPT"
49.PP
50The tdb2 idmap backend supports an external program for performing id mappings through the smb\&.conf option
51\fIidmap config * : script\fR
52or its deprecated legacy form
53\fIidmap : script\fR\&.
54.PP
55The mappings obtained by the script are then stored in the idmap tdb2 database instead of mappings created by the incrementing id counters\&. It is therefore important that the script covers the complete range of SIDs that can be passed in for SID to Unix ID mapping, since otherwise SIDs unmapped by the script might get mapped to IDs that had previously been mapped by the script\&.
56.PP
57The script should accept the following command line options\&.
58.sp
59.if n \{\
60.RS 4
61.\}
62.nf
63 SIDTOID S\-1\-xxxx
64 IDTOSID UID xxxx
65 IDTOSID GID xxxx
66 IDTOSID XID xxxx
67
68.fi
69.if n \{\
70.RE
71.\}
72.PP
73And it should return one of the following responses as a single line of text\&.
74.sp
75.if n \{\
76.RS 4
77.\}
78.nf
79 UID:yyyy
80 GID:yyyy
81 XID:yyyy
82 SID:ssss
83 ERR:yyyy
84
85.fi
86.if n \{\
87.RE
88.\}
89.PP
90XID indicates that the ID returned should be both a UID and a GID\&. That is, it requests an ID_TYPE_BOTH, but it is ultimately up to the script whether or not it can honor that request\&. It can choose to return a UID or a GID mapping only\&.
91.SH "EXAMPLES"
92.PP
93This example shows how script is used as a the default idmap backend using an external program via the script parameter:
94.sp
95.if n \{\
96.RS 4
97.\}
98.nf
99 [global]
100 idmap config * : backend = script
101 idmap config * : range = 1000000\-2000000
102 idmap config * : script = /usr/local/samba/bin/idmap_script\&.sh
103
104.fi
105.if n \{\
106.RE
107.\}
108.PP
109This shows a simple script to partially perform the task:
110.sp
111.if n \{\
112.RS 4
113.\}
114.nf
115 #!/bin/sh
116 #
117 # Uncomment this if you want some logging
118 #echo $@ >> /tmp/idmap\&.sh\&.log
119 if [ "$1" == "SIDTOID" ]
120 then
121 # Note\&. The number returned has to be within the range defined
122 #echo "Sending UID:1000005" >> /tmp/idmap\&.sh\&.log
123 echo "UID:1000005"
124 exit 0
125 else
126 #echo "Sending ERR: No idea what to do" >> /tmp/idmap\&.sh\&.log
127 echo "ERR: No idea what to do"
128 exit 1
129 fi
130
131.fi
132.if n \{\
133.RE
134.\}
135.PP
136Clearly, this script is not enough, as it should probably use wbinfo to determine if an incoming SID is a user or group SID and then look up the mapping in a table or use some other mechanism for mapping SIDs to UIDs and etc\&.
137.SH "AUTHOR"
138.PP
139The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
Note: See TracBrowser for help on using the repository browser.