sync'ing up for 3.0alpha20 release
[ira/wip.git] / examples / pdb / mysql / README
1 PDB MySQL plugin for samba v1.1
2 --
3
4 Building
5 =========
6 Before you can build the plugin, set the variable SAMBA_SRC in Makefile to the
7 path containing the samba sources. This is usually the 'source' directory in 
8 the samba tarball or CVS. 
9
10 Next, type make, and then copy pdb_mysql.so to any location you want. I 
11 strongly recommend installing it in $PREFIX/lib or /usr/lib/samba/
12
13 Configuring
14 ============
15 This plugin lacks some good documentation, but here is some short info:
16
17 Add a the following to the 'passdb backend' variable in your smb.conf:
18
19 passdb backend = [other-plugins] plugin:/location/to/pdb_mysql.so:identifier [other-plugins]
20
21 The identifier can be any string you like, as long as it doesn't collide with 
22 the identifiers of other plugins or other instances of pdb_mysql. If you 
23 specify multiple pdb_mysql.so entries in 'passdb backend', you also need to 
24 use different identifiers!
25
26 Additional options can be given thru the smb.conf file in the [global] section.
27
28 identifier:mysql host                     - host name, defaults to 'localhost'
29 identifier:mysql password
30 identifier:mysql user                     - defaults to 'samba'
31 identifier:mysql database                 - defaults to 'samba'
32 identifier:mysql port                     - defaults to 3306
33 identifier:table                          - Name of the table containing users
34
35 Names of the columns in this table(I've added column types those columns
36                                    should have first):
37 identifier:logon time column             - int(9)
38 identifier:logoff time column            - int(9)
39 identifier:kickoff time column           - int(9)
40 identifier:pass last set time column     - int(9)
41 identifier:pass can change time column   - int(9)
42 identifier:pass must change time column  - int(9)
43 identifier:username column               - varchar(255) - unix username
44 identifier:domain column                 - varchar(255) - NT domain user is part of
45 identifier:nt username column            - varchar(255) - NT username
46 identifier:fullname column            - varchar(255) - Full name of user
47 identifier:home dir column               - varchar(255) - Unix homedir path
48 identifier:dir drive column              - varchar(2) - Directory drive path (eg: 'H:')
49 identifier:logon script column           - varchar(255) - Batch file to run on client side when logging on
50 identifier:profile path column           - varchar(255) - Path of profile
51 identifier:acct desc column              - varchar(255) - Some ASCII NT user data
52 identifier:workstations column           - varchar(255) - Workstations user can logon to (or NULL for all)
53 identifier:unknown string column         - varchar(255) - unknown string
54 identifier:munged dial column            - varchar(255) - ?
55 identifier:uid column                    - int(9) - Unix user ID (uid)
56 identifier:gid column                    - int(9) - Unix user group (gid)
57 identifier:user sid column               - varchar(255) - NT user SID
58 identifier:group sid column              - varchar(255) - NT group ID
59 identifier:lanman pass column            - varchar(255) - encrypted lanman password
60 identifier:nt pass column                - varchar(255) - encrypted nt passwd
61 identifier:plaintext pass column         - varchar(255) - plaintext password
62 identifier:acct control column           - int(9) - nt user data
63 identifier:unknown 3 column              - int(9) - unknown
64 identifier:logon divs column             - int(9) - ?
65 identifier:hours len column              - int(9) - ?
66 identifier:unknown 5 column              - int(9) - unknown
67 identifier:unknown 6 column              - int(9) - unknown
68
69 Eventually, you can put a colon (:) after the name of each column, which 
70 should specify the column to update when updating the table. You can also
71 specify nothing behind the colon - then the data from the field will not be 
72 updated. 
73
74 Using plaintext passwords or encrypted password
75 ===============================================
76 I strongly discourage the use of plaintext passwords, however, you can use them:
77
78 If you would like to use plaintext passwords, set 'identifier:lanman pass column' and 'identifier:nt pass column' to 'NULL' (without the quotes) and 'identifier:plaintext pass column' to the name of the column containing the plaintext passwords. 
79
80 If you use encrypted passwords, set the 'identifier:plaintext pass column' to 'NULL' (without the quotes). This is the default.
81
82 Getting non-column data from the table
83 ======================================
84 It is possible to have not all data in the database and making some 'constant'.
85
86 For example, you can set 'identifier:fullname column' to : 
87     CONCAT(First_name,' ',Sur_name)
88
89 Or, set 'identifier:workstations column' to :
90     NULL
91
92 See the MySQL documentation for more language constructs.