Ldapscripts - README file
*************************

Description :
*************

These scripts are designed to be used within the Samba's smb.conf file 
(or manually) and allow to create POSIX entries for users, groups and 
machines in and LDAP directory. They are written in sh and need ldap 
client commands to work correctly (ldapadd, ldapdelete, ldapmodify,
ldapsearch).

They are designed to be used under GNU/Linux and require several binaries
that should come with your distro (uuencode, getent, date, grep, sed, cut, 
expr, which...) ; please make sure this is right before using them !

Latest version available on http://contribs.martymac.com

Installing ldapscripts :
************************

To install these scripts, just type in :
# ./install
within the scripts directory. 

All the scripts will be copied into /usr/local/bin and ldapscripts.conf
will be copied into /etc/ldapscripts.

Edit /etc/ldapscripts/ldapscripts.conf to configure the ldapscripts.

Then, just type in - e.g. :
# ldapadduser foo foogroup

Using ldapscripts with Samba :
******************************

To use ldapscripts with Samba (e.g. for an NT4 -> Samba migration), just
add the following to your smb.conf file :

# [...]
add machine script = /usr/local/bin/ldapaddmachine '%u' sambamachines
add user script = /usr/local/bin/ldapadduser '%u' sambausers
add group script = /usr/local/bin/ldapaddgroup '%g'
add user to group script = /usr/local/bin/ldapaddusertogroup '%u' '%g'
delete user script = /usr/local/bin/ldapdeleteuser '%u'
delete group script = /usr/local/bin/ldapdeletegroup '%g'
delete user from group script = /usr/local/bin/ldapdeleteuserfromgroup '%u' '%g'
set primary group script = /usr/local/bin/ldapsetprimarygroup '%u' '%g'
# [...]

and make sure sambamachines and sambausers exist before attempting to 
do a "net rpc vampire"...

Also be sure to have nsswitch / nss_ldap working since the scripts uses
getent to getch accounts information.

Files :
*******

README : this file !
ldapscripts.conf : configuration file
install : installation script

_ldapdeletemachine : not used within smb.conf (but may be useful anyway)
_ldapinit : initializes the LDAP tree with a minimal hierarchy
_lsldap : does a big query on the LDAP server
ldapaddgroup : adds a POSIX group to LDAP
ldapadduser : adds a POSIX user to LDAP
ldapdeletegroup : deletes a POSIX group from LDAP
ldapdeleteuserfromgroup : deletes a memberUid entry from a POSIX group
ldapsetprimarygroup : sets gidNumber of a POSIX user or machine account
ldapaddmachine : adds a POSIX machine (user$) to LDAP
ldapaddusertogroup : add a memberUid entry to a POSIX group
ldapdeleteuser : deletes a POSIX user from LDAP

Ldapscripts on FreeBSD ?
************************

The ldapscripts don't run on FreeBSD at the moment. The main problem is the
getent command is not available on FreeBSD. If you wanna run the scripts on
FreeBSD, just use pw instead of getent. 

I haven't have enough time to patch the scripts to make them work 
out-of-the-box ! (any contrib welcome ;-))

Author / Licence :
******************

These scripts have been written by Ganal LAPLANCHE (ganael.laplanche@martymac.com)
and are available within the GPL license (see COPYING for details).

Thanks for using ldapscripts... Any feedback welcome :)
