smbldap-configure-4.0/0000755000000000000000000000000011001257336013452 5ustar rootrootsmbldap-configure-4.0/VERSION0000644000000000000000000000002610667520640014530 0ustar rootrootsmbldap-configure-4.0 smbldap-configure-4.0/templates/0000755000000000000000000000000011001255713015445 5ustar rootrootsmbldap-configure-4.0/templates/DB_CONFIG0000640000000000000000000000132210444725267016714 0ustar rootroot# $OpenLDAP: pkg/ldap/servers/slapd/DB_CONFIG,v 1.1.2.1 2005/11/29 19:26:45 kurt Exp $ # Example DB_CONFIG file for use with slapd(8) BDB/HDB databases. # # See Sleepycat Berkeley DB documentation # # for detail description of DB_CONFIG syntax and semantics. # # Hints can also be found in the OpenLDAP Software FAQ # # one 0.25 GB cache set_cachesize 0 268435456 1 # Data Directory #set_data_dir db # Transaction Log settings set_lg_regionmax 262144 set_lg_bsize 2097152 #set_lg_dir logs # Note: special DB_CONFIG flags are no longer needed for "quick" # slapadd(8) or slapindex(8) access (see their -q option). smbldap-configure-4.0/templates/slapd.conf0000640000000000000000000000753210533645274017440 0ustar rootroot# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.8 2003/05/24 23:19:14 kurt Exp $ # # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # CORE_SCHEMA_KEY COSINE_SCHEMA_KEY INETORGPERSON_SCHEMA_KEY NIS_SCHEMA_KEY REDHAT_AUTOFS_SCHEMA_KEY SAMBA_SCHEMA_KEY # Allow LDAPv2 client connections. This is NOT the default. allow bind_v2 # Do not enable referrals until AFTER you have a working directory # service AND an understanding of referrals. #referral ldap://root.openldap.org FEDORA_SLAPDPID_KEY #pidfile /var/run/slapd.pid #argsfile //var/run/slapd.args # Load dynamic backend modules: BACK_BDB_MODULE_KEY # modulepath /usr/sbin/openldap # moduleload back_bdb.la # moduleload back_ldap.la # moduleload back_ldbm.la # moduleload back_passwd.la # moduleload back_shell.la # The next three lines allow use of TLS for connections using a dummy test # certificate, but you should generate a proper certificate by changing to # /usr/share/ssl/certs, running "make slapd.pem", and fixing permissions on # slapd.pem so that the ldap user or group can read it. # TLSCACertificateFile /usr/share/ssl/certs/ca-bundle.crt # TLSCertificateFile /usr/share/ssl/certs/slapd.pem # TLSCertificateKeyFile /usr/share/ssl/certs/slapd.pem # Sample security restrictions # Require integrity protection (prevent hijacking) # Require 112-bit (3DES or better) encryption for updates # Require 63-bit encryption for simple bind # security ssf=1 update_ssf=112 simple_bind=64 # Sample access control policy: # Root DSE: allow anyone to read it # Subschema (sub)entry DSE: allow anyone to read it # Other DSEs: # Allow self write access # Allow authenticated users read access # Allow anonymous users to authenticate # Directives needed to implement policy: # access to dn.base="" by * read # access to dn.base="cn=Subschema" by * read # access to * # by self write # by users read # by anonymous auth # # if no access controls are present, the default policy is: # Allow read by all # # rootdn can always write! # moquist testing ACLs #access to dn.sub="DC_DOMAIN_KEY" # attr=userpassword,LMpassword,NTpassword # by self write # by group="cn=Domain Admins,ou=Groups,DC_DOMAIN_KEY" write # by * auth #access to dn.sub="DC_DOMAIN_KEY" # by group="cn=Domain Admins,ou=Groups,DC_DOMAIN_KEY" write # by * read ####################################################################### # ldbm and/or bdb database definitions ####################################################################### database bdb suffix "DC_DOMAIN_KEY" rootdn "cn=SLAPD_ROOTDN_KEY,DC_DOMAIN_KEY" # Cleartext passwords, especially for the rootdn, should # be avoided. See slappasswd(8) and slapd.conf(5) for details. # Use of strong authentication encouraged. rootpw MASTER_PASSWORD_KEY # rootpw {crypt}ijFYNcSNctBYg # The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools. # Mode 700 recommended. directory /var/lib/ldap # Indices to maintain for this database #index objectClass eq,pres #index ou,cn,mail,surname,givenname eq,pres,sub #index uidNumber,gidNumber,loginShell eq,pres #index uid,memberUid eq,pres,sub #index nisMapName,nisMapEntry eq,pres,sub index objectClass eq index cn pres,sub,eq index sn pres,sub,eq index uid pres,sub,eq index displayName pres,sub,eq index uidNumber eq index gidNumber eq index memberUID eq index sambaSID eq index sambaPrimaryGroupSID eq index sambaDomainName eq index default sub # Replicas of this database #UNUSEDreplogfile /var/lib/ldap/openldap-master-replog #replica host=ldap-1.example.com:389 tls=yes # bindmethod=sasl saslmech=GSSAPI # authcId=host/ldap-master.example.com@EXAMPLE.COM #UNUSED_UPDATEDNupdatedn "cn=REPLICA_BIND_USER_KEY,DC_DOMAIN_KEY" #UNUSED_UPDATEREFupdateref ldap://MASTER_HOST_KEY smbldap-configure-4.0/templates/webmin-ldap-useradmin-config0000644000000000000000000000120410645451742023031 0ustar rootrootsamba_def=1 given=1 alias_same=0 samba_gclass=sambaGroupMapping auth_ldap=UBUNTU_LIBNSS_LDAP_CONF_PATH_KEY samba_class=sambaSamAccount other_class=top person organizationalPerson inetOrgPerson posixAccount shadowAccount sambaSamAccount login=cn=MANAGER_USER_KEY,DC_DOMAIN_KEY base_gid=10000 user_base=ou=Users,DC_DOMAIN_KEY pass=MASTER_PASSWORD_KEY group_base=ou=groups,DC_DOMAIN_KEY fields=sambaHomePath \\server\path\to\home props=sn: ${USER} samba_props=sambaHomePath: \\NETBIOSNAME_KEY\${USER} base_uid=10000 default_group=Domain Users default_shell=/bin/bash samba_domain=SID_KEY md5=0 shells=fixed,passwd,shells given_class=inetOrgPerson smbldap-configure-4.0/templates/samba.schema0000644000000000000000000003770710161736006017735 0ustar rootroot## ## schema file for OpenLDAP 2.x ## Schema for storing Samba user accounts and group maps in LDAP ## OIDs are owned by the Samba Team ## ## Prerequisite schemas - uid (cosine.schema) ## - displayName (inetorgperson.schema) ## - gidNumber (nis.schema) ## ## 1.3.6.1.4.1.7165.2.1.x - attributetypes ## 1.3.6.1.4.1.7165.2.2.x - objectclasses ## ## Printer support ## 1.3.6.1.4.1.7165.2.3.1.x - attributetypes ## 1.3.6.1.4.1.7165.2.3.2.x - objectclasses ## ## ----- READ THIS WHEN ADDING A NEW ATTRIBUTE OR OBJECT CLASS ------ ## ## Run the 'get_next_oid' bash script in this directory to find the ## next available OID for attribute type and object classes. ## ## $ ./get_next_oid ## attributetype ( 1.3.6.1.4.1.7165.2.1.XX NAME .... ## objectclass ( 1.3.6.1.4.1.7165.2.2.XX NAME .... ## ## Also ensure that new entries adhere to the declaration style ## used throughout this file ## ## ( 1.3.6.1.4.1.7165.2.XX.XX NAME .... ## ^ ^ ^ ## ## The spaces are required for the get_next_oid script (and for ## readability). ## ## ------------------------------------------------------------------ # objectIdentifier SambaRoot 1.3.6.1.4.1.7165 # objectIdentifier Samba3 SambaRoot:2 # objectIdentifier Samba3Attrib Samba3:1 # objectIdentifier Samba3ObjectClass Samba3:2 ######################################################################## ## HISTORICAL ## ######################################################################## ## ## Password hashes ## #attributetype ( 1.3.6.1.4.1.7165.2.1.1 NAME 'lmPassword' # DESC 'LanManager Passwd' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.2 NAME 'ntPassword' # DESC 'NT Passwd' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) ## ## Account flags in string format ([UWDX ]) ## #attributetype ( 1.3.6.1.4.1.7165.2.1.4 NAME 'acctFlags' # DESC 'Account Flags' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE ) ## ## Password timestamps & policies ## #attributetype ( 1.3.6.1.4.1.7165.2.1.3 NAME 'pwdLastSet' # DESC 'NT pwdLastSet' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.5 NAME 'logonTime' # DESC 'NT logonTime' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.6 NAME 'logoffTime' # DESC 'NT logoffTime' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.7 NAME 'kickoffTime' # DESC 'NT kickoffTime' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.8 NAME 'pwdCanChange' # DESC 'NT pwdCanChange' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.9 NAME 'pwdMustChange' # DESC 'NT pwdMustChange' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) ## ## string settings ## #attributetype ( 1.3.6.1.4.1.7165.2.1.10 NAME 'homeDrive' # DESC 'NT homeDrive' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.11 NAME 'scriptPath' # DESC 'NT scriptPath' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.12 NAME 'profilePath' # DESC 'NT profilePath' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.13 NAME 'userWorkstations' # DESC 'userWorkstations' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.17 NAME 'smbHome' # DESC 'smbHome' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} ) #attributetype ( 1.3.6.1.4.1.7165.2.1.18 NAME 'domain' # DESC 'Windows NT domain to which the user belongs' # EQUALITY caseIgnoreIA5Match # SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} ) ## ## user and group RID ## #attributetype ( 1.3.6.1.4.1.7165.2.1.14 NAME 'rid' # DESC 'NT rid' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) #attributetype ( 1.3.6.1.4.1.7165.2.1.15 NAME 'primaryGroupID' # DESC 'NT Group RID' # EQUALITY integerMatch # SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) ## ## The smbPasswordEntry objectclass has been depreciated in favor of the ## sambaAccount objectclass ## #objectclass ( 1.3.6.1.4.1.7165.2.2.1 NAME 'smbPasswordEntry' SUP top AUXILIARY # DESC 'Samba smbpasswd entry' # MUST ( uid $ uidNumber ) # MAY ( lmPassword $ ntPassword $ pwdLastSet $ acctFlags )) #objectclass ( 1.3.6.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL # DESC 'Samba Account' # MUST ( uid $ rid ) # MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $ # logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $ # displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $ # description $ userWorkstations $ primaryGroupID $ domain )) #objectclass ( 1.3.6.1.4.1.7165.2.2.3 NAME 'sambaAccount' SUP top AUXILIARY # DESC 'Samba Auxiliary Account' # MUST ( uid $ rid ) # MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $ # logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $ # displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $ # description $ userWorkstations $ primaryGroupID $ domain )) ######################################################################## ## END OF HISTORICAL ## ######################################################################## ####################################################################### ## Attributes used by Samba 3.0 schema ## ####################################################################### ## ## Password hashes ## attributetype ( 1.3.6.1.4.1.7165.2.1.24 NAME 'sambaLMPassword' DESC 'LanManager Password' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.25 NAME 'sambaNTPassword' DESC 'MD4 hash of the unicode password' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) ## ## Account flags in string format ([UWDX ]) ## attributetype ( 1.3.6.1.4.1.7165.2.1.26 NAME 'sambaAcctFlags' DESC 'Account Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE ) ## ## Password timestamps & policies ## attributetype ( 1.3.6.1.4.1.7165.2.1.27 NAME 'sambaPwdLastSet' DESC 'Timestamp of the last password update' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.28 NAME 'sambaPwdCanChange' DESC 'Timestamp of when the user is allowed to update the password' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.29 NAME 'sambaPwdMustChange' DESC 'Timestamp of when the password will expire' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.30 NAME 'sambaLogonTime' DESC 'Timestamp of last logon' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.31 NAME 'sambaLogoffTime' DESC 'Timestamp of last logoff' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.32 NAME 'sambaKickoffTime' DESC 'Timestamp of when the user will be logged off automatically' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.48 NAME 'sambaBadPasswordCount' DESC 'Bad password attempt count' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.49 NAME 'sambaBadPasswordTime' DESC 'Time of the last bad password attempt' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.55 NAME 'sambaLogonHours' DESC 'Logon Hours' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{42} SINGLE-VALUE ) ## ## string settings ## attributetype ( 1.3.6.1.4.1.7165.2.1.33 NAME 'sambaHomeDrive' DESC 'Driver letter of home directory mapping' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.34 NAME 'sambaLogonScript' DESC 'Logon script path' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.35 NAME 'sambaProfilePath' DESC 'Roaming profile path' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.36 NAME 'sambaUserWorkstations' DESC 'List of user workstations the user is allowed to logon to' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.37 NAME 'sambaHomePath' DESC 'Home directory UNC path' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} ) attributetype ( 1.3.6.1.4.1.7165.2.1.38 NAME 'sambaDomainName' DESC 'Windows NT domain to which the user belongs' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} ) attributetype ( 1.3.6.1.4.1.7165.2.1.47 NAME 'sambaMungedDial' DESC '' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1050} ) attributetype ( 1.3.6.1.4.1.7165.2.1.54 NAME 'sambaPasswordHistory' DESC 'Concatenated MD4 hashes of the unicode passwords used on this account' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} ) ## ## SID, of any type ## attributetype ( 1.3.6.1.4.1.7165.2.1.20 NAME 'sambaSID' DESC 'Security ID' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} SINGLE-VALUE ) ## ## Primary group SID, compatible with ntSid ## attributetype ( 1.3.6.1.4.1.7165.2.1.23 NAME 'sambaPrimaryGroupSID' DESC 'Primary Group Security ID' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.51 NAME 'sambaSIDList' DESC 'Security ID List' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} ) ## ## group mapping attributes ## attributetype ( 1.3.6.1.4.1.7165.2.1.19 NAME 'sambaGroupType' DESC 'NT Group Type' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) ## ## Store info on the domain ## attributetype ( 1.3.6.1.4.1.7165.2.1.21 NAME 'sambaNextUserRid' DESC 'Next NT rid to give our for users' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.22 NAME 'sambaNextGroupRid' DESC 'Next NT rid to give out for groups' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.39 NAME 'sambaNextRid' DESC 'Next NT rid to give out for anything' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.40 NAME 'sambaAlgorithmicRidBase' DESC 'Base at which the samba RID generation algorithm should operate' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.41 NAME 'sambaShareName' DESC 'Share Name' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.42 NAME 'sambaOptionName' DESC 'Option Name' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) attributetype ( 1.3.6.1.4.1.7165.2.1.43 NAME 'sambaBoolOption' DESC 'A boolean option' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.44 NAME 'sambaIntegerOption' DESC 'An integer option' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.45 NAME 'sambaStringOption' DESC 'A string option' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.46 NAME 'sambaStringListOption' DESC 'A string list option' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.7165.2.1.50 NAME 'sambaPrivName' SUP name ) attributetype ( 1.3.6.1.4.1.7165.2.1.52 NAME 'sambaPrivilegeList' DESC 'Privileges List' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{64} ) attributetype ( 1.3.6.1.4.1.7165.2.1.53 NAME 'sambaTrustFlags' DESC 'Trust Password Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) ####################################################################### ## objectClasses used by Samba 3.0 schema ## ####################################################################### ## The X.500 data model (and therefore LDAPv3) says that each entry can ## only have one structural objectclass. OpenLDAP 2.0 does not enforce ## this currently but will in v2.1 ## ## added new objectclass (and OID) for 3.0 to help us deal with backwards ## compatibility with 2.2 installations (e.g. ldapsam_compat) --jerry ## objectclass ( 1.3.6.1.4.1.7165.2.2.6 NAME 'sambaSamAccount' SUP top AUXILIARY DESC 'Samba 3.0 Auxilary SAM Account' MUST ( uid $ sambaSID ) MAY ( cn $ sambaLMPassword $ sambaNTPassword $ sambaPwdLastSet $ sambaLogonTime $ sambaLogoffTime $ sambaKickoffTime $ sambaPwdCanChange $ sambaPwdMustChange $ sambaAcctFlags $ displayName $ sambaHomePath $ sambaHomeDrive $ sambaLogonScript $ sambaProfilePath $ description $ sambaUserWorkstations $ sambaPrimaryGroupSID $ sambaDomainName $ sambaMungedDial $ sambaBadPasswordCount $ sambaBadPasswordTime $ sambaPasswordHistory $ sambaLogonHours)) ## ## Group mapping info ## objectclass ( 1.3.6.1.4.1.7165.2.2.4 NAME 'sambaGroupMapping' SUP top AUXILIARY DESC 'Samba Group Mapping' MUST ( gidNumber $ sambaSID $ sambaGroupType ) MAY ( displayName $ description $ sambaSIDList )) ## ## Trust password for trust relationships (any kind) ## objectclass ( 1.3.6.1.4.1.7165.2.2.14 NAME 'sambaTrustPassword' SUP top STRUCTURAL DESC 'Samba Trust Password' MUST ( sambaDomainName $ sambaNTPassword $ sambaTrustFlags ) MAY ( sambaSID $ sambaPwdLastSet )) ## ## Whole-of-domain info ## objectclass ( 1.3.6.1.4.1.7165.2.2.5 NAME 'sambaDomain' SUP top STRUCTURAL DESC 'Samba Domain Information' MUST ( sambaDomainName $ sambaSID ) MAY ( sambaNextRid $ sambaNextGroupRid $ sambaNextUserRid $ sambaAlgorithmicRidBase ) ) ## ## used for idmap_ldap module ## objectclass ( 1.3.6.1.4.1.7165.2.2.7 NAME 'sambaUnixIdPool' SUP top AUXILIARY DESC 'Pool for allocating UNIX uids/gids' MUST ( uidNumber $ gidNumber ) ) objectclass ( 1.3.6.1.4.1.7165.2.2.8 NAME 'sambaIdmapEntry' SUP top AUXILIARY DESC 'Mapping from a SID to an ID' MUST ( sambaSID ) MAY ( uidNumber $ gidNumber ) ) objectclass ( 1.3.6.1.4.1.7165.2.2.9 NAME 'sambaSidEntry' SUP top STRUCTURAL DESC 'Structural Class for a SID' MUST ( sambaSID ) ) objectclass ( 1.3.6.1.4.1.7165.1.2.2.10 NAME 'sambaConfig' SUP top AUXILIARY DESC 'Samba Configuration Section' MAY ( description ) ) objectclass ( 1.3.6.1.4.1.7165.2.2.11 NAME 'sambaShare' SUP top STRUCTURAL DESC 'Samba Share Section' MUST ( sambaShareName ) MAY ( description ) ) objectclass ( 1.3.6.1.4.1.7165.2.2.12 NAME 'sambaConfigOption' SUP top STRUCTURAL DESC 'Samba Configuration Option' MUST ( sambaOptionName ) MAY ( sambaBoolOption $ sambaIntegerOption $ sambaStringOption $ sambaStringListoption $ description ) ) objectclass ( 1.3.6.1.4.1.7165.2.2.13 NAME 'sambaPrivilege' SUP top AUXILIARY DESC 'Samba Privilege' MUST ( sambaSID ) MAY ( sambaPrivilegeList ) ) smbldap-configure-4.0/templates/smb.conf0000644000000000000000000003073410542664470017121 0ustar rootroot# This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options (perhaps too # many!) most of which are not shown in this example # # Any line which starts with a ; (semi-colon) or a # (hash) # is a comment and is ignored. In this example we will use a # # for commentry and a ; for parts of the config file that you # may wish to enable # # NOTE: Whenever you modify this file you should run the command "testparm" # to check that you have not made any basic syntactic errors. # #======================= Global Settings ===================================== [global] # workgroup = NT-Domain-Name or Workgroup-Name workgroup = WORKGROUP_KEY # Added by moquist netbios name = NETBIOSNAME_KEY # server string is the equivalent of the NT Description field #server string = Samba Server server string = Samba Server %v # This option is important for security. It allows you to restrict # connections to machines which are on your local network. The # following example restricts access to two C class networks and # the "loopback" interface. For more examples of the syntax see # the smb.conf man page ; hosts allow = 192.168.1. 192.168.2. 127. # if you want to automatically load your printer list rather # than setting them up individually then you'll need this printcap name = /etc/printcap load printers = yes utmp = yes # It should not be necessary to spell out the print system type unless # yours is non-standard. Currently supported print systems include: # bsd, sysv, plp, lprng, aix, hpux, qnx ; printing = cups # This option tells cups that the data has already been rasterized cups options = raw # Uncomment this if you want a guest account, you must add this to /etc/passwd # otherwise the user "nobody" is used ; guest account = pcguest # this tells Samba to use a separate log file for each machine # that connects log file = /var/log/samba/log.%m # all log information in one file # log file = /var/log/samba/smbd.log # Put a capping on the size of the log files (in Kb). max log size = 100000 # Security mode. Most people will want user level security. See # security_level.txt for details. security = user # Use password server option only with security = server ; password server = # Password Level allows matching of _n_ characters of the password for # all combinations of upper and lower case. ; password level = 8 ; username level = 8 # You may wish to use password encryption. Please read # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation. # Do not enable this option unless you have read those documents encrypt passwords = yes ; smb passwd file = /etc/samba/smbpasswd # Added by moquist obey pam restrictions = No ldap passwd sync = Yes time server = Yes enable privileges = yes # The following are needed to allow password changing from Windows to # update the Linux system password also. # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above. # NOTE2: You do NOT need these to allow workstations to change only # the encrypted SMB passwords. They allow the Unix password # to be kept in sync with the SMB password. unix password sync = no ; passwd program = /usr/bin/passwd %u ; passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully* passwd program = SMBLDAPTOOLS_PATH_KEY/smbldap-passwd %u # Added by moquist log level = 0 syslog = 0 mangling method = hash2 dos charset = 850 unix charset = ISO8859-1 # Unix users can map to different SMB User names username map = /etc/samba/smbusers # Using the following line enables you to customise your configuration # on a per machine basis. The %m gets replaced with the netbios name # of the machine that is connecting ; include = /etc/samba/smb.conf.%m # Most people will find that this option gives better performance. # See speed.txt and the manual pages for details socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 # Configure Samba to use multiple interfaces # If you have multiple network interfaces then you must list them # here. See the man page for details. ; interfaces = 192.168.12.2/24 192.168.13.2/24 interfaces = INTERFACES_KEY # Configure remote browse list synchronisation here # request announcement to, or browse list sync from: # a specific host or from / to a whole subnet (see below) ; remote browse sync = 192.168.3.25 192.168.5.255 # Cause this host to announce itself to local subnets here ; remote announce = 192.168.1.255 192.168.2.44 # Browser Control Options: # set local master to no if you don't want Samba to become a master # browser on your network. Otherwise the normal election rules apply ; local master = no # OS Level determines the precedence of this server in master browser # elections. The default value should be reasonable ; os level = 33 os level = 65 # Domain Master specifies Samba to be the Domain Master Browser. This # allows Samba to collate browse lists between subnets. Don't use this # if you already have a Windows NT domain controller doing this job ; domain master = yes domain master = DOMAIN_MASTER_KEY # Preferred Master causes Samba to force a local browser election on startup # and gives it a slightly higher chance of winning the election ; preferred master = yes preferred master = PREFERRED_MASTER_KEY # Enable this if you want Samba to be a domain logon server for # Windows95 workstations. ; domain logons = yes domain logons = yes # if you enable domain logons then you may want a per-machine or # per user logon script # run a specific logon batch file per workstation (machine) ; logon script = %m.bat # run a specific logon batch file per username ; logon script = %U.bat logon script = USERSCRIPT_KEY # Added by moquist logon drive = DRIVE_LETTER_KEY: logon home = passdb backend = ldapsam:ldap://127.0.0.1/ ldap admin dn = cn=SAMBA_BIND_USER_KEY,DC_DOMAIN_KEY ldap suffix = DC_DOMAIN_KEY ldap group suffix = ou=Groups ldap user suffix = ou=Users ldap machine suffix = ou=Computers ldap idmap suffix = ou=Users idmap backend = ldap://MASTER_HOST_KEY #ldap ssl = start tls ldap delete dn = Yes # use the smbldap-tools scripts add user script = SMBLDAPTOOLS_PATH_KEY/smbldap-useradd -m "%u" delete user script = SMBLDAPTOOLS_PATH_KEY/smbldap-userdel "%u" add machine script = SMBLDAPTOOLS_PATH_KEY/smbldap-useradd -w "%u" add group script = SMBLDAPTOOLS_PATH_KEY/smbldap-groupadd -p "%g" delete group script = SMBLDAPTOOLS_PATH_KEY/smbldap-groupdel "%g" add user to group script = SMBLDAPTOOLS_PATH_KEY/smbldap-groupmod -m "%u" "%g" delete user from group script = SMBLDAPTOOLS_PATH_KEY/smbldap-groupmod -x "%u" "%g" set primary group script = SMBLDAPTOOLS_PATH_KEY/smbldap-usermod -g "%g" "%u" # Where to store roving profiles (only for Win95 and WinNT) # %L substitutes for this servers netbios name, %U is username # You must uncomment the [Profiles] share below ; logon path = \\%L\Profiles\%U logon path = # All NetBIOS names must be resolved to IP Addresses # 'Name Resolve Order' allows the named resolution mechanism to be specified # the default order is "host lmhosts wins bcast". "host" means use the unix # system gethostbyname() function call that will use either /etc/hosts OR # DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf # and the /etc/resolv.conf file. "host" therefore is system configuration # dependant. This parameter is most often of use to prevent DNS lookups # in order to resolve NetBIOS names to IP Addresses. Use with care! # The example below excludes use of name resolution for machines that are NOT # on the local network segment # - OR - are not deliberately to be known via lmhosts or via WINS. ; name resolve order = wins lmhosts bcast # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server ; wins support = yes wins support = yes # WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z # WINS Proxy - Tells Samba to answer name resolution queries on # behalf of a non WINS capable client, for this to work there must be # at least one WINS Server on the network. The default is NO. ; wins proxy = yes # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names # via DNS nslookups. The built-in default for versions 1.9.17 is yes, # this has been changed in version 1.9.18 to no. # dns proxy = no # Case Preservation can be handy - system default is _no_ # NOTE: These can be set on a per share basis ; preserve case = no ; short preserve case = no # Default case is normally upper case for all DOS files ; default case = lower # Be very careful with case sensitivity - it can break things! ; case sensitive = no #============================ Share Definitions ============================== idmap uid = 16777216-33554431 idmap gid = 16777216-33554431 template shell = /bin/false winbind use default domain = no [homes] comment = Home Directories valid users = %S browseable = yes writable = yes #create mask = 0664 #directory mask = 0775 # this prevents users from browsing other peoples' files create mask = 0600 directory mask = 0700 # Un-comment the following and create the netlogon directory for Domain Logons [netlogon] comment = Network Logon Service path = SMB_NETLOGON_PATH_KEY [profiles] path = SMB_PROFILES_PATH_KEY writeable = yes browseable = no #create mode = 0644 #directory mode = 0755 # this prevents users from browsing other peoples' profiles create mode = 0600 directory mode = 0700 # Un-comment the following to provide a specific roving profile share # the default is to use the user's home directory ;[Profiles] ; path = /home/profiles ; browseable = no ; guest ok = yes # NOTE: If you have a BSD-style print system there is no need to # specifically define each individual printer [printers] comment = All Printers path = /var/spool/samba browseable = no printable = yes # Set public = yes to allow user 'guest account' to print # This one is useful for people to share files ;[tmp] ; comment = Temporary file space ; path = /tmp ; read only = no ; public = yes # A publicly accessible directory, but read only, except for people in # the "staff" group ;[public] ; comment = Public Stuff ; path = /home/samba ; public = yes ; read only = yes ; write list = @staff # Other examples. # # A private printer, usable only by fred. Spool data will be placed in fred's # home directory. Note that fred must have write access to the spool directory, # wherever it is. ;[fredsprn] ; comment = Fred's Printer ; valid users = fred ; path = /homes/fred ; printer = freds_printer ; public = no ; writable = no ; printable = yes # A private directory, usable only by fred. Note that fred requires write # access to the directory. ;[fredsdir] ; comment = Fred's Service ; path = /usr/somewhere/private ; valid users = fred ; public = no ; writable = yes ; printable = no # a service which has a different directory for each machine that connects # this allows you to tailor configurations to incoming machines. You could # also use the %u option to tailor it by user name. # The %m gets replaced with the machine name that is connecting. ;[pchome] ; comment = PC Directories ; path = /usr/pc/%m ; public = no ; writable = yes # A publicly accessible directory, read/write to all users. Note that all files # created in the directory by users will be owned by the default user, so # any user with access can delete any other user's files. Obviously this # directory must be writable by the default user. Another user could of course # be specified, in which case all files would be owned by that user instead. ;[public] ; path = /usr/somewhere/else/public ; public = yes ; only guest = yes ; writable = yes ; printable = no # The following two entries demonstrate how to share a directory so that two # users can place files there that will be owned by the specific users. In this # setup, the directory should be writable by both users and should have the # sticky bit set on it to prevent abuse. Obviously this could be extended to # as many users as required. ;[myshare] ; comment = Mary's and Fred's stuff ; path = /usr/somewhere/shared ; valid users = mary fred ; public = no ; writable = yes ; printable = no ; create mask = 0765 smbldap-configure-4.0/templates/ubuntu_libnss_ldap.conf0000644000000000000000000002162610451541463022227 0ustar rootroot###DEBCONF### # the configuration of this file will be done by debconf as long as the # first line of the file says '###DEBCONF###' # # you should use dpkg-reconfigure libnss-ldap to configure this file. # @(#)$Id: ldap.conf,v 2.41 2005/03/23 08:30:16 lukeh Exp $ # # This is the configuration file for the LDAP nameservice # switch library and the LDAP PAM module. # # PADL Software # http://www.padl.com # # Your LDAP server. Must be resolvable without using LDAP. # Multiple hosts may be specified, each separated by a # space. How long nss_ldap takes to failover depends on # whether your LDAP client library supports configurable # network or connect timeouts (see bind_timelimit). host MASTER_HOST_KEY # The distinguished name of the search base. base DC_DOMAIN_KEY # Another way to specify your LDAP server is to provide an # uri with the server name. This allows to use # Unix Domain Sockets to connect to a local LDAP Server. #uri ldap://127.0.0.1/ #uri ldaps://127.0.0.1/ #uri ldapi://%2fvar%2frun%2fldapi_sock/ # Note: %2f encodes the '/' used as directory separator # The LDAP version to use (defaults to 3 # if supported by client library) ldap_version 3 # The distinguished name to bind to the server with. # Optional: default is to bind anonymously. #binddn cn=proxyuser,dc=padl,dc=com # The credentials to bind with. # Optional: default is no credential. #bindpw secret # The distinguished name to bind to the server with # if the effective user ID is root. Password is # stored in /etc/ldap.secret (mode 600) #rootbinddn cn=manager,dc=padl,dc=com # The port. # Optional: default is 389. #port 389 # The search scope. #scope sub #scope one #scope base # Search timelimit #timelimit 30 # Bind/connect timelimit #bind_timelimit 30 # Reconnect policy: # hard_open: reconnect to DSA with exponential backoff if # opening connection failed # hard_init: reconnect to DSA with exponential backoff if # initializing connection failed # hard: alias for hard_open # soft: return immediately on server failure #bind_policy hard # Idle timelimit; client will close connections # (nss_ldap only) if the server has not been contacted # for the number of seconds specified below. #idle_timelimit 3600 # Pagesize: when configured with --enable-paged-results allow # to set the pagesize to a custom value #pagesize 1000 # Filter to AND with uid=%s #pam_filter objectclass=account # The user ID attribute (defaults to uid) #pam_login_attribute uid # Search the root DSE for the password policy (works # with Netscape Directory Server) #pam_lookup_policy yes # Check the 'host' attribute for access control # Default is no; if set to yes, and user has no # value for the host attribute, and pam_ldap is # configured for account management (authorization) # then the user will not be allowed to login. #pam_check_host_attr yes # Check the 'authorizedService' attribute for access # control # Default is no; if set to yes, and the user has no # value for the authorizedService attribute, and # pam_ldap is configured for account management # (authorization) then the user will not be allowed # to login. #pam_check_service_attr yes # Group to enforce membership of #pam_groupdn cn=PAM,ou=Groups,dc=padl,dc=com # Group member attribute #pam_member_attribute uniquemember # Specify a minium or maximum UID number allowed #pam_min_uid 0 #pam_max_uid 0 # Template login attribute, default template user # (can be overriden by value of former attribute # in user's entry) #pam_login_attribute userPrincipalName #pam_template_login_attribute uid #pam_template_login nobody # HEADS UP: the pam_crypt, pam_nds_passwd, # and pam_ad_passwd options are no # longer supported. # # If you are using XAD, you can set pam_password # to racf, ad, or exop. Make sure that you have # SSL enabled. # Do not hash the password at all; presume # the directory server will do it, if # necessary. This is the default. #pam_password clear # Hash password locally; required for University of # Michigan LDAP server, and works with Netscape # Directory Server if you're using the UNIX-Crypt # hash mechanism and not using the NT Synchronization # service. #pam_password crypt # Remove old password first, then update in # cleartext. Necessary for use with Novell # Directory Services (NDS) #pam_password nds # RACF is an alias for the above. For use with # IBM RACF #pam_password racf # Update Active Directory password, by # creating Unicode password and updating # unicodePwd attribute. #pam_password ad # Use the OpenLDAP password change # extended operation to update the password. #pam_password exop # Redirect users to a URL or somesuch on password # changes. #pam_password_prohibit_message Please visit http://internal to change your password. # RFC2307bis naming contexts # Syntax: # nss_base_XXX base?scope?filter # where scope is {base,one,sub} # and filter is a filter to be &'d with the # default filter. # You can omit the suffix eg: # nss_base_passwd ou=People, # to append the default base DN but this # may incur a small performance impact. #nss_base_passwdou=People,dc=padl,dc=com?one #nss_base_shadowou=People,dc=padl,dc=com?one #nss_base_group ou=Group,dc=padl,dc=com?one #nss_base_hosts ou=Hosts,dc=padl,dc=com?one #nss_base_servicesou=Services,dc=padl,dc=com?one #nss_base_networksou=Networks,dc=padl,dc=com?one #nss_base_protocolsou=Protocols,dc=padl,dc=com?one #nss_base_rpc ou=Rpc,dc=padl,dc=com?one #nss_base_ethersou=Ethers,dc=padl,dc=com?one #nss_base_netmasksou=Networks,dc=padl,dc=com?ne #nss_base_bootparamsou=Ethers,dc=padl,dc=com?one #nss_base_aliasesou=Aliases,dc=padl,dc=com?one #nss_base_netgroupou=Netgroup,dc=padl,dc=com?one # attribute/objectclass mapping # Syntax: #nss_map_attributerfc2307attribute mapped_attribute #nss_map_objectclassrfc2307objectclass mapped_objectclass # configure --enable-nds is no longer supported. # NDS mappings #nss_map_attribute uniqueMember member # Services for UNIX 3.5 mappings #nss_map_objectclass posixAccount User #nss_map_objectclass shadowAccount User #nss_map_attribute uid msSFU30Name #nss_map_attribute uniqueMember msSFU30PosixMember #nss_map_attribute userPassword msSFU30Password #nss_map_attribute homeDirectory msSFU30HomeDirectory #nss_map_attribute homeDirectory msSFUHomeDirectory #nss_map_objectclass posixGroup Group #pam_login_attribute msSFU30Name #pam_filter objectclass=User #pam_password ad # configure --enable-mssfu-schema is no longer supported. # Services for UNIX 2.0 mappings #nss_map_objectclass posixAccount User #nss_map_objectclass shadowAccount user #nss_map_attribute uid msSFUName #nss_map_attribute uniqueMember posixMember #nss_map_attribute userPassword msSFUPassword #nss_map_attribute homeDirectory msSFUHomeDirectory #nss_map_attribute shadowLastChange pwdLastSet #nss_map_objectclass posixGroup Group #nss_map_attribute cn msSFUName #pam_login_attribute msSFUName #pam_filter objectclass=User #pam_password ad # RFC 2307 (AD) mappings #nss_map_objectclass posixAccount user #nss_map_objectclass shadowAccount user #nss_map_attribute uid sAMAccountName #nss_map_attribute homeDirectory unixHomeDirectory #nss_map_attribute shadowLastChange pwdLastSet #nss_map_objectclass posixGroup group #nss_map_attribute uniqueMember member #pam_login_attribute sAMAccountName #pam_filter objectclass=User #pam_password ad # configure --enable-authpassword is no longer supported # AuthPassword mappings #nss_map_attribute userPassword authPassword # AIX SecureWay mappings #nss_map_objectclass posixAccount aixAccount #nss_base_passwd ou=aixaccount,?one #nss_map_attribute uid userName #nss_map_attribute gidNumber gid #nss_map_attribute uidNumber uid #nss_map_attribute userPassword passwordChar #nss_map_objectclass posixGroup aixAccessGroup #nss_base_group ou=aixgroup,?one #nss_map_attribute cn groupName #nss_map_attribute uniqueMember member #pam_login_attribute userName #pam_filter objectclass=aixAccount #pam_password clear # Netscape SDK LDAPS #ssl on # Netscape SDK SSL options #sslpath /etc/ssl/certs/cert7.db # OpenLDAP SSL mechanism # start_tls mechanism uses the normal LDAP port, LDAPS typically 636 #ssl start_tls #ssl on # OpenLDAP SSL options # Require and verify server certificate (yes/no) # Default is to use libldap's default behavior, which can be configured in # /etc/openldap/ldap.conf using the TLS_REQCERT setting. The default for # OpenLDAP 2.0 and earlier is "no", for 2.1 and later is "yes". #tls_checkpeer yes # CA certificates for server certificate verification # At least one of these are required if tls_checkpeer is "yes" #tls_cacertfile /etc/ssl/ca.cert #tls_cacertdir /etc/ssl/certs # Seed the PRNG if /dev/urandom is not provided #tls_randfile /var/run/egd-pool # SSL cipher suite # See man ciphers for syntax #tls_ciphers TLSv1 # Client certificate and key # Use these, if your server requires client authentication. #tls_cert #tls_key # Disable SASL security layers. This is needed for AD. #sasl_secprops maxssf=0 # Override the default Kerberos ticket cache location. #krb5_ccname FILE:/etc/.ldapcache smbldap-configure-4.0/templates/smbldap.conf0000644000000000000000000001456610452654015017761 0ustar rootroot# $Source: /opt/cvs/samba/smbldap-tools/smbldap.conf,v $ # $Id: smbldap.conf,v 1.15 2004/10/14 09:53:14 jtournier Exp $ # # smbldap-tools.conf : Q & D configuration file for smbldap-tools # This code was developped by IDEALX (http://IDEALX.org/) and # contributors (their names can be found in the CONTRIBUTORS file). # # Copyright (C) 2001-2002 IDEALX # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # Purpose : # . be the configuration file for all smbldap-tools scripts ############################################################################## # # General Configuration # ############################################################################## # Put your own SID # to obtain this number do: net getlocalsid SID="SID_KEY" ############################################################################## # # LDAP Configuration # ############################################################################## # Notes: to use to dual ldap servers backend for Samba, you must patch # Samba with the dual-head patch from IDEALX. If not using this patch # just use the same server for slaveLDAP and masterLDAP. # Those two servers declarations can also be used when you have # . one master LDAP server where all writing operations must be done # . one slave LDAP server where all reading operations must be done # (typically a replication directory) # Ex: slaveLDAP=127.0.0.1 slaveLDAP="SLAVE_HOST_KEY" slavePort="389" # Master LDAP : needed for write operations # Ex: masterLDAP=127.0.0.1 masterLDAP="MASTER_HOST_KEY" masterPort="389" # Use TLS for LDAP # If set to 1, this option will use start_tls for connection # (you should also used the port 389) ldapTLS="0" # How to verify the server's certificate (none, optional or require) # see "man Net::LDAP" in start_tls section for more details verify="require" # CA certificate # see "man Net::LDAP" in start_tls section for more details cafile="/etc/smbldap-tools/ca.pem" # certificate to use to connect to the ldap server # see "man Net::LDAP" in start_tls section for more details clientcert="/etc/smbldap-tools/smbldap-tools.pem" # key certificate to use to connect to the ldap server # see "man Net::LDAP" in start_tls section for more details clientkey="/etc/smbldap-tools/smbldap-tools.key" # LDAP Suffix # Ex: suffix=dc=IDEALX,dc=ORG suffix="DC_DOMAIN_KEY" # Where are stored Users # Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG" usersdn="ou=Users,DC_DOMAIN_KEY" # Where are stored Computers # Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG" computersdn="ou=Computers,DC_DOMAIN_KEY" # Where are stored Groups # Ex groupsdn="ou=Groups,dc=IDEALX,dc=ORG" groupsdn="ou=Groups,DC_DOMAIN_KEY" # Where are stored Idmap entries (used if samba is a domain member server) # Ex groupsdn="ou=Idmap,dc=IDEALX,dc=ORG" idmapdn="ou=Idmap,DC_DOMAIN_KEY" # Where to store next uidNumber and gidNumber available sambaUnixIdPooldn="cn=NextFreeUnixId,DC_DOMAIN_KEY" # Default scope Used scope="sub" # Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA) hash_encrypt="SSHA" # if hash_encrypt is set to CRYPT, you may set a salt format. # default is "%s", but many systems will generate MD5 hashed # passwords if you use "$1$%.8s". This parameter is optional! crypt_salt_format="%s" ############################################################################## # # Unix Accounts Configuration # ############################################################################## # Login defs # Default Login Shell # Ex: userLoginShell="/bin/bash" userLoginShell="/bin/bash" # Home directory # Ex: userHome="/home/%U" userHome="/home/%U" # Home directory prefix (without username) # Ex: userHomePrefix="/home/" userHomePrefix="/home/" # Gecos userGecos="System User" # Default User (POSIX and Samba) GID defaultUserGid="513" # Default Computer (Samba) GID defaultComputerGid="515" # Skel dir skeletonDir="/etc/skel" # Default password validation time (time in days) Comment the next line if # you don't want password to be enable for defaultMaxPasswordAge days (be # careful to the sambaPwdMustChange attribute's value) defaultMaxPasswordAge="MAX_PASSWORD_AGE_KEY" ############################################################################## # # SAMBA Configuration # ############################################################################## # The UNC path to home drives location (%U username substitution) # Ex: \\My-PDC-netbios-name\homes\%U # Just set it to a null string if you want to use the smb.conf 'logon home' # directive and/or disable roaming profiles userSmbHome="\\NETBIOSNAME_KEY\homes\%U" # The UNC path to profiles locations (%U username substitution) # Ex: \\My-PDC-netbios-name\profiles\%U # Just set it to a null string if you want to use the smb.conf 'logon path' # directive and/or disable roaming profiles userProfile="\\NETBIOSNAME_KEY\profiles\%U" # The default Home Drive Letter mapping # (will be automatically mapped at logon time if home directory exist) # Ex: H: for H: userHomeDrive="DRIVE_LETTER_KEY:" # The default user netlogon script name (%U username substitution) # if not used, will be automatically username.cmd # make sure script file is edited under dos # Ex: %U.cmd # userScript="startup.cmd" # make sure script file is edited under dos userScript="USERSCRIPT_KEY" # Domain appended to the users "mail"-attribute # when smbldap-useradd -M is used mailDomain="MAIL_DOMAIN_KEY" ############################################################################## # # SMBLDAP-TOOLS Configuration (default are ok for a RedHat) # ############################################################################## # Allows not to use smbpasswd (if with_smbpasswd == 0 in smbldap_conf.pm) but # prefer Crypt::SmbHash library with_smbpasswd="0" smbpasswd="/usr/bin/smbpasswd" mk_ntpasswd="/usr/local/sbin/mkntpwd" smbldap-configure-4.0/templates/openldap_ldap.conf0000644000000000000000000000060210444707437021133 0ustar rootroot# $OpenLDAP: pkg/ldap/libraries/libldap/ldap.conf,v 1.9 2000/09/04 19:57:01 kurt Exp $ # # LDAP Defaults # # See ldap.conf(5) for details # This file should be world readable but not world writable. #BASE dc=example, dc=com #URI ldap://ldap.example.com ldap://ldap-master.example.com:666 #SIZELIMIT 12 #TIMELIMIT 15 #DEREF never HOST 127.0.0.1 BASE DC_DOMAIN_KEY TLS_REQCERT allow smbldap-configure-4.0/templates/ubuntu-ldap/0000755000000000000000000000000010263351733017715 5ustar rootrootsmbldap-configure-4.0/templates/ubuntu-ldap/common-account0000644000000000000000000000064710263351613022566 0ustar rootroot# # /etc/pam.d/common-account - authorization settings common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of the authorization modules that define # the central access policy for use on the system. The default is to # only deny service to users whose accounts are expired in /etc/shadow. # account sufficient pam_ldap.so account required pam_unix.so smbldap-configure-4.0/templates/ubuntu-ldap/common-session0000644000000000000000000000062310263351703022607 0ustar rootroot# # /etc/pam.d/common-session - session-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define tasks to be performed # at the start and end of sessions of *any* kind (both interactive and # non-interactive). The default is pam_unix. # session sufficient pam_ldap.so session required pam_unix.so smbldap-configure-4.0/templates/ubuntu-ldap/common-auth0000644000000000000000000000073710263351627022100 0ustar rootroot# # /etc/pam.d/common-auth - authentication settings common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of the authentication modules that define # the central authentication scheme for use on the system # (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the # traditional Unix authentication mechanisms. # auth sufficient pam_ldap.so auth required pam_unix.so nullok_secure use_first_pass smbldap-configure-4.0/templates/ubuntu-ldap/nsswitch.conf0000644000000000000000000000073510263351733022433 0ustar rootroot# /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: files ldap group: files ldap shadow: files ldap hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis smbldap-configure-4.0/templates/ubuntu-ldap/common-password0000644000000000000000000000214510263351656022776 0ustar rootroot# # /etc/pam.d/common-password - password-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define the services to be #used to change user passwords. The default is pam_unix # The "nullok" option allows users to change an empty password, else # empty passwords are treated as locked accounts. # # (Add `md5' after the module name to enable MD5 passwords) # # The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in # login.defs. Also the "min" and "max" options enforce the length of the # new password. password sufficient pam_ldap.so password required pam_unix.so nullok obscure min=4 max=8 md5 # Alternate strength checking for password. Note that this # requires the libpam-cracklib package to be installed. # You will need to comment out the password line above and # uncomment the next two in order to use this. # (Replaces the `OBSCURE_CHECKS_ENAB', `CRACKLIB_DICTPATH') # # password required pam_cracklib.so retry=3 minlen=6 difok=3 # password required pam_unix.so use_authtok nullok md5 smbldap-configure-4.0/templates/smbldap_bind.conf0000600000000000000000000000072610452654761020746 0ustar rootroot############################ # Credential Configuration # ############################ # Notes: you can specify two differents configuration if you use a # master ldap for writing access and a slave ldap server for reading access # By default, we will use the same DN (so it will work for standard Samba # release) slaveDN="cn=REPLICA_BIND_USER_KEY,DC_DOMAIN_KEY" slavePw="SLAVE_PASSWORD_KEY" masterDN="cn=MANAGER_USER_KEY,DC_DOMAIN_KEY" masterPw="MASTER_PASSWORD_KEY" smbldap-configure-4.0/templates/smbusers0000644000000000000000000000014210162146575017244 0ustar rootroot# Unix_name = SMB_name1 SMB_name2 ... #root = administrator admin nobody = guest pcguest smbguest smbldap-configure-4.0/templates/ubuntu_pam_ldap.conf0000644000000000000000000002144610451541441021506 0ustar rootroot###DEBCONF### # the configuration of this file will be done by debconf as long as the # first line of the file says '###DEBCONF###' # # you should use dpkg-reconfigure to configure this file # # @(#)$Id: ldap.conf,v 1.36 2005/03/23 08:29:59 lukeh Exp $ # # This is the configuration file for the LDAP nameservice # switch library and the LDAP PAM module. # # PADL Software # http://www.padl.com # # Your LDAP server. Must be resolvable without using LDAP. # Multiple hosts may be specified, each separated by a # space. How long nss_ldap takes to failover depends on # whether your LDAP client library supports configurable # network or connect timeouts (see bind_timelimit). host MASTER_HOST_KEY # The distinguished name of the search base. base DC_DOMAIN_KEY # Another way to specify your LDAP server is to provide an # uri with the server name. This allows to use # Unix Domain Sockets to connect to a local LDAP Server. #uri ldap://127.0.0.1/ #uri ldaps://127.0.0.1/ #uri ldapi://%2fvar%2frun%2fldapi_sock/ # Note: %2f encodes the '/' used as directory separator # The LDAP version to use (defaults to 3 # if supported by client library) ldap_version 3 # The distinguished name to bind to the server with. # Optional: default is to bind anonymously. #binddn cn=proxyuser,dc=padl,dc=com # The credentials to bind with. # Optional: default is no credential. #bindpw secret # The distinguished name to bind to the server with # if the effective user ID is root. Password is # stored in /etc/pam_ldap.secret (mode 600) rootbinddn cn=manager,DC_DOMAIN_KEY # The port. # Optional: default is 389. #port 389 # The search scope. #scope sub #scope one #scope base # Search timelimit #timelimit 30 # Bind/connect timelimit #bind_timelimit 30 # Reconnect policy: hard (default) will retry connecting to # the software with exponential backoff, soft will fail # immediately. #bind_policy hard # Idle timelimit; client will close connections # (nss_ldap only) if the server has not been contacted # for the number of seconds specified below. #idle_timelimit 3600 # Filter to AND with uid=%s #pam_filter objectclass=account # The user ID attribute (defaults to uid) #pam_login_attribute uid # Search the root DSE for the password policy (works # with Netscape Directory Server) #pam_lookup_policy yes # Check the 'host' attribute for access control # Default is no; if set to yes, and user has no # value for the host attribute, and pam_ldap is # configured for account management (authorization) # then the user will not be allowed to login. #pam_check_host_attr yes # Check the 'authorizedService' attribute for access # control # Default is no; if set to yes, and the user has no # value for the authorizedService attribute, and # pam_ldap is configured for account management # (authorization) then the user will not be allowed # to login. #pam_check_service_attr yes # Group to enforce membership of #pam_groupdn cn=PAM,ou=Groups,dc=padl,dc=com # Group member attribute #pam_member_attribute uniquemember # Specify a minium or maximum UID number allowed #pam_min_uid 0 #pam_max_uid 0 # Template login attribute, default template user # (can be overriden by value of former attribute # in user's entry) #pam_login_attribute userPrincipalName #pam_template_login_attribute uid #pam_template_login nobody # HEADS UP: the pam_crypt, pam_nds_passwd, # and pam_ad_passwd options are no # longer supported. # # If you are using XAD, you can set pam_password # to racf, ad, or exop. Make sure that you have # SSL enabled. # Do not hash the password at all; presume # the directory server will do it, if # necessary. This is the default. pam_password crypt # Hash password locally; required for University of # Michigan LDAP server, and works with Netscape # Directory Server if you're using the UNIX-Crypt # hash mechanism and not using the NT Synchronization # service. #pam_password crypt # Remove old password first, then update in # cleartext. Necessary for use with Novell # Directory Services (NDS) #pam_password clear_remove_old #pam_password nds # RACF is an alias for the above. For use with # IBM RACF #pam_password racf # Update Active Directory password, by # creating Unicode password and updating # unicodePwd attribute. #pam_password ad # Use the OpenLDAP password change # extended operation to update the password. #pam_password exop # Redirect users to a URL or somesuch on password # changes. #pam_password_prohibit_message Please visit http://internal to change your password. # RFC2307bis naming contexts # Syntax: # nss_base_XXX base?scope?filter # where scope is {base,one,sub} # and filter is a filter to be &'d with the # default filter. # You can omit the suffix eg: # nss_base_passwd ou=People, # to append the default base DN but this # may incur a small performance impact. #nss_base_passwd ou=People,dc=padl,dc=com?one #nss_base_shadow ou=People,dc=padl,dc=com?one #nss_base_group ou=Group,dc=padl,dc=com?one #nss_base_hosts ou=Hosts,dc=padl,dc=com?one #nss_base_services ou=Services,dc=padl,dc=com?one #nss_base_networks ou=Networks,dc=padl,dc=com?one #nss_base_protocols ou=Protocols,dc=padl,dc=com?one #nss_base_rpc ou=Rpc,dc=padl,dc=com?one #nss_base_ethers ou=Ethers,dc=padl,dc=com?one #nss_base_netmasks ou=Networks,dc=padl,dc=com?ne #nss_base_bootparams ou=Ethers,dc=padl,dc=com?one #nss_base_aliases ou=Aliases,dc=padl,dc=com?one #nss_base_netgroup ou=Netgroup,dc=padl,dc=com?one # attribute/objectclass mapping # Syntax: #nss_map_attribute rfc2307attribute mapped_attribute #nss_map_objectclass rfc2307objectclass mapped_objectclass # configure --enable-nds is no longer supported. # NDS mappings #nss_map_attribute uniqueMember member # Services for UNIX 3.5 mappings #nss_map_objectclass posixAccount User #nss_map_objectclass shadowAccount User #nss_map_attribute uid msSFU30Name #nss_map_attribute uniqueMember msSFU30PosixMember #nss_map_attribute userPassword msSFU30Password #nss_map_attribute homeDirectory msSFU30HomeDirectory #nss_map_attribute homeDirectory msSFUHomeDirectory #nss_map_objectclass posixGroup Group #pam_login_attribute msSFU30Name #pam_filter objectclass=User #pam_password ad # configure --enable-mssfu-schema is no longer supported. # Services for UNIX 2.0 mappings #nss_map_objectclass posixAccount User #nss_map_objectclass shadowAccount user #nss_map_attribute uid msSFUName #nss_map_attribute uniqueMember posixMember #nss_map_attribute userPassword msSFUPassword #nss_map_attribute homeDirectory msSFUHomeDirectory #nss_map_attribute shadowLastChange pwdLastSet #nss_map_objectclass posixGroup Group #nss_map_attribute cn msSFUName #pam_login_attribute msSFUName #pam_filter objectclass=User #pam_password ad # RFC 2307 (AD) mappings #nss_map_objectclass posixAccount user #nss_map_objectclass shadowAccount user #nss_map_attribute uid sAMAccountName #nss_map_attribute homeDirectory unixHomeDirectory #nss_map_attribute shadowLastChange pwdLastSet #nss_map_objectclass posixGroup group #nss_map_attribute uniqueMember member #pam_login_attribute sAMAccountName #pam_filter objectclass=User #pam_password ad # configure --enable-authpassword is no longer supported # AuthPassword mappings #nss_map_attribute userPassword authPassword # AIX SecureWay mappings #nss_map_objectclass posixAccount aixAccount #nss_base_passwd ou=aixaccount,?one #nss_map_attribute uid userName #nss_map_attribute gidNumber gid #nss_map_attribute uidNumber uid #nss_map_attribute userPassword passwordChar #nss_map_objectclass posixGroup aixAccessGroup #nss_base_group ou=aixgroup,?one #nss_map_attribute cn groupName #nss_map_attribute uniqueMember member #pam_login_attribute userName #pam_filter objectclass=aixAccount #pam_password clear # Netscape SDK LDAPS #ssl on # Netscape SDK SSL options #sslpath /etc/ssl/certs/cert7.db # OpenLDAP SSL mechanism # start_tls mechanism uses the normal LDAP port, LDAPS typically 636 #ssl start_tls #ssl on # OpenLDAP SSL options # Require and verify server certificate (yes/no) # Default is to use libldap's default behavior, which can be configured in # /etc/openldap/ldap.conf using the TLS_REQCERT setting. The default for # OpenLDAP 2.0 and earlier is "no", for 2.1 and later is "yes". #tls_checkpeer yes # CA certificates for server certificate verification # At least one of these are required if tls_checkpeer is "yes" #tls_cacertfile /etc/ssl/ca.cert #tls_cacertdir /etc/ssl/certs # Seed the PRNG if /dev/urandom is not provided #tls_randfile /var/run/egd-pool # SSL cipher suite # See man ciphers for syntax #tls_ciphers TLSv1 # Client certificate and key # Use these, if your server requires client authentication. #tls_cert #tls_key # Disable SASL security layers. This is needed for AD. #sasl_secprops maxssf=0 # Override the default Kerberos ticket cache location. #krb5_ccname FILE:/etc/.ldapcache # SASL mechanism for PAM authentication - use is experimental # at present and does not support password policy control #pam_sasl_mech DIGEST-MD5 smbldap-configure-4.0/templates/etc_ldap.conf0000644000000000000000000001621111001255705020071 0ustar rootroot# @(#)$Id: etc_ldap.conf,v 1.1 2006/06/29 04:22:20 moquist Exp moquist $ # # This is the configuration file for the LDAP nameservice # switch library and the LDAP PAM module. # # PADL Software # http://www.padl.com # # Your LDAP server. Must be resolvable without using LDAP. # Multiple hosts may be specified, each separated by a # space. How long nss_ldap takes to failover depends on # whether your LDAP client library supports configurable # network or connect timeouts (see bind_timelimit). host 127.0.0.1 # The distinguished name of the search base. base DC_DOMAIN_KEY # Another way to specify your LDAP server is to provide an # uri with the server name. This allows to use # Unix Domain Sockets to connect to a local LDAP Server. #uri ldap://127.0.0.1/ #uri ldaps://127.0.0.1/ #uri ldapi://%2fvar%2frun%2fldapi_sock/ # Note: %2f encodes the '/' used as directory separator # The LDAP version to use (defaults to 3 # if supported by client library) #ldap_version 3 # The distinguished name to bind to the server with. # Optional: default is to bind anonymously. #binddn cn=proxyuser,dc=example,dc=com # The credentials to bind with. # Optional: default is no credential. #bindpw secret # The distinguished name to bind to the server with # if the effective user ID is root. Password is # stored in /etc/ldap.secret (mode 600) #rootbinddn cn=manager,dc=example,dc=com rootbinddn cn=nssldap,ou=DSA,DC_DOMAIN_KEY # The port. # Optional: default is 389. #port 389 # The search scope. #scope sub #scope one #scope base # Search timelimit #timelimit 30 # Bind timelimit #bind_timelimit 30 # Idle timelimit; client will close connections # (nss_ldap only) if the server has not been contacted # for the number of seconds specified below. #idle_timelimit 3600 # Filter to AND with uid=%s #pam_filter objectclass=account # The user ID attribute (defaults to uid) #pam_login_attribute uid # Search the root DSE for the password policy (works # with Netscape Directory Server) #pam_lookup_policy yes # Check the 'host' attribute for access control # Default is no; if set to yes, and user has no # value for the host attribute, and pam_ldap is # configured for account management (authorization) # then the user will not be allowed to login. #pam_check_host_attr yes # Check the 'authorizedService' attribute for access # control # Default is no; if set to yes, and the user has no # value for the authorizedService attribute, and # pam_ldap is configured for account management # (authorization) then the user will not be allowed # to login. #pam_check_service_attr yes # Group to enforce membership of #pam_groupdn cn=PAM,ou=Groups,dc=example,dc=com # Group member attribute #pam_member_attribute uniquemember # Specify a minium or maximum UID number allowed #pam_min_uid 0 #pam_max_uid 0 # Template login attribute, default template user # (can be overriden by value of former attribute # in user's entry) #pam_login_attribute userPrincipalName #pam_template_login_attribute uid #pam_template_login nobody # HEADS UP: the pam_crypt, pam_nds_passwd, # and pam_ad_passwd options are no # longer supported. # Do not hash the password at all; presume # the directory server will do it, if # necessary. This is the default. #pam_password clear # Hash password locally; required for University of # Michigan LDAP server, and works with Netscape # Directory Server if you're using the UNIX-Crypt # hash mechanism and not using the NT Synchronization # service. #pam_password crypt # Remove old password first, then update in # cleartext. Necessary for use with Novell # Directory Services (NDS) #pam_password nds # Update Active Directory password, by # creating Unicode password and updating # unicodePwd attribute. #pam_password ad # Use the OpenLDAP password change # extended operation to update the password. #pam_password exop # Redirect users to a URL or somesuch on password # changes. #pam_password_prohibit_message Please visit http://internal to change your password. # RFC2307bis naming contexts # Syntax: # nss_base_XXX base?scope?filter # where scope is {base,one,sub} # and filter is a filter to be &'d with the # default filter. # You can omit the suffix eg: # nss_base_passwd ou=People, # to append the default base DN but this # may incur a small performance impact. #nss_base_passwd ou=People,dc=example,dc=com?one #nss_base_shadow ou=People,dc=example,dc=com?one #nss_base_group ou=Group,dc=example,dc=com?one #nss_base_hosts ou=Hosts,dc=example,dc=com?one #nss_base_services ou=Services,dc=example,dc=com?one #nss_base_networks ou=Networks,dc=example,dc=com?one #nss_base_protocols ou=Protocols,dc=example,dc=com?one #nss_base_rpc ou=Rpc,dc=example,dc=com?one #nss_base_ethers ou=Ethers,dc=example,dc=com?one #nss_base_netmasks ou=Networks,dc=example,dc=com?ne #nss_base_bootparams ou=Ethers,dc=example,dc=com?one #nss_base_aliases ou=Aliases,dc=example,dc=com?one #nss_base_netgroup ou=Netgroup,dc=example,dc=com?one # attribute/objectclass mapping # Syntax: #nss_map_attribute rfc2307attribute mapped_attribute #nss_map_objectclass rfc2307objectclass mapped_objectclass # configure --enable-nds is no longer supported. # For NDS now do: #nss_map_attribute uniqueMember member # configure --enable-mssfu-schema is no longer supported. # For MSSFU now do: #nss_map_objectclass posixAccount User #nss_map_attribute uid msSFUName #nss_map_attribute uniqueMember posixMember #nss_map_attribute userPassword msSFUPassword #nss_map_attribute homeDirectory msSFUHomeDirectory #nss_map_objectclass posixGroup Group #pam_login_attribute msSFUName #pam_filter objectclass=User #pam_password ad # configure --enable-authpassword is no longer supported # For authPassword support, now do: #nss_map_attribute userPassword authPassword #pam_password nds # For IBM SecureWay support, do: #nss_map_objectclass posixAccount aixAccount #nss_map_attribute uid userName #nss_map_attribute gidNumber gid #nss_map_attribute uidNumber uid #nss_map_attribute userPassword passwordChar #nss_map_objectclass posixGroup aixAccessGroup #nss_map_attribute cn groupName #nss_map_attribute uniqueMember member #pam_login_attribute userName #pam_filter objectclass=aixAccount #pam_password clear # Netscape SDK LDAPS #ssl on # Netscape SDK SSL options #sslpath /etc/ssl/certs/cert7.db # OpenLDAP SSL mechanism # start_tls mechanism uses the normal LDAP port, LDAPS typically 636 #ssl start_tls #ssl on # OpenLDAP SSL options # Require and verify server certificate (yes/no) # Default is "no" #tls_checkpeer yes # CA certificates for server certificate verification # At least one of these are required if tls_checkpeer is "yes" #tls_cacertfile /etc/ssl/ca.cert #tls_cacertdir /etc/ssl/certs # Seed the PRNG if /dev/urandom is not provided #tls_randfile /var/run/egd-pool # SSL cipher suite # See man ciphers for syntax #tls_ciphers TLSv1 # Client certificate and key # Use these, if your server requires client authentication. #tls_cert #tls_key ssl no pam_password md5 # Workaround for FC5 bug that causes "System Messaging Bus" delay during boot # I'm assuming ATM that this has no general averse effect in Ubuntu nss_initgroups_ignoreusers root,ldap,named,avahi,haldaemon # See https://bugs.edge.launchpad.net/ubuntu/+source/libnss-ldap/+bug/155947 bind_policy soft smbldap-configure-4.0/smbldap-funcs.pm0000644000000000000000000002702310645766567016602 0ustar rootrootsub verify_root() { if ($< != 0) { print ""; print "You must be root to run this program.\n"; print ""; exit; } } sub print_line ($) { my $msg = shift; #print "$msg", RESET; print "$msg", ""; open (LOG, ">> $logfile"); print LOG "$msg"; close LOG; } sub only_log ($) { my $msg = shift; open (LOG, ">> $logfile"); print LOG "$msg"; close LOG; } sub store_answer($$) { my $key = shift; my $val = shift; open (LOG, ">> $answersfile"); print LOG "$key=$val\n"; close LOG; } sub log ($) { my $msg = shift; #print GREEN print ""; &print_line ($msg); } sub warn ($) { my $msg = shift; #print RED print ""; &print_line ($msg); } sub prompt ($) { my $msg = shift; #print BOLD, BLUE print ""; &print_line ($msg); } sub do_system ($$) { my $logfile = shift; my $cmd = shift; open LF, ">> $logfile" or die ("Can't open logfile: $!\n"); print LF "\n".$cmd."\n"; close LF; my $rc = system ("$cmd >> $logfile 2>&1"); return $rc; } sub create_password() { my $pw_random = shift; my $min_len = shift; my $max_len = shift; my $pw_spchr = shift; my $pw_ucchr = shift; if (!defined($min_len)) { $min_len = 8; } if (!defined($max_len)) { $max_len = 12; } # The dictionary of password chunks is long and ugly, so set it down # below in a subroutine. my @dict = &set_dict; my $new_password = undef; if (defined($pw_random) and $pw_random) { while (!$new_password) { # new passwords will have 6> <15 characters my $len = (rand $max_len-$min_len) + $min_len + 1; # generate the new random password for (my $i = 2; $i < $len; $i++) { $new_password .= chr ((rand 93) + 33); } $new_password =~ s/[<>\']//g; if (length $new_password < $min_len) { $new_password = undef; } } } else { while (!$new_password) { my $p1 = int rand($#dict); my $p2 = int rand(89) + 10; my $p3 = int rand($#dict); # get rid of zeros and ones; people might confuse them with # letters $p2 =~ s/[01]/2/g; # Get rid of the number 69. # Kids, kids, kids... $p2 =~ s/69/96/g; $new_password = "$dict[$p1]$p2$dict[$p3]"; if ($pw_spchr) { # prepend or append a random symbol my $symbols = '%+-_:=@~?'; my $symbol = int (rand length($symbols) - 1); $symbol = substr($symbols, $symbol, 1); # Random position #my $pos = int rand (length($new_password)-1); if (rand > .5) { $new_password =~ s/^/$symbol/; } else { $new_password =~ s/$/$symbol/; } } if ($pw_ucchr) { # randomize the casing for ($i=0; $i < length($new_password); $i++) { if (rand > .5) { substr($new_password, $i, 1) = uc substr($new_password, $i, 1); } } } } } return $new_password; } # This brings in dependency problems that aren't worth solving until this is # being used. #sub ssha_password($) #{ # my $password = shift; # my $salt = (rand 90) + 10; # use Digest::SHA1; # use MIME::Base64; # $ctx = Digest::SHA1->new; # $ctx->add($password); # $ctx->add($salt); # $hashedPasswd = '{SSHA}' . encode_base64($ctx->digest . $salt ,''); # return $hashedPasswd; #} sub set_dict() { return ( "aal","aam","aba","abb","abu","aby","ace","ach","act","add", "ade","ado","ady","adz","aer","aes","aft","aga","age","ago","agy", "aha","aho","ahu","aid","ail","aim","air","ait","aka","ake","ako", "aku","ala","alb","ale","alf","alk","aln","alo","alp","alt","aly", "ama","ame","ami","amt","amy","ana","and","ani","ann","ant","any", "apa","ape","apt","ara","arc","are","ark","arm","arn","art","aru", "arx","ary","ase","ash","ask","asp","ast","ate","auh","auk","aum", "ava","ave","avo","awa","awd","awe","awl","awn","axe","aye","ayu", "azo","baa","bac","bad","bae","bag","bah","bal","bam","ban","bap", "bar","bas","bat","baw","bay","bed","bee","beg","bel","ben","ber", "bes","bet","bey","bib","bid","big","bin","bis","biz","bol","boa", "bob","bog","bom","bon","boo","bop","bor","bot","bow","boy", "bra","bub","bud","bug","bum","bun","bur","bus","but","buy","bye", "cab","cad","cag","cal","cam","can","cap","car","cat","caw","cay", "cee","cep","cha","che","chi","cho","cig","cit","cly","cob","cod", "coe","cog","col","con","coo","cop","cor","cos","cot","cow", "coy","coz","cro","cry","cub","cud","cue","cup","cur","cut", "cwm","cyp","dab","dad","dae","dag","dah","dak","dal","dan", "dao","dap","dar","das","daw","day","deb","dee","deg","den","dev", "dew","dey","dha","dhu","dib","did","dig","dim","din","dip", "dis","dit","div","dob","doc","dod","doe","dog","dom","don","dop", "dor","dos","dot","dow","dry","dub","dud","due","dug","dum","dun", "duo","dup","dux","dye","ean","ear","eat","ebb","edh","eel","eer", "eft","egg","ego","eke","elb","eld","elf","elk","ell","elm","els", "elt","eme","emu","end","ens","eon","era","erd","ere","erg","err", "ers","ess","eta","eve","ewe","eye","eyn","fad","fae","fam", "fan","far","fay","fed","fee","fei","fen","fet","feu","few", "fey","fez","fib","fid","fie","fig","fin","fip","fir","fit","fix", "flu","fly","fob","fod","foe","fog","foo","fop","for","fot","fou", "fow","fox","foy","fra","fro","fry","fub","fud","fum","fun","fur", "gab","gad","gag","gaj","gal","gam","gan","gap","gar","gas", "gat","gau","gaw","gaz","ged","gee","gel","gem","gen","geo", "ger","get","gey","gez","gib","gid","gie","gif","gig","gim","gin", "gio","gip","git","gnu","goa","gob","gog","goi","gol","gon", "gor","gos","got","gra","grr","gud","gue","gul","gum", "gun","gup","gur","gut","guy","guz","gym","had","hag", "hah","hak","ham","han","hao","hap","hat","hau","haw","hay","hei", "hem","hen","hep","her","het","hew","hex","hey","hia","hic","hie", "him","hin","his","hit","hob","hod","hog","hoi","hop", "toh","how","hox","hoy","hub","hud","hue","hug","huh","hum","hup", "hut","hyp","iao","iba","ice","ich","icy","ide","ife","ihi","ilk", "ill","imi","imp","imu","ing","ink","inn","ion","ire","irk","ism", "iso","ist","its","iva","ivy","iwa","iyo","jab","jag","jam", "jar","jaw","jay","jed","jet","jib","jig","joe","jog","jot", "jow","joy","jud","jut","kai","kan","kat","kay","kea","keb", "ked","kef","keg","ken","kep","ket","kex","key","khu","kim", "kin","kip","kit","koa","kob","koi","kon","kop","kor","kos","kou", "kra","kyl","lab","lac","lad","lag","lai","lak","lam","lan","lap", "lar","las","lat","law","lax","lay","lea","led","lee","leg","lei", "lek","let","leu","lev","lew","ley","lid","lie","lim","lin","lip", "lis","lit","loa","lob","lod","lof","log","loo","lop","lot","low", "lox","loy","lue","lug","lum","lut","lux","lye","lys","mac","mad", "mae","mag","mal","man","mao","map","mar","mas","mat","mau","maw", "may","mel","mem","men","met","mew","mho","mib","mid","mig","mil", "mim","min","mir","mix","mob","mog","mon","moo","mop","mor","mot", "mou","mow","moy","mud","mug","mum","mun","mux","naa","nab","nae", "nag","nak","nam","nan","nap","nar","nat","naw","nay","nea","neb", "nee","nef","nei","neo","nep","net","new","nib","nid","nil", "nim","nit","nix","noa","nob","nod","nog","non","nor","not", "now","noy","nth","nub","nul","nun","nut","nye","oaf","oak","oam", "oar","oat","obe","obi","och","ock","oda","odd","ode","oer","oes", "off","oft","ohm","oho","oii","oil","oka","oki","old","olm","ona", "one","ons","ope","opt","ora","orb","orc","ore","orf","ort","ory", "ose","ouf","our","out","ova","owd","owe","owk","owl","own","oxy", "pac","pad","pah","pal","pam","pan","pap","par","pat","pau","paw", "pax","pay","pea","ped","peg","pep","per","pes","pet", "pew","phi","pho","phu","pia","pic","pie","pik","pin","pip", "pir","pit","pix","ply","pob","pod","poe","poh","poi","pol","pom", "pon","pop","pot","pow","pox","poy","pro","pry","psi","pst","pua", "pub","pud","pug","pul","pun","pup","pur","put","pya","pyr","pyx", "qua","quo","rab","rad","rag","rah","raj","ram","ran","rap","ras", "rat","raw","rax","ray","rea","reb","red","ree","ref","reg","reh", "rel","rep","ret","rev","rex","rhe","rho","ria","rib","rid","rie", "rig","rio","rip","rit","rix","rob","roc","rod","roe","rog", "roi","rot","row","rox","rub","rud","rue","rug","rum","run","rut", "rux","rye","saa","sab","sac","sad","sag","sah","sai","saj","sal", "sam","san","sao","sap","sar","sat","saw","sax","say","sea","sec", "see","seg","sen","ser","set","sew","sey","sha","she","shi","sho", "shy","sib","sic","sie","sig","sil","sin","sip","sir","sis","sit", "six","ski","sky","sla","sly","sma","sny","sob","soc","sod","soe", "sog","soh","sok","sol","son","sop","sot","sou","sov","sow","soy", "spa","spy","sri","ssu","sty","sub","sud","sue","sum","sun","sup", "sur","suz","swa","sye","taa","tab","tad","tae","tag","tai","taj", "tal","tam","tan","tao","tap","tar","tat","tau","tav","taw","tax", "tay","tch","tck","tea","tec","ted","tee","teg","ten","tew","tez", "tha","the","tho","thy","tib","tic","tid","tie","tig","til","tin", "tip","tji","toa","tod","toe","tog","toi","tol","ton","too","top", "tor","tot","tou","tow","tox","toy","tra","tri","try","tst","tua", "tub","tue","tug","tui","tum","tun","tup","tur","tut","tux","twa", "two","tye","tyg","ubi","udo","ugh","uji","uke","ula","ule", "ull","ulu","ume","ump","umu","upo","ura","urd","ure","urf","urn", "use","ush","ust","uta","utu","uva","vag","van","vas","vat","vau", "vee","vei","vet","vex","via","vie","vim","vis","voe","vog","vol", "vow","vug","vum","wab","wad","wae","wag","wah","wan","wap","war", "was","wat","waw","wax","way","web","wed","wee","wem","wen","wer", "wey","wha","who","why","wid","wig","wim","win","wir","wis", "wit","wiz","wob","wod","woe","wog","won","woo","wop","wot","wow", "woy","wro","wry","wud","wun","wup","wur","wut","wye","wyn","yad", "yah","yak","yam","yan","yap","yar","yas","yat","yaw","yea","yed", "yee","yen","yeo","yep","yer","yes","yet","yew","yex","yez","yin", "yip","yis","yoe","yoi","yok","yom","yon","yor","yot","you","yow", "yox","yoy","yuh","yus","zac","zad","zag","zak","zar","zat","zax", "zed","zee","zel","zer","zig","zip","zoa","zoo"); } 1; smbldap-configure-4.0/distro_data.pm0000644000000000000000000001705510645767221016331 0ustar rootroot# distro_data.pm # $Id: distro_data.pm,v 1.29 2007/07/03 18:00:02 moquist Exp moquist $ ######################################################################################## # Configuration Stuff Below ######################################################################################## # This file contains the necessary information to run the # smbldap-install script on different Linux distributions. # The smbldap-configure script has "stages" during which different # configuration files need to be munged. # These are the stages: # Stage 40: munge (most of) the conf files # Stage 50: start the LDAP service and munge smbldap-tools config # # These are the config files we need to munge. # Each file has: # a destination path # a processing stage (which represents at which point in the # processing of this script the file should be # munged) # a directive (if the file is "included" by name within another file # required - boolean; can we continue without finding/including this file? # # The template files should be located in ./templates/ in the same # directory as the smbldap-installer, and they must have the same # filenames as their keys in this data structure. %config_files = ( "smbusers" => { filepath => [ "/etc/samba/smbusers", ], stage => 40, required_ldapclient => 0, }, "DB_CONFIG" => { filepath => [ "/var/lib/ldap/DB_CONFIG", ], stage => 40, required_ldapclient => 0, }, "etc_ldap.conf" => { filepath => [ "/etc/ldap.conf", "/etc/pam_ldap.conf", ], stage => 40, required_ldapclient => 0, }, "samba.schema" => { filepath => [ "/etc/openldap/schema/samba.schema", "/etc/ldap/schema/samba.schema", ], directive => "include ", stage => 40, required_ldapclient => 0, }, "slapd.conf" => { filepath => [ "/etc/openldap/slapd.conf", "/etc/ldap/slapd.conf", ], stage => 40, required_ldapclient => 0, }, "openldap_ldap.conf" => { filepath => [ "/etc/openldap/ldap.conf", "/etc/ldap/ldap.conf", ], stage => 40, required_ldapclient => 0, }, "smb.conf" => { filepath => [ "/etc/samba/smb.conf", ], stage => 40, required_ldapclient => 0, }, "smbldap.conf" => { filepath => [ "/etc/opt/IDEALX/smbldap-tools/smbldap.conf", "/opt/IDEALX/smbldap-tools/smbldap.conf", "/etc/smbldap-tools/smbldap.conf", ], stage => 50, required_ldapclient => 0, }, "smbldap_bind.conf" => { filepath => [ "/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf", "/opt/IDEALX/smbldap-tools/smbldap_bind.conf", "/etc/smbldap-tools/smbldap_bind.conf", ], stage => 50, required_ldapclient => 0, }, "ubuntu_libnss_ldap.conf" => { filepath => [ "/etc/libnss-ldap.conf", ], required_ldapclient => 1, }, "ubuntu_pam_ldap.conf" => { filepath => [ "/etc/pam_ldap.conf", ], required_ldapclient => 1, }, "core.schema" => { filepath => [ "/etc/ldap/schema/core.schema", "/etc/openldap/schema/core.schema", ], directive => "include ", required => 0, required_ldapclient => 0, }, "cosine.schema" => { filepath => [ "/etc/ldap/schema/cosine.schema", "/etc/openldap/schema/cosine.schema", ], directive => "include ", required => 0, required_ldapclient => 0, }, "inetorgperson.schema" => { filepath => [ "/etc/ldap/schema/inetorgperson.schema", "/etc/openldap/schema/inetorgperson.schema", ], directive => "include ", required => 0, required_ldapclient => 0, }, "nis.schema" => { filepath => [ "/etc/ldap/schema/nis.schema", "/etc/openldap/schema/nis.schema", ], directive => "include ", required => 0, required_ldapclient => 0, }, "redhat_autofs.schema" => { filepath => [ "/etc/ldap/schema/redhat/autofs.schema", ], directive => "include ", required => 0, required_ldapclient => 0, }, "back_bdb.so" => { filepath => [ "/usr/lib/ldap/back_bdb.so", ], directive => "moduleload ", required => 0, required_ldapclient => 0, }, "fedora_slapd.pid" => { filepath => [ "/var/run/openldap/slapd.pid", "/var/run/slapd.pid", "/var/run/slapd/slapd.pid", ], directive => "pidfile ", required => 1, required_ldapclient => 0, }, "webmin-ldap-useradmin-config" => { filepath => [ "/etc/webmin/ldap-useradmin/config", ], stage => 40, required => 0, mode => 640, user => 'root', group => [ 'www-data', 'apache' ], }, ); # These are the scripts used to initialize relevant system services. # Different Linux distributions name these different things, though we # assume we will find them all under /etc/init.d/ even so. %service_scripts = ( "ldap" => ["ldap", "slapd"], "samba" => ["smb", "samba"], "nscd" => ["nscd", ], "nfs" => ["nfs", "nfs-kernel-server", "nfs-user-server" ], ); @smbldap_tools_path = ( "/opt/IDEALX/sbin/", "/usr/sbin/" ); # These are some essential programs that we need to execute. # Different distributions (and versions of the programs) put them in # different places. @programs = ("slapcat", "slapd", "smbd", "smbldap-populate"); ######################################################################################## # Configuration Stuff Above # Installation Stuff Below ######################################################################################## # The data in this hash must be updated to support new versions/distributions. # %distro_data = ( ################################### "k12ltsp-5" => { netrepo_command => "rpm --import /usr/share/rhn/RPM-GPG-KEY; yum --disablerepo=core -t -y install gcc glibc-headers openldap-servers openldap-clients perl-XML-SAX perl-URI perl-Convert-ASN1 perl-Net-SSLeay perl-XML-NamespaceSupport perl-libwww-perl perl-HTML-Parser perl-Digest-SHA1 samba-common perl-Compress-Zlib perl-HTML-Tagset perl-Net-SSLeay samba perl-LDAP", }, # end k12ltsp-5 ################################### "fc5" => { netrepo_command => "rpm --import /usr/share/doc/fedora-release-5/RPM-GPG-KEY; yum -t -y install gcc glibc-headers openldap-servers openldap-clients perl-XML-SAX perl-URI perl-Convert-ASN1 perl-Net-SSLeay perl-XML-NamespaceSupport perl-URI perl-Crypt-SSLeay perl-libwww-perl perl-HTML-Parser perl-Digest-SHA1 samba-common perl-Compress-Zlib perl-HTML-Tagset perl-Net-SSLeay samba perl-LDAP smbldap-tools", }, # end fc5 ################################### "centos44" => { # this needs to be set because smbldap-tools-0.8.6-1 puts utilities in here PATH => "/opt/IDEALX/sbin", netrepo_command => "rpm --import /usr/share/rhn/RPM-GPG-KEY; yum -t -y install gcc glibc-headers openldap-servers openldap-clients perl-XML-SAX perl-URI perl-Convert-ASN1 perl-Net-SSLeay perl-XML-NamespaceSupport perl-URI perl-Crypt-SSLeay perl-libwww-perl perl-HTML-Parser perl-Digest-SHA1 samba-common perl-HTML-Tagset perl-Net-SSLeay samba perl-LDAP; yum -t -y --enablerepo=dag install perl-Compress-Zlib", }, # end centos44 ################################### "ubuntu" => { netrepo_command => "DEBIAN_FRONTEND=noninteractive apt-get install ldap-utils slapd smbldap-tools samba nscd nfs-kernel-server winbind", }, ); ######################################################################################## # Installation Stuff Above ######################################################################################## 1; smbldap-configure-4.0/GNU-General-Public-License.txt0000644000000000000000000004313107324302233021015 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. smbldap-configure-4.0/userinfo.names0000644000000000000000000000017310326116514016333 0ustar rootrootFatt,Catt,fcatt Jerry,Mouse,jmouse Matt,Watt,mwatt Mickey,Mouse,mmouse Minnie,Mouse,mimouse Skinny,Catt,scatt Tom,Cat,tcat smbldap-configure-4.0/debian/0000755000000000000000000000000011001257337014675 5ustar rootrootsmbldap-configure-4.0/debian/init.d.ex0000644000000000000000000000421010642555234016424 0ustar rootroot#! /bin/sh # # skeleton example file to build /etc/init.d/ scripts. # This file should be used to construct scripts for /etc/init.d. # # Written by Miquel van Smoorenburg . # Modified for Debian # by Ian Murdock . # # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/smbldap-configure NAME=smbldap-configure DESC=smbldap-configure test -x $DAEMON || exit 0 # Include smbldap-configure defaults if available if [ -f /etc/default/smbldap-configure ] ; then . /etc/default/smbldap-configure fi set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON echo "$NAME." ;; #reload) # # If the daemon can reload its config files on the fly # for example by sending it SIGHUP, do it here. # # If the daemon responds to changes in its config file # directly anyway, make this a do-nothing entry. # # echo "Reloading $DESC configuration files." # start-stop-daemon --stop --signal 1 --quiet --pidfile \ # /var/run/$NAME.pid --exec $DAEMON #;; force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart" except that it does nothing if the # daemon isn't already running. # check wether $DAEMON is running. If so, restart start-stop-daemon --stop --test --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON \ && $0 restart \ || exit 0 ;; restart) echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON sleep 1 start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 smbldap-configure-4.0/debian/dirs0000644000000000000000000000002110642555234015561 0ustar rootrootusr/bin usr/sbin smbldap-configure-4.0/debian/cron.d.ex0000644000000000000000000000014710642555234016427 0ustar rootroot# # Regular cron jobs for the smbldap-configure package # 0 4 * * * root smbldap-configure_maintenance smbldap-configure-4.0/debian/preinst.ex0000644000000000000000000000127610642555234016734 0ustar rootroot#!/bin/sh # preinst script for smbldap-configure # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in install|upgrade) ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 smbldap-configure-4.0/debian/menu.ex0000644000000000000000000000022410642555234016204 0ustar rootroot?package(smbldap-configure):needs="X11|text|vc|wm" section="Apps/see-menu-manual"\ title="smbldap-configure" command="/usr/bin/smbldap-configure" smbldap-configure-4.0/debian/postinst.ex0000644000000000000000000000171110642555234017125 0ustar rootroot#!/bin/sh # postinst script for smbldap-configure # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 smbldap-configure-4.0/debian/emacsen-startup.ex0000644000000000000000000000233110642555234020354 0ustar rootroot;; -*-emacs-lisp-*- ;; ;; Emacs startup file, e.g. /etc/emacs/site-start.d/50smbldap-configure.el ;; for the Debian smbldap-configure package ;; ;; Originally contributed by Nils Naumann ;; Modified by Dirk Eddelbuettel ;; Adapted for dh-make by Jim Van Zandt ;; The smbldap-configure package follows the Debian/GNU Linux 'emacsen' policy and ;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, ;; xemacs19, emacs20, xemacs20...). The compiled code is then ;; installed in a subdirectory of the respective site-lisp directory. ;; We have to add this to the load-path: (let ((package-dir (concat "/usr/share/" (symbol-name flavor) "/site-lisp/smbldap-configure"))) ;; If package-dir does not exist, the smbldap-configure package must have ;; removed but not purged, and we should skip the setup. (when (file-directory-p package-dir) (setq load-path (cons package-dir load-path)) (autoload 'smbldap-configure-mode "smbldap-configure-mode" "Major mode for editing smbldap-configure files." t) (add-to-list 'auto-mode-alist '("\\.smbldap-configure$" . smbldap-configure-mode)))) smbldap-configure-4.0/debian/control0000644000000000000000000000111110642555315016301 0ustar rootrootSource: smbldap-configure Section: unknown Priority: extra Maintainer: Matthew Oquist Build-Depends: debhelper (>= 5) Standards-Version: 3.7.2 Package: smbldap-configure Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libgetopt-mixed-perl, libdigest-sha1-perl, libpam-ldap, libnss-ldap, ldap-utils, slapd, smbldap-tools, samba, nscd, nfs-kernel-server, winbind Description: easily configure Samba+OpenLDAP This tool asks the relevant questions and munges the relevant config files to set up standalone LDAP clients, and create LDAP slaves (BDCs). smbldap-configure-4.0/debian/changelog0000644000000000000000000000031710642555234016557 0ustar rootrootsmbldap-configure (4.0-1) unstable; urgency=low * Initial release (Closes: #nnnn) -- Matthew Lee Oquist Tue, 3 Jul 2007 19:24:07 -0400 smbldap-configure-4.0/debian/emacsen-install.ex0000644000000000000000000000234210642555234020322 0ustar rootroot#! /bin/sh -e # /usr/lib/emacsen-common/packages/install/smbldap-configure # Written by Jim Van Zandt , borrowing heavily # from the install scripts for gettext by Santiago Vila # and octave by Dirk Eddelbuettel . FLAVOR=$1 PACKAGE=smbldap-configure if [ ${FLAVOR} = emacs ]; then exit 0; fi echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} #FLAVORTEST=`echo $FLAVOR | cut -c-6` #if [ ${FLAVORTEST} = xemacs ] ; then # SITEFLAG="-no-site-file" #else # SITEFLAG="--no-site-file" #fi FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} # Install-info-altdir does not actually exist. # Maybe somebody will write it. if test -x /usr/sbin/install-info-altdir; then echo install/${PACKAGE}: install Info links for ${FLAVOR} install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/info/${PACKAGE}.info.gz fi install -m 755 -d ${ELCDIR} cd ${ELDIR} FILES=`echo *.el` cp ${FILES} ${ELCDIR} cd ${ELCDIR} cat << EOF > path.el (setq load-path (cons "." load-path) byte-compile-warnings nil) EOF ${FLAVOR} ${FLAGS} ${FILES} rm -f *.el path.el exit 0 smbldap-configure-4.0/debian/compat0000644000000000000000000000000210642555234016102 0ustar rootroot5 smbldap-configure-4.0/debian/README.Debian0000644000000000000000000000032210642555234016742 0ustar rootrootsmbldap-configure for Debian ---------------------------- -- Matthew Lee Oquist Tue, 3 Jul 2007 19:24:07 -0400 smbldap-configure-4.0/debian/manpage.sgml.ex0000644000000000000000000001110310642555234017607 0ustar rootroot manpage.1'. You may view the manual page with: `docbook-to-man manpage.sgml | nroff -man | less'. A typical entry in a Makefile or Makefile.am is: manpage.1: manpage.sgml docbook-to-man $< > $@ The docbook-to-man binary is found in the docbook-to-man package. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include docbook-to-man in your Build-Depends control field. --> FIRSTNAME"> SURNAME"> July 3, 2007"> SECTION"> moquist@alvin.mojo.home"> SMBLDAP-CONFIGURE"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2003 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; program to do something &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; and bar commands. This manual page was written for the &debian; distribution because the original program does not have a manual page. Instead, it has documentation in the &gnu; Info format; see below. &dhpackage; is a program that... OPTIONS These programs follow the usual &gnu; command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. Show summary of options. Show version of program. SEE ALSO bar (1), baz (1). The programs are documented fully by The Rise and Fall of a Fooish Bar available via the Info system. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
smbldap-configure-4.0/debian/postrm.ex0000644000000000000000000000165610642555234016576 0ustar rootroot#!/bin/sh # postrm script for smbldap-configure # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 smbldap-configure-4.0/debian/docs0000644000000000000000000000010210642555235015551 0ustar rootrootDocumentation.txt GNU-General-Public-License.txt NEWS README TODO smbldap-configure-4.0/debian/smbldap-configure.doc-base.EX0000644000000000000000000000116510642555234022222 0ustar rootrootDocument: smbldap-configure Title: Debian smbldap-configure Manual Author: Abstract: This manual describes what smbldap-configure is and how it can be used to manage online manuals on Debian systems. Section: unknown Format: debiandoc-sgml Files: /usr/share/doc/smbldap-configure/smbldap-configure.sgml.gz Format: postscript Files: /usr/share/doc/smbldap-configure/smbldap-configure.ps.gz Format: text Files: /usr/share/doc/smbldap-configure/smbldap-configure.text.gz Format: HTML Index: /usr/share/doc/smbldap-configure/html/index.html Files: /usr/share/doc/smbldap-configure/html/*.html smbldap-configure-4.0/debian/manpage.xml.ex0000644000000000000000000001103010642555234017444 0ustar rootroot .
will be generated. You may view the manual page with: nroff -man .
| less'. A typical entry in a Makefile or Makefile.am is: DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ manpages/docbook.xsl XP=xsltproc -''-nonet manpage.1: manpage.dbk $(XP) $(DB2MAN) $< The xsltproc binary is found in the xsltproc package. The XSL files are in docbook-xsl. Please remember that if you create the nroff version in one of the debian/rules file targets (such as build), you will need to include xsltproc and docbook-xsl in your Build-Depends control field. --> FIRSTNAME"> SURNAME"> July 3, 2007"> SECTION"> moquist@alvin.mojo.home"> SMBLDAP-CONFIGURE"> Debian"> GNU"> GPL"> ]>
&dhemail;
&dhfirstname; &dhsurname; 2003 &dhusername; &dhdate;
&dhucpackage; &dhsection; &dhpackage; program to do something &dhpackage; DESCRIPTION This manual page documents briefly the &dhpackage; and bar commands. This manual page was written for the &debian; distribution because the original program does not have a manual page. Instead, it has documentation in the &gnu; Info format; see below. &dhpackage; is a program that... OPTIONS These programs follow the usual &gnu; command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. Show summary of options. Show version of program. SEE ALSO bar (1), baz (1). The programs are documented fully by The Rise and Fall of a Fooish Bar available via the Info system. AUTHOR This manual page was written by &dhusername; &dhemail; for the &debian; system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
smbldap-configure-4.0/debian/emacsen-remove.ex0000644000000000000000000000075710642555234020161 0ustar rootroot#!/bin/sh -e # /usr/lib/emacsen-common/packages/remove/smbldap-configure FLAVOR=$1 PACKAGE=smbldap-configure if [ ${FLAVOR} != emacs ]; then if test -x /usr/sbin/install-info-altdir; then echo remove/${PACKAGE}: removing Info links for ${FLAVOR} install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/smbldap-configure.info.gz fi echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} fi smbldap-configure-4.0/debian/rules0000755000000000000000000000343610642555251015771 0ustar rootroot#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) #docbook-to-man debian/smbldap-installer.sgml > smbldap-installer.1 touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. -$(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs dh_install # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_install # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python # dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure smbldap-configure-4.0/debian/copyright0000644000000000000000000000120710642555234016637 0ustar rootrootThis package was debianized by Matthew Lee Oquist on Tue, 3 Jul 2007 19:24:07 -0400. It was downloaded from Upstream Author: Copyright: License: The Debian packaging is (C) 2007, Matthew Lee Oquist and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. # Please also look if there are files or directories which have a # different copyright/license attached and list them here. smbldap-configure-4.0/debian/watch.ex0000644000000000000000000000132410642555235016351 0ustar rootroot# Example watch control file for uscan # Rename this file to "watch" and then you can run the "uscan" command # to check for upstream updates and more. # See uscan(1) for format # Compulsory line, this is a version 3 file version=3 # Uncomment to examine a Webpage # #http://www.example.com/downloads.php smbldap-configure-(.*)\.tar\.gz # Uncomment to examine a Webserver directory #http://www.example.com/pub/smbldap-configure-(.*)\.tar\.gz # Uncommment to examine a FTP server #ftp://ftp.example.com/pub/smbldap-configure-(.*)\.tar\.gz debian uupdate # Uncomment to find new files on sourceforge, for debscripts >= 2.9 # http://sf.net/smbldap-configure/smbldap-configure-(.*)\.tar\.gz smbldap-configure-4.0/debian/install0000644000000000000000000000244010642555243016275 0ustar rootrootDocumentation.txt usr/share/smbldap-configure/ GNU-General-Public-License.txt usr/share/smbldap-configure/ NEWS usr/share/smbldap-configure/ README usr/share/smbldap-configure/ TODO usr/share/smbldap-configure/ create-usernames usr/share/smbldap-configure/ distro_data.pm usr/share/smbldap-configure/ passwd-create usr/share/smbldap-configure/ smbldap usr/share/smbldap-configure/ smbldap-configure usr/share/smbldap-configure/ smbldap-funcs.pm usr/share/smbldap-configure/ smbldap-ldif-backup-configure usr/share/smbldap-configure/ smbldap-restore usr/share/smbldap-configure/ smbldap-useradd-bulk usr/share/smbldap-configure/ smbldap-userdel-bulk usr/share/smbldap-configure/ templates usr/share/smbldap-configure/ userinfo.delete.example usr/share/smbldap-configure/ userinfo.names usr/share/smbldap-configure/ userinfo.start.example usr/share/smbldap-configure/ smbldap-configure-4.0/debian/prerm.ex0000644000000000000000000000157110642555234016373 0ustar rootroot#!/bin/sh # prerm script for smbldap-configure # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|deconfigure) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 smbldap-configure-4.0/debian/manpage.1.ex0000644000000000000000000000343210642555234017013 0ustar rootroot.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH SMBLDAP-CONFIGURE SECTION "July 3, 2007" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME smbldap-configure \- program to do something .SH SYNOPSIS .B smbldap-configure .RI [ options ] " files" ... .br .B bar .RI [ options ] " files" ... .SH DESCRIPTION This manual page documents briefly the .B smbldap-configure and .B bar commands. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBsmbldap-configure\fP is a program that... .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of program. .SH SEE ALSO .BR bar (1), .BR baz (1). .br The programs are documented fully by .IR "The Rise and Fall of a Fooish Bar" , available via the Info system. .SH AUTHOR smbldap-configure was written by . .PP This manual page was written by Matthew Lee Oquist , for the Debian project (but may be used by others). smbldap-configure-4.0/debian/smbldap-configure-default.ex0000644000000000000000000000041110642555234022261 0ustar rootroot# Defaults for smbldap-configure initscript # sourced by /etc/init.d/smbldap-configure # installed at /etc/default/smbldap-configure by the maintainer scripts # # This is a POSIX shell fragment # # Additional options that are passed to the Daemon. DAEMON_OPTS="" smbldap-configure-4.0/smbldap-userdel-bulk0000755000000000000000000001226010642507253017425 0ustar rootroot#!/usr/bin/perl -w # $Id: smbldap-userdel-bulk,v 1.2 2005/11/01 05:45:46 moquist Exp $ ############################################ # smbldap-userdel-bulk # -- Bulk-delete users on a Samba/LDAP system using smbldap-tools # # Copyright (C) 2005 Matthew Oquist 718 Fox Hollow Drive, Hudson, NH 03051 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Author: Matt Oquist ############################################ use strict; use Getopt::Std; require "smbldap-funcs.pm"; &verify_root; my @badinput = (); my @errors = (); my $recurse_home = ""; my $home_message = ""; our $opt_f; our $opt_h; our $opt_i; our $opt_o; our $opt_r; $ENV{PATH} = "/opt/IDEALX/sbin:$ENV{PATH}"; if (defined $ARGV[0] and $ARGV[0] eq "--help") { &usage; exit; } getopts("f:hio:r"); if (defined($opt_h)) { $opt_h = 1; &usage; exit; } if (defined($opt_i)) { $opt_i = 1; } if (defined($opt_f) && ! -f "$opt_f") { print STDERR "#$0: input file ($opt_f) cannot be found\n"; exit; } elsif ($opt_f) { open INPUT, "<$opt_f"; } else { open INPUT, "<&STDIN"; } if (defined($opt_o)) { open OUTPUT, ">>$opt_o"; } else { open OUTPUT, ">&STDOUT"; } if (defined($opt_r)) { $opt_r = 1; $recurse_home = "-r"; $home_message = "(and home directory)"; } my $date = localtime; print OUTPUT "\n#################################\n"; print OUTPUT "# $date\n"; # read each line of standard input foreach my $line () { my $first = undef; my $last = undef; my $uname = undef; # get rid of the newline at the end of our $line chomp $line; # ignore comments if ($line =~ /^[ \t]*#/ or $line !~ /./) { next; } # firstname,surname,username,misc. junk... if ($line =~ /^.+,.+,.+,?.*,?.*,?.*,?.*$/) { # Divide the line into its fields ($first,$last,$uname,undef) = split /,/, $line, 4; } elsif ($line =~ /^[^\ \t]+[ \t]*$/) { $uname = $line; $uname =~ s/[ \t]*$//; } else { # we don't understand this line of input push @badinput, "$line"; next; } $uname =~ s/[\s]//g; # Delete the user my $rc = system("smbldap-userdel $recurse_home $uname"); if ($rc == 0) { # the user was successfully deleted print OUTPUT "$uname $home_message deleted"; if (!defined($opt_i) and defined($opt_o)) { print STDOUT "$uname $home_message deleted\n"; } } else { push @errors, "smbldap-userdel error for $uname: $rc."; } } if ($#badinput >= 0) { print "The following lines contain errors and were not processed:\n"; foreach my $error (@badinput) { print "$error\n"; } } if ($#errors>= 0) { print "The errors were encountered during processing:\n"; foreach my $error (@errors) { print "$error\n"; } } sub usage() { my $me = $0; print "Usage: $me [-h] [-f ] [-o ]\n"; print " [ -i ]\n"; print " -f Use the named file for input.\n"; print " You must either supply this option or pipe your\n"; print " userinfo data into this script.\n"; print " -h Prints this help message.\n"; print " -i This turns OFF interactivity and assumes the following:\n"; print " - input lines with a single word are assumed to contain usernames\n"; print " - all other input lines are assumed to contain output from\n"; print " smbldap-useradd-bulk in the following format:\n"; print " First,Last,username,GID,shell,homedir,password\n"; print " (Fields after \"username\" are optional.)\n"; print " - If you do not turn off interactivity, the script will ask you\n"; print " about input lines that are ambiguous or unexpected.\n"; print " -o Use the named file for output.\n"; print " If you don't specify this option, output will print\n"; print " to standard output.\n"; print " -r Delete each user's home directory recursively.\n"; print " Each line of your input file must be in one of these formats:\n"; print " username1\n"; print " username2\n"; print " username3\n"; print " Ralph,Walf,rwalf,525,/bin/bash,/home/rwalf/,password3\n"; print " In the above example,\n"; print " Ralph = first name\n"; print " Walf = last name\n"; print " rwalf = username\n"; print " 525 = group ID (optional)\n"; print " /bin/bash = login shell (optional)\n"; print " /home/rwalf/ = home directory (optional)\n"; print " password3 = password (optional)\n\n"; print " All of the \"optional\" fields will be ignored.\n"; print " Input lines that start with '#' are ignored.\n"; } smbldap-configure-4.0/smbldap0000755000000000000000000000623610642541334015035 0ustar rootroot#!/bin/bash # $Id: smbldap,v 1.1 2006/10/24 05:20:38 moquist Exp moquist $ function usage { cat << EOF usage: $0 { all | backup | bdc | configure | install | ldapclient | pdc | users | usersdel } EOF } [ -z "$1" ] && usage && exit if [ "$UID" -ne 0 ]; then echo You must run this program as root. exit fi action="$1" PERL=`type -p perl` SMBLDAP_INSTALL="${PERL} smbldap-install" [ ! -f "smbldap-install" ] && SMBLDAP_INSTALL="echo smbldap-install not found, but is not necessary if the Ubuntu package installed this script; true" START=userinfo.start NAMES=userinfo.names FINISH=userinfo.finish DELETE=userinfo.delete GONE=userinfo.gone # Make sure selinux is disabled #[ -n "`type -p setenforce`" ] && setenforce 0 && echo SELinux unenforced for smbldap installation [ -n "`type -p selinuxenabled`" ] && selinuxenabled ; [ $? -eq 0 ] && { echo echo You must disable selinux in /etc/sysconfig/selinux and then reboot before you can run this script. echo exit } || { echo selinux is disabled... } # Make sure we have Perl's Getopt module # The only tested system that doesn't have it is Ubuntu's default server install #perl -e "require Getopt::Std;" >/dev/null 2>&1 #if [ "$?" -ne 0 ]; then # if [ -n "`type -p apt-get`" ]; then # apt-get -y install libgetopt-mixed-perl libdigest-sha1-perl # if [ $? -ne 0 ]; then # echo unable to install libgetopt-mixed-perl # exit # fi # fi #fi case $action in all|standalone) ${SMBLDAP_INSTALL} -I && \ ${PERL} smbldap-configure && \ bash smbldap-ldif-backup-configure ;; backup) bash smbldap-ldif-backup-configure ;; bdc) ${SMBLDAP_INSTALL} -I && \ ${PERL} smbldap-configure -t bdc ;; configure) ${PERL} smbldap-configure ;; install) ${SMBLDAP_INSTALL} -I ;; ldapclient) ${PERL} smbldap-configure -t ldapclient ;; pdc) ${PERL} smbldap-configure -t pdc ;; ubuntuclient) echo Configuring LDAP client... ubudefauth="/root/default-authentication-configuration.tgz" echo Backing up PAM and NSSwitch in $ubudefauth... [ ! -f "$ubudefauth" ] && tar czvf "$ubudefauth" /etc/nsswitch.conf /etc/pam.d/ DEBIAN_FRONTEND=noninteractive apt-get install libpam-ldap libnss-ldap && \ cp templates/ubuntu-ldap/nsswitch.conf /etc/ && \ cp templates/ubuntu-ldap/common* /etc/pam.d/ touch /etc/pam_ldap.conf touch /etc/libnss-ldap.conf ;; users) ${PERL} create-usernames -a -i -f ${START} -o ${NAMES} && \ ${PERL} smbldap-useradd-bulk -m -f ${NAMES} -o ${FINISH} && \ chmod 600 ${FINISH} ;; usersdel) ${PERL} smbldap-userdel-bulk -r -f ${DELETE} -o ${GONE} chmod 600 ${GONE} ;; perlprep) # We just needed to make sure Perl could use GetOpt exit ;; webmin) # Drop some configuration stuff into the webmin config to make the # Samba/LDAP user management stuff do the right thing(tm) ${PERL} smbldap-configure -t webmin ;; *) usage exit ;; esac #test: # ${PERL} create-usernames -a -i -f ${START} -o ${TMPFILE} # ${PERL} smbldap-useradd-bulk -f ${TMPFILE} # rm ${TMPFILE} smbldap-configure-4.0/smbldap-useradd-bulk0000755000000000000000000003461210642507253017416 0ustar rootroot#!/usr/bin/perl -w # $Id: smbldap-useradd-bulk,v 1.28 2006/11/30 15:32:52 moquist Exp $ ############################################ # smbldap-useradd-bulk # -- Bulk-add users to a Samba/LDAP system using smbldap-tools # # Copyright (C) 2005 SAU16 School District, Exeter, NH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Author: Matt Oquist # - added quota support: Brian Chivers # Props to David Trask for his original shell script our $support = 'Matt Oquist '; ############################################ use strict; use Getopt::Std; require "smbldap-funcs.pm"; &verify_root; # Randomize... srand; my @badinput = (); my @errors = (); my $pw_spchr = undef; my $pw_ucchr = undef; my $pw_random = undef; my $min_len = my $max_len = 8; my $default_gid = 513; my $default_home = "/home/USERNAME"; my $default_shell = "/bin/bash"; my $default_password = undef; my $default_quota = ""; my $makehome = ''; our $opt_c; our $opt_d; our $opt_f; our $opt_g; our $opt_h; our $opt_i; our $opt_l; our $opt_m; our $opt_o; our $opt_p; our $opt_q; our $opt_s; our $opt_t; $ENV{PATH} = "/opt/IDEALX/sbin:$ENV{PATH}"; if (defined $ARGV[0] and $ARGV[0] eq "--help") { &usage; exit; } getopts("cd:f:g:hil:mo:p:s:q:"); if (defined($opt_h)) { $opt_h = 1; &usage; exit; } if (defined($opt_i)) { $opt_i = 1; } if (defined($opt_m)) { $makehome = ' -m '; } if (defined($opt_t)) { $opt_t = 1; } if (defined($opt_f) && ! -f "$opt_f") { print STDERR "#$0: input file ($opt_f) cannot be found\n"; exit; } elsif ($opt_f) { open INPUT, "<$opt_f"; } else { open INPUT, "<&STDIN"; } if (defined($opt_d)) { $default_home = $opt_d; } if (defined($opt_g)) { $default_gid = $opt_g; } if (defined($opt_s)) { $default_shell = $opt_s; } if (defined($opt_o)) { open OUTPUT, ">>$opt_o"; } else { open OUTPUT, ">&STDOUT"; } if (defined($opt_l)) { $opt_p =~ s/[ \t]//g; if ($opt_l !~ /^[0-9]+,[0-9]+$/) { print STDERR "#$0: argument to -l must be in the form min-length,max-length\n"; exit(1); } ($min_len, $max_len) = split /,/, $opt_l; } if (defined($opt_p)) { $opt_p =~ s/[ \t]//g; if ($opt_p =~ /default=([^,]+)/) { $default_password = $1; } else { foreach my $pwopt (split /,/, $opt_p) { if ($pwopt eq "sp") { # turn on special characters $pw_spchr = 1; } elsif ($pwopt eq "uc") { # turn on uppercase characters $pw_ucchr = 1; } elsif ($pwopt eq "random") { # turn on total randomness $pw_random = 1; } else { print STDERR "#$0: -p $pwopt not recognized.\n"; &usage; exit(1); } } } } if (defined($opt_q)) { $default_quota = $opt_q } if (!defined($opt_i)) { print "For all of the following questions, I recommend that you just "; print "hit ENTER unless you know what you're doing.\n"; # ask the user some stuff if (!defined($opt_g)) { # the user did not pass a -g option, so we should ask about the # default GID my $defgid_ok = 0; while ($defgid_ok == 0) { print "What GID do you want these users to have by default? [$default_gid] "; chomp (my $new_defgid = readline STDIN); if (length($new_defgid) == 0) { $defgid_ok = 1; } else { if ($new_defgid =~ /^[1-9][0-9]*$/) { $default_gid = $new_defgid; $defgid_ok = 1; } else { print "Your answer starts with 0 or does not consist of only numbers.\n"; } } } } if (!defined($opt_d)) { # the user did not pass a -d option, so we should ask about the # default home Directory my $defhome_ok = 0; while ($defhome_ok == 0) { print "What home directory do you want these users to have by default?\n"; print " (Your answer must contain \"USERNAME\".) [$default_home] "; chomp (my $new_defhome = readline STDIN); if (length($new_defhome) == 0) { $defhome_ok = 1; } else { if ($new_defhome =~ /^\/.*USERNAME.*$/) { $default_home = $new_defhome; (my $pdir = $default_home) =~ s/USERNAME//; system ("mkdir -p $pdir"); $defhome_ok = 1; } else { print "Your answer did not begin with /, or did not contain \"USERNAME\".\n"; } } } } if (!defined($opt_q)) { # the user did not pass a -q option, so we should ask about the # default quota print "Note: Quota support is UNTESTED! Use it at your own risk.\n"; print "If you are willing to test, please provide feedback to $support\n"; print "Model user for quota: [default is no quota] "; chomp (my $new_defquota = readline STDIN); if (length($new_defquota) > 0 and $new_defquota =~ /^[A-Za-z0-9_-]+$/) { $default_quota = $new_defquota; } else { # the default is to not set quotas, so we should make sure # edquota isn't run below $default_quota = ""; } } if (!defined($opt_s)) { # the user did not pass a -s option, so we should ask about the # default shell my $defshell_ok = 0; while ($defshell_ok == 0) { print "What shell do you want these users to have by default? [$default_shell] "; chomp (my $new_defshell = readline STDIN); if (length($new_defshell) == 0) { $defshell_ok = 1; } else { if ($new_defshell =~ /^\/.*$/) { $default_shell = $new_defshell; $defshell_ok = 1; } else { print "Your answer does not begin with a /.\n"; } } } } } my $date = localtime; print OUTPUT "\n#################################\n"; print OUTPUT "# $date\n"; # read each line of standard input foreach my $line () { # get rid of the newline at the end of our $line chomp $line; # ignore comments if ($line =~ /^[ \t]*#/ or $line !~ /./) { next; } # firstname,surname,username,[GID,shell,home,quota,password] if ($line !~ /^.+,.+,.+(?:,.*){0,5}$/) { # we don't understand this line of input push @badinput, "$line"; next; } # Divide the line into its fields my ($first,$last,$uname,$gid,$shell,$home,$quota,$password) = split /,/, $line; # Delete all whitespace in some of the fields foreach my $var (($uname,$gid,$shell,$home,$quota,$password)) { if (defined ($var)) { $var =~ s/[\s]//g; }; } # process the GID if (!defined($gid) or length($gid) == 0 or $gid eq "default") { $gid = $default_gid; } if ($gid =~ /[^0-9]/) { push @badinput, "$line ($gid has non-numeric characters)"; next; } # process the home directory if (!defined($home) or length($home) == 0 or $home eq "default") { $home = $default_home; } $home =~ s/USERNAME/$uname/gi; # process the shell if (!defined($shell) or length($shell) == 0 or $shell eq "default") { $shell = $default_shell; } if (! -x "$shell") { print "$line would get non-executable or non-existent shell ($shell)\n"; exit; } # process the quota if (!defined($quota) or length($quota) == 0 or $quota eq "default") { $quota = $default_quota; } if (!defined($password) or length($password) == 0 or $password eq "default") { if (defined($default_password)) { $password = $default_password; } else { $password = &create_password($pw_random, $min_len, $max_len, $pw_spchr, $pw_ucchr); } } # If we're only testing print what we would do and skip to the next account. if (defined($opt_t)) { print "$first, $last, $uname, $gid, $shell, $home, $quota, $password\n"; next; } # Add the user my $rc = system("smbldap-useradd -a $makehome -g $gid -c \"$first $last\" -s $shell -d $home $uname"); if ($rc == 0) { # the user was successfully added print OUTPUT "$first, $last, $uname, $gid, $shell, $home, $quota, $password\n"; if (!defined($opt_i) and defined($opt_o)) { print STDOUT "$first, $last, $uname, $gid, $shell, $home, $quota, $password\n"; } # Silently change the user's LDAP password # (If we don't redirect stderr into /dev/null, smbldap-passwd complains.) open PWD, "| smbldap-passwd $uname 2>/dev/null 1>&2"; print PWD "$password\n$password"; close PWD; # Set the user's quota if a quota has been defined if (length($quota) > 0) { my $status = system("edquota -p $quota $uname"); if ($status != 0) { push @errors, "quota definition error for $uname: $status"; } } } else { push @errors, "smbldap-useradd error for $uname: $rc."; } # Check the ownership of the home directory if (-d "$home") { my (undef,undef,undef,undef,$fuid,$fgid,undef,undef,undef,undef,undef,undef,undef) = stat("$home"); my $id = `id $uname`; $id =~ /uid=([0-9]+).*gid=([0-9]+)/; my ($uid,$gid) = ($1,$2); if ($uid != $fuid or $gid != $fgid) { push @errors, "ownership of $home (u: $fuid, g: $fgid) doesn't match the user/group of $uname (u: $uid, g: $gid)"; } } } if ($#badinput >= 0) { print "The following lines contain errors and were not processed:\n"; foreach my $error (@badinput) { print "$error\n"; } } if ($#errors>= 0) { print "The errors were encountered during processing:\n"; foreach my $error (@errors) { print "$error\n"; } } sub usage() { my $me = $0; print "Usage: $me [-h] [-f ] [-o ]\n"; print " [-p { sp,uc,random [ -l min,max ] | default=pass } ]\n"; print " [ -g GID ] [ -d ] [ -q \n"; print " [ -s ] [ -i ] [ -m ]\n"; print " -d Use the named home directory as the default for each user.\n"; print " The specified directory MUST contain the string \"USERNAME\".\n"; print " Example: /home/USERNAME\n"; print " -f Use the named file for input.\n"; print " You must either supply this option or pipe your\n"; print " userinfo data into this script.\n"; print " -g Use this group ID for all users without GID in the input.\n"; print " -h Prints this help message.\n"; print " -i This turns OFF interactivity and uses the following default values:\n"; print " home: $default_home\n"; print " GID: $default_gid\n"; print " shell: $default_shell\n"; print " quota: $default_quota\n"; print " -l min,max Set the minimum and maximum password lengths.\n"; print " This argument is only effective if \"-p random\" is passed.\n"; print " -m Make the user's home directory if doesn't exist.\n"; print " -o Use the named file for output.\n"; print " If you don't specify this option, output will print\n"; print " to standard output.\n"; print " -p You must choose at least one of the following options,\n"; print " and multiple selections must be separated by commans:\n"; print " sp: turns on special characters\n"; print " uc: turns on uppercase characters\n"; print " random: turns on complete randomness\n"; print " default=pass: turns off password generation, and sets all\n"; print " blank (or \"default\") passwords to \"pass\".\n"; print " -q Specify a model user for setting new users' quotas\n"; print " -s Use the named program as the default login shell.\n"; print " Example: /bin/bash # (for normal login)\n"; print " Example: /bin/false # (to prevent terminal logins)\n"; print " -t Only test - do not create real accounts\n"; print " This prints the same output as it would if the accounts were being created.\n"; print " It allows you to make sure you like how things will turn out before you create the accounts.\n"; print " Each line of your input file must be in this format:\n"; print " Ralph,Walf,rwalf,525,/bin/bash,/home/rwalf/,quota_model_user,password3\n"; print " In the above example,\n"; print " Ralph = first name\n"; print " Walf = last name\n"; print " rwalf = username\n"; print " 525 = group ID (optional)\n"; print " /bin/bash = login shell (optional)\n"; print " /home/rwalf/ = home directory (optional)\n"; print " quota_user = quota model username (optional)\n"; print " This must have been created manually with, e.g., \"adduser\" and \"edquota\".\n"; print " password3 = password (optional)\n\n"; print " Any of the \"optional\" fields may be set to \"default\" or left blank.\n"; print " This will use the default value for any of those fields, and/or will generate\n"; print " a password depending on your \"-p\" option.\n"; print " All passwords, generated, default, or otherwise, are printed in the output,\n"; print " either on the screen or in your \"-o\" output file.\n"; print " Input lines that start with '#' are ignored.\n"; } smbldap-configure-4.0/userinfo.delete.example0000600000000000000000000000113110207525247020114 0ustar rootroot# Example of userinfo.delete file # Do these commands to delete the following example users: # $ mv userinfo.delete.example userinfo.delete # $ make delete # Your users will be deleted! # Lines that only have a single word are presumed to contain only # a username. # Other lines are assumed to have output from smbldap-useradd-bulk in # the following format: # First,Last,username,GID,shell,homedir,password mmouse tcat Fatt, Catt, fcatt, 513, /bin/bash, /home/fcatt, act35sib Minnie, Mouse, mimouse, 513, /bin/bash, /home/mimouse, roi65him Skinny, Catt, scatt, 513, /bin/bash, /home/scatt, sar79pox smbldap-configure-4.0/README0000644000000000000000000000260410363606322014337 0ustar rootrootProject home: http://www.majen.net/smbldap/ Visit there to find: * the latest version of the Samba/LDAP Installer * the documentation for the Samba/LDAP Installer Also, read the NEWS file. ------------------------------------ This stuff is intended to help people install and configure Samba and LDAP together. The Samba-LDAP_smbldap-installer documents have a little bit more detail than this file does. But in any case, you should heed the following message: WARNING: This software comes to you with NO WARRANTY WHATSOEVER. This software is not guaranteed to be useful in any way for any purpose whatsoever, and it may destroy your whole network and turn all your CPUs into smouldering ruins. On the other hand, I've used this myself and it worked for me. So you might want to try this command which will hopefully set up and configure Samba and LDAP: ./smbldap all After that, you could try creating a file in this directory named "userinfo.start" and putting a "Firstname,Lastname" line for each of your users in it. (If you're confused, you might benefit from looking at userinfo.start.example.) Then, if you're the daring sort, you could run this command: ./smbldap users If you're lucky, it may be the case that each of your users will be added to the system, and all the information about each user will be in a file named userinfo.finish. If you're lucky. --matt smbldap-configure-4.0/smbldap-ldif-backup-configure0000755000000000000000000001336210642507253021173 0ustar rootroot#!/bin/bash # $Id: smbldap-ldif-backup-configure,v 1.9 2006/10/24 05:22:01 moquist Exp $ ############################################ # smbldap-ldif-backup-configure # -- Automatically configure regular LDIF backups of the LDAP # database to be performed by smbldap-ldif-backup # Copyright (C) 2005 Matt Oquist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Author: Matt Oquist support='Matt Oquist ' ############################################ if [ "$UID" -ne 0 ]; then echo You must run this program as root. exit fi # Prompt, read and validate a user preference # Parameters: # (req) 1: Prompt message # (req) 2: Default value # (opt) 3: Validation function (takes answer, returns 0 for "valid") # (opt) 4: Valid answers function getpref { [ -z "$1" -o -z "$2" ] && echo bad params for getpref \($@\) >&2 && exit msg="$1" def="$2" validation_rtn="$3" choices="$4" pref= while [ -z "$pref" ]; do pref_new= echo $msg \[$def\] >&2 if [ -n "$choices" ]; then echo Here are your choices: >&2 for choice in $choices; do printf "\t$choice\n" >&2 done fi read -e pref_new if [ -z "$pref_new" ]; then pref="$def" break fi if [ -n "$validation_rtn" ]; then $validation_rtn "$pref_new" if [ $? -eq 0 ]; then pref="$pref_new" break else printf "\nSorry, $pref_new is not a valid answer.\n" >&2 fi fi if [ -n "$choices" ]; then for choice in $choices; do if [ "$pref_new" == "$choice" ]; then pref="$pref_new" break fi done if [ -n "$pref" ]; then break else printf "\nSorry, $pref_new is not a valid answer.\n" >&2 fi fi done echo "$pref" } function validate_number { [ -z "$1" ] && echo no param for validate_number && exit input="$1" sub=`echo $input | sed 's/[^0-9]*//g'` if [ "$sub" == "$input" ]; then return 0 fi return 1 } function validate_dir { [ -z "$1" ] && echo no param for validate_dir && exit input="$1" if [ "${input#/}" == "$input" ]; then echo Error: $input does not begin with \'/\'. >&2 return 1 fi # remove leading slashes and trailing whitespace # Removing leading slashes ensures that the following -z test # doesn't allow $input == /. input=`echo $input | sed 's/^\/*//' | sed 's/[ \t]*$//'` if [ -z "$input" ]; then echo Error: your answer specifies the root directory >&2 return 1 fi return 0 } # set some defaults that we know backups_dir="/var/smbldap-backups" logrotate_script="/etc/logrotate.d/smbldap-ldif-backups" backup_frequency="daily" rotate_frequency="weekly" rotate_number=8 echo echo Configuring rotated LDIF backups... # Get user preferences backup_frequency=`getpref "How often do you want your LDAP database backed up?" \ "daily" "" "hourly daily weekly monthly"` rotate_frequency=`getpref "How often do you want your backup files rotated?" \ "weekly" "" "daily weekly monthly"` rotate_number=`getpref "How many rotated backup files do you wish to keep?" \ "8" "validate_number"` backup_script="/etc/cron.${backup_frequency}/smbldap-ldif-backup" backups_dir=`getpref "In which directory do you want the LDIF backups to be stored?"\ "$backups_dir" "validate_dir"` ############ # Configure the backups mkdir -p "$backups_dir" if [ "$?" -ne 0 ]; then echo mkdir -p \"$backups_dir\" returned $?, and I\'m stopping because that\'s scary. exit fi if [ -f "$logrotate_script" ]; then echo $logrotate_script already exists, will overwrite in 10 seconds. This probably doesn\'t matter, but I wanted you to know. Type \(CTRL+C to cancel\)... sleep 10 fi if [ -f "$backup_script" ]; then echo $backup_script already exists, will overwrite in 10 seconds. This probably doesn\'t matter, but I wanted you to know. Type \(CTRL+C to cancel\)... sleep 10 fi # write out logrotate_script cat > "$logrotate_script" < "$backup_script" <> "\$LOCK" lockproc=\`head -n1 \$LOCK 2>/dev/null\` # If this process' procid isn't the first one in our lock file, # print an error and exit if [ "\$lockproc" != "\$$" ]; then echo error: Lockfile \(\$LOCK\) preventing ldif backup. echo You should remove the lockfile if no ldif backup is currently running. exit fi slapcat -l "$backups_dir/smbldap.ldif" rm -f "\$LOCK" >/dev/null 2>&1 EOF chmod 755 "$backup_script" # Do an initial backup right now "$backup_script" smbldap-configure-4.0/smbldap-restore0000755000000000000000000000615310642507253016516 0ustar rootroot#!/bin/bash # Author: moquist@majen.net # License: GPL # $Id: smbldap-restore,v 1.1 2007/02/15 17:27:54 moquist Exp $ # This script exists because sometimes the LDAP database is totally hosed # 1. kill slapd processes # 2. move /var/lib/ldap over # 3. create /var/lib/ldap # 4. chown /var/lib/ldap # 5. slapadd $1 DEBUG= wait=20 timestamp=`date +%s` SLAPADD=/usr/sbin/slapadd ldapinits="/etc/init.d/slapd /etc/init.d/ldap" ldapdirs="/var/lib/ldap" ############################################################ ####### Find system files/dirs echo Finding ldap init script... ldapinit= for init in $ldapinits; do if [ -x "$init" ]; then echo " found $init" ldapinit=$init break fi done if [ -z "$ldapinit" ]; then echo Error: Could not find ldap init script under /etc/init.d/. exit 1 fi echo Finding ldap data directory... ldapdir= for dir in $ldapdirs; do if [ -d "$dir" ]; then echo " found $dir" ldapdir=$dir break fi done if [ -z "$ldapdir" ]; then echo "Error: Could not find ldap data directory NOWHERE. This makes me very sad. :(" exit 1 fi ############################################################ ####### Get user input input="$1" if [ -z "$input" ]; then echo Error: You must submit an LDIF input filename. exit 1 fi if [ ! -f "$input" ]; then echo Error: I cannot read the specified input file: $input exit 1 fi echo "Do you REALLY want to restore the entire LDAP database from $input? (Y/n)" read confirm [[ -n "`echo $confirm | grep -i n`" ]] && echo aborting && exit 1 echo "Do you want me to try to shut LDAP down properly? (Y/n)" echo " (If not I will have NO MERCY...)" read careful if [ -z "`echo $careful | grep -i n`" ]; then echo NICELY attempting to kill slapd processes... echo " if you want to give up after a bit," echo " type CTRL-C and tell me to have NO MERCY next time." $DEBUG $ldapinit stop else echo Killing slapd processes... $DEBUG killall slapd echo Waiting $wait seconds for slapd processes to die... sleep $wait echo REALLY killing any leftover slapd processes \(BOOM\!\)... $DEBUG killall -9 slapd sleep 2 echo ***BOOM\!*** sleep 3 echo " ***BOOM!***" sleep 5 echo ***BOOM\!*** sleep 1 echo " ***BOOM!***" fi echo OK, so I think slapd is really dead now. I hope. ############################################################ echo Figuring out $ldapdir ownership... owners=`command ls -ld $ldapdir | awk '{print $3":"$4}'` echo Moving $ldapdir to $ldapdir.$timestamp... $DEBUG mv $ldapdir $ldapdir.$timestamp echo Creating fresh $ldapdir... $DEBUG mkdir $ldapdir echo "Chowning fresh $ldapdir... ($owners)" $DEBUG chown $owners $ldapdir echo "Reading input LDIF file: $input (this may take a few minutes)..." $DEBUG time $SLAPADD -l $input echo "Happy day! The LDIF file was successfully read, I think." #echo "Do you want me to start the LDAP service now? (Y/n)" #read startldap #[[ -n "`echo $startldap | grep -i n`" ]] && echo "OK, you're on your own now." && exit 0 echo Attempting to start LDAP service... $DEBUG $ldapinit start smbldap-configure-4.0/smbldap-install0000755000000000000000000001713110642567736016513 0ustar rootroot#!/usr/bin/perl -w # $Id: smbldap-install,v 1.10 2006/07/12 08:06:59 moquist Exp $ ############################################ # smbldap-install -- Installation script for Samba/LDAP # Copyright (C) 2005 SAU16 School District, Exeter, NH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Author: Matt Oquist # Based on the How-To by David Trask, which should be included with # this script. The How-To might also be linked from: # http://www.vcs.u52.k12.me.us/index.php?option=content&task=section&id=3&Itemid=32 ############################################ use strict; use Getopt::Std; require "smbldap-funcs.pm"; &verify_root; # Turn off buffering; it causes problems when installing remote slave-BDC # systems via ssh commands. $| = 1; our $opt_d; our $opt_h; our $opt_I; our $opt_m; our $gl_distribution = "ubuntu"; our $gl_distribution_media = "cd"; getopts("d:hIm:"); if (defined($opt_d)) { $gl_distribution = $opt_d; } if (defined($opt_h)) { $opt_h = 1; &usage; exit; } if (defined($opt_m)) { $gl_distribution_media = $opt_m; } # Set up our logfile chomp (my $pwd = `pwd`); my $logdir = $pwd; while (! -w "$logdir") { &log ("I need to create a logfile that you can view in case this script has errors.\n"); &log ("I don't have write permission for the $logdir directory.\n"); &prompt ("Please enter a directory where I can write the logfile: [$logdir] "); chomp (my $new_logdir = readline STDIN); if (length($new_logdir) > 0) { $logdir = $new_logdir; } } my $rc = 0; my $media_dsf = undef; our $logfile = "$logdir/smbldap-install.log"; my $timestamp = localtime; $timestamp =~ s/[ :]/_/g; my $tmpdir = "/tmp/.$timestamp-$$"; ############################################################################### # dependencies require "distro_data.pm"; our %distro_data; my $date = localtime; &log("###########################################################\n"); &log("Starting Samba/LDAP Installation: $date\n"); ############################################################################### # Ask the user for conf information &get_user_data; ########## # meet the dependencies if (defined($opt_I)) { &do_install_netrepo; } # If we're on an RPM-based system, we may have dependencies left to meet. chomp (my $rpm = `which rpm`); if (length($rpm) == 0) { &do_exit; } &log ("Gathering system information...\n"); &do_exit; ################################################################################ # subroutines sub get_user_data() { ############# # linux distribution id my $valid_distro = 0; my $distlist = ""; foreach my $distro (sort keys %distro_data) { if ($distro eq "nonworking_example") { next; } $distlist .= " $distro "; } # If the user specified the distribution on the command line, we # don't need to ask about it. if (defined($opt_d) and $distlist =~ / $opt_d /) { $valid_distro = 1; } while ($valid_distro == 0) { $valid_distro = 1; print "This installation script will work best for versions of\n"; print "distributions of GNU/Linux that have been entered in\n"; print "distro_data.pm. Feel free to add new versions/distros and share\n"; print "your updated distro_data.pm file!\n\n"; print "If your distro isn't listed, try the most similar one and it may work.\n"; print "In any case, if you get the required packages installed you can run smbldap-configure manually.\n"; &prompt ("Please select your Linux distribution from the following options: [$gl_distribution]\n"); foreach my $distro (sort keys %distro_data) { if ($distro eq "nonworking_example") { next; } &log ("\t$distro\n"); } chomp (my $new_distro = readline STDIN); if (length($new_distro) > 0) { if ($distlist =~ / $new_distro /) { $gl_distribution = $new_distro; } else { &warn ("Invalid distro name.\n"); $valid_distro = 0; } } } # end while loop to verify the linux distro entry &only_log ("Using distribution=$gl_distribution\n"); ############# # distribution media my @media = keys %{$distro_data{$gl_distribution}->{media_mnt_point}}; my $media_entered = 1; if ($#media > 0 and !defined($opt_m)) { $media_entered = 0; } while ($media_entered == 0) { &prompt ("Please select which distribution media you have available in case we need it: [$gl_distribution_media]\n"); foreach my $distromedia (@media) { &log ("\t$distromedia\n"); } chomp (my $new_distribution_media = readline STDIN); if (length($new_distribution_media) > 0) { # verify that the media entered by the user is in our list foreach my $distromedia (@media) { if ($new_distribution_media eq $distromedia) { $media_entered = 1; } } # If the media named by the user is in our list, store the new # value if ($media_entered != 0) { $gl_distribution_media = $new_distribution_media; } } } # end while loop to verify distribution media entry &only_log ("Using distribution_media=$gl_distribution_media\n"); } # Attempt to install the necessary packages via the Internet if a command is # specified in the distro data sub do_install_netrepo() { if (defined($distro_data{$gl_distribution}->{netrepo_command})) { &log ("Trying to install packages from the Internet...\n"); #&do_system($logfile, "$distro_data{$gl_distribution}->{netrepo_command}"); my $rc = system("$distro_data{$gl_distribution}->{netrepo_command}"); if ($rc != 0) { &warn ("Error installing required packages.\n"); &do_exit("error"); } } } sub do_exit($) { my $status = shift; &log ("\n\nThis script has appended its output to $logfile.\n"); if (defined $status and $status eq "error") { &warn ("You can check that file for additional error messages.\n"); exit 1; } &log ("Removing my temporary directory $tmpdir...\n"); &do_system($logfile, "rm -r $tmpdir"); if (-d "$tmpdir") { &warn ("\nUh-oh! $tmpdir could not be removed.\n"); &log ("You might want to check into that.\n"); } &log ("Congratulations! It looks like we've succeeded in installing the packages necessary for you to configure a Samba/LDAP server.\n"); exit 0; } sub usage() { my $me = $0; print "Usage: $me [-h] [-d ]\n"; print " -d Specify the Linux distribution here to avoid being asked interactively.\n"; print " The following distributions are available in this version:\n"; for my $ddistro (keys %distro_data) { print " $ddistro\n"; } print " -h Prints this help message.\n"; print " -I Install the necessary packages from the Internet\n"; print " -m Specify the Linux distribution media (cd or dvd) here to avoid being asked interactively.\n"; } smbldap-configure-4.0/userinfo.start.example0000600000000000000000000000046210502044050017777 0ustar rootroot# Example of userinfo.start file # Do these commands to add these users: # $ mv userinfo.start.example userinfo.start # $ ./smbldap users # Your user information (including usernames and passwords) will be in # userinfo.finish. Matt,Watt Fatt,Catt Skinny,Catt Minnie,Mouse Mickey,Mouse Tom,Cat Jerry,Mouse smbldap-configure-4.0/smbldap-configure0000644000000000000000000015654410664566060017030 0ustar rootroot#!/usr/bin/perl -w # $Id: smbldap-configure,v 1.105 2007/07/03 18:00:02 moquist Exp moquist $ ############################################ # smbldap-configure -- Configuration script for Samba/LDAP # Copyright (C) 2005 SAU16 School District, Exeter, NH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Author: Matt Oquist # Based on the How-To by David Trask. our $support = 'Matt Oquist '; ############################################ use strict; use Getopt::Std; require "smbldap-funcs.pm"; &verify_root; # Turn off buffering; it causes problems when installing remote slave-BDC # systems via ssh commands. $| = 1; # Set up our logfile chomp (my $pwd = `pwd`); my $logdir = $pwd; while (! -w "$logdir") { &log ("I need to create a logfile that you can view in case this script has errors.\n"); &log ("I don't have write permission for the $logdir directory.\n"); &prompt ("Please enter a directory where I can write the logfile: [$logdir] "); chomp (my $new_logdir = readline STDIN); if (length($new_logdir) > 0) { $logdir = $new_logdir; } } my $rc = 0; our $answersfile = "$logdir/smbldap-configure.answers"; our $logfile = "$logdir/smbldap-configure.log"; our $opt_a; our $opt_t; our $gl_answers_input = $answersfile; our $gl_server_type = "standalone"; getopts("a:t:"); if (defined($opt_a)) { $gl_answers_input = $opt_a; } if (defined($opt_t)) { $gl_server_type = $opt_t; } $logfile = "$logdir/smbldap-configure.$gl_server_type.log"; require "distro_data.pm"; our %config_files; our @smbldap_tools_path; our %service_scripts; our @programs; our $separator = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; our $slapcat_ldif_path = "/tmp/"; our $replica = < /set /yes REM To map a home directory to drive x: REM net use x: /home EOF my $date = localtime; &log ("###########################################################\n"); &log ("Starting Samba/LDAP Config: $date\n"); my $warning = < "example.net", "manager_user" => "Manager", "dc_domain" => "dc=example,dc=net", "mail_domain" => "example.net", "workgroup" => "EXAMPLENET", "netbios" => "EXAMPLENET-PDC", "master_password" => '', "slave_password" => '', "smbpassword" => '', "windows_drive_letter" => 'X', "sid" => '', "user_script" => 'logon.bat', "min_passwd_len" => 5, "smb_netlogon_path" => "/opt/samba/netlogon", "smb_profiles_path" => "/opt/samba/profiles", "smbldap_tools_path" => "", "max_passwd_age" => 99999, "net_interfaces" => "eth0", "do_nfs" => "n", "nfs_net" => '', "master_host" => '127.0.0.1', "slave_host" => '127.0.0.1', "replica_bind_user" => 'Manager', #'updateuser', "replica_bind_user_pw" => '', "samba_bind_user" => 'Manager', #'sambaadmin', "netbios_bdc" => '', "domain_master" => 'yes', "preferred_master" => 'yes', "unused_updatedn" => '#UNUSED_UPDATEDN', "unused_updateref" => '#UNUSED_UPDATEREF', ); # Read answers from the answers input file if we have one. if (defined($gl_answers_input)) { if (! -r "$gl_answers_input") { &only_log ("Unable to read answers input file ($gl_answers_input).\n"); } else { open(ANSWERS, "< $gl_answers_input") || die("Can't open answers input file: $!"); foreach my $answer () { if ($answer =~ /^([^=]+)=(.*)$/) { my $key = $1; my $val = $2; # set $config{key} = val $config{$key} = $val; $config{$key."_set"} = 1; } } close ANSWERS; } } if ($role eq "standalone" or $role =~ /^[pb]dc$/) { ############# # smbldap-tools executables path my $sltvalid = 0; foreach my $path (@smbldap_tools_path) { if (-d "$path" and -x "$path/smbldap-useradd") { $config{"smbldap_tools_path"} = $path; &only_log ("I found the smbldap-tools in $path\n"); $sltvalid = 1; last; } } while ($sltvalid == 0) { &warn ("I was unable to find the location of the smbldap-tools.\n"); &prompt ("Please enter the name of the directory where the executable smbldap-useradd is located: "); chomp (my $new_sltp = readline STDIN); if (length($new_sltp) > 0 and -d "$new_sltp" and -x "$new_sltp/smbldap-useradd") { $config{"smbldap_tools_path"} = $new_sltp; $sltvalid = 1; } } } ############# # domain name # we want to do this no matter which role we're doing (including ldapclient) my $domain_done = 0; while ($domain_done == 0) { &log ("${separator}First, we must establish what the rootdn of your LDAP directory will be.\n"); &log ("It is considered the best practice to use your normal DNS domain name here, but this is not required.\n"); &log ("In any case, you must enter a domain name with two parts separated by a period. For example, \"two.parts\" would work.\n"); &prompt ("Please enter your domain name: [".$config{"domain"}."] "); if (defined($config{"domain_set"})) { &log ("$default_set_msg"); } chomp (my $new_domain = readline STDIN); if (length($new_domain) > 0) { $config{"domain"} = $new_domain; } # The domain must have more than one part, because the smbldap-tools barf # otherwise. So require a dot in the domain. if ($config{"domain"} =~ /\./) { $domain_done = 1; } else { &warn ("Sorry, your domain must have at least two parts.\n"); &warn ("That is, it must contain a dot.\n"); &log ("For example, \"domain.com\" is a valid domain,\n"); &log ("but \"domain_com\" is not.\n"); } } &only_log ("Using domain=".$config{"domain"}."\n"); $config{"dc_domain"} = "dc=".$config{"domain"}; $config{"dc_domain"} =~ s/\./,dc=/g; &only_log ("Using dc_domain=".$config{"dc_domain"}."\n"); if (!defined($config{"domain_set"})) { &store_answer("domain", $config{"domain"}); } $config{"mail_domain"} = $config{"domain"}; ############# # Windows workgroup (domain) if ($role eq "standalone" or $role =~ /^[pb]dc$/ or $role eq "webmin") { $config{"workgroup"} = uc $config{"domain"}; $config{"workgroup"} =~ s/[^A-Za-z0-9]//g; &log ("${separator}Next, we must know what your Windows Domain (workgroup) is named.\n"); &log ("This can be anything you like, but once you've picked one for the PDC you must use the same one for every BDC.\n"); &prompt ("Please enter your windows domain (workgroup) name: [".$config{"workgroup"}."] "); if (defined($config{"workgroup_set"})) { &log ("$default_set_msg"); } chomp (my $new_wg = readline STDIN); if (length($new_wg) > 0) { $config{"workgroup"} = $new_wg; } $config{"workgroup"} = uc $config{"workgroup"}; &only_log ("Using Windows domain=".$config{"workgroup"}."\n"); if (!defined($config{"workgroup_set"})) { &store_answer("workgroup", $config{"workgroup"}); } if ($role eq "standalone" or $role eq "webmin") { $config{"netbios"} = uc $config{"workgroup"}; $config{"netbios"} .= "-PDC"; &log ("${separator}I'm so excited, I simply *must* know the Windows Netbios name of the PDC you are configuring.\n"); &log ("You *will* tell me, won't you?\n"); &log ("It would be positively *scandalous* (or, dare I say, \"dysfunctional\") if this name were not a unique name on your network...\n"); &prompt ("Please enter your windows netbios name: [".$config{"netbios"}."] "); if (defined($config{"netbios_set"})) { &log ("$default_set_msg"); } chomp (my $new_nb = readline STDIN); if (length($new_nb) > 0) { $config{"netbios"} = $new_nb; } $config{"netbios"} = uc $config{"netbios"}; &only_log ("Using Windows netbios name=".$config{"netbios"}."\n"); if (!defined($config{"netbios"})) { &store_answer("netbios", $config{"netbios"}); } } } ############# # LDAP server if ($role eq "ldapclient" or $role =~ /^[pb]dc$/ or $role eq "webmin") { ############# # master_host my $master_host_done = 0; while ($master_host_done == 0) { &log ("${separator}Now we need to know the hostname or IP address of your master LDAP server, which is probably also your PDC.\n"); &prompt ("Please enter the hostname or IP of your master LDAP server (PDC): [".$config{"master_host"}."] "); if (defined($config{"master_host_set"})) { &log ("$default_set_msg"); } chomp (my $new_master_host = readline STDIN); if (length($new_master_host) > 0) { $config{"master_host"} = $new_master_host; } # We must be able to contact the master host if (&do_system($logfile, "ping -c 1 ".$config{"master_host"}) == 0) { $master_host_done = 1; } else { &warn ("I cannot ping the hostname or IP you entered.\n"); &warn ("Enter 'y' to proceed anyway (authentication will not work until ".$config{master_host}." is running), or 'n' to try pinging again: [y/N] "); chomp (my $master_host_checkagain = readline STDIN); if ($master_host_checkagain !~ /y/i) { $config{"master_host"} = ''; } } } &only_log ("Using master_host=".$config{"master_host"}."\n"); &store_answer("master_host", $config{"master_host"}); } # If we're doing a PDC if ($role eq "pdc") { ############# # slave_host my $slave_host_done = 0; while ($slave_host_done == 0) { &log ("${separator}Now we need to know the hostname or IP address of the slave LDAP server you're configuring, which is probably also going to be a BDC.\n"); &log ("The server you specify here should currently be running SSH if you want me to help configure it automatically.\n"); &prompt ("Please enter the hostname or IP of your slave LDAP server (BDC): [".$config{"slave_host"}."] "); if (defined($config{"slave_host_set"})) { &log ("$default_set_msg"); } chomp (my $new_slave_host = readline STDIN); if (length($new_slave_host) > 0) { $config{"slave_host"} = $new_slave_host; } # We must be able to contact the slave host if (&do_system($logfile, "ping -c 1 ".$config{"slave_host"}) == 0) { $slave_host_done = 1; } else { &warn ("I cannot ping the hostname or IP you entered.\n"); &warn ("This script will attempt to configure the BDC automatically later, and must be able to connect to it via ssh.\n"); &warn ("(You can configure the BDC semi-automatically later, but you will need to copy some files and run a script manually.)\n"); &warn ("Enter 'y' to proceed anyway (for now), or 'n' to try pinging again: [y/N] "); chomp (my $slave_host_checkagain = readline STDIN); if ($slave_host_checkagain !~ /y/i) { $config{"slave_host"} = ''; } } } &only_log ("Using slave_host=".$config{"slave_host"}."\n"); &store_answer("slave_host", $config{"slave_host"}); } if ($role =~ /^[bp]dc$/) { ############# # replica_bind_user # Just using the Netbios name for now ############# # netbios_bdc if (length($config{netbios_bdc}) == 0) { $config{"netbios_bdc"} = uc $config{"workgroup"}; $config{"netbios_bdc"} .= "-BDC"; } &log ("${separator}What fun! Now I need to know the Windows Netbios name of the BDC you are configuring.\n"); &log ("This must be a unique name on your network.\n"); &prompt ("Please enter your BDC's windows netbios name: [".$config{"netbios_bdc"}."] "); if (defined($config{"netbios_bdc_set"})) { &log ("$default_set_msg"); } chomp (my $new_nb = readline STDIN); if (length($new_nb) > 0) { $config{"netbios_bdc"} = $new_nb; } $config{"netbios_bdc"} = uc $config{"netbios_bdc"}; &only_log ("Using Windows netbios_bdc name=".$config{"netbios_bdc"}."\n"); &store_answer("netbios_bdc", $config{"netbios_bdc"}); # Just use the default for now. #$config{replica_bind_user} = $config{netbios_bdc}; #$config{replica_bind_user} = lc $config{replica_bind_user}; #$config{replica_bind_user} =~ s/[^a-z0-9_]/_/g; } my $pwseparator = $separator; while (length($config{"master_password"}) == 0) { &log ("${pwseparator}Next, you must enter your root and LDAP password.\n"); &log ("By default, this password will be used for binding to the rootdn to perform LDAP updates, and it will also be set as root's password in LDAP and Samba.\n"); &log ("You must consistently use the same password starting with the first PDC you create.\n"); &log ("(You can change the root user's password later using 'smbldap-passwd root' if you wish.)\n"); &prompt ("Please enter your LDAP password (CAUTION! This may appear on the screen!): "); &do_system ($logfile, "stty -echo"); chomp ($config{"master_password"} = readline STDIN); &do_system ($logfile, "stty echo"); #if ($config{"master_password"} =~ /[^A-Za-z0-9_]/) { if ($config{"master_password"} =~ /[']/) { &warn ("\nOops! Your password must not contain a single-quote.\n"); $config{"master_password"} = ""; $pwseparator = ''; next; } if (!length($config{"master_password"})) { &warn ("\nOops! Your password is not set.\n"); $config{"master_password"} = ""; $pwseparator = ''; next; } &prompt ("\nPlease verify your LDAP password: "); &do_system ($logfile, "stty -echo"); chomp ($config{"vpassword"} = readline STDIN); &do_system ($logfile, "stty echo"); if ($config{"master_password"} ne $config{"vpassword"}) { $config{"master_password"} = ''; &warn ("\nOops! Your password entries didn't match.\n"); $pwseparator = ''; } &log ("\n"); } $config{"smbpassword"} = $config{"master_password"}; $config{"slave_password"} = $config{"master_password"}; if ($role eq "standalone" or $role =~ /^[pb]dc$/) { # get the windows drive letter of user spaces my $dlvalid = 0; while ($dlvalid == 0) { $dlvalid = 1; &log ("${separator}So many options there are!\n"); &log ("When your users log into Windows, their home directory will automatically be mapped for them.\n"); &log ("You can choose which drive letter their home directory will mapped to.\n"); &prompt ("Please enter the home directory drive mapping letter for Windows: [".$config{"windows_drive_letter"}."] "); if (defined($config{"windows_drive_letter_set"})) { &log ("$default_set_msg"); } chomp (my $new_dl = readline STDIN); if ($new_dl =~ /^[E-Ze-z]$/) { # the user entered a valid drive letter $config{"windows_drive_letter"} = $new_dl; } elsif (length($new_dl) > 0) { # the user entered an invalid drive letter &warn ("You must enter a single letter from E to Z.\n"); $dlvalid = 0; } } &only_log ("Using Windows user space drive letter=".$config{"windows_drive_letter"}."\n"); if (!defined($config{"windows_drive_letter"})) { &store_answer("windows_drive_letter", $config{"windows_drive_letter"}); } # could prompt for this stuff, but it's probably not necessary (at # least for now) $config{"user_script"} = 'startup.bat'; $config{"min_passwd_len"} = 5; $config{"smb_netlogon_path"} = "/opt/samba/netlogon"; $config{"smb_profiles_path"} = "/opt/samba/profiles"; } # grab the locations of our config files; some of their paths are included in other config files for my $key (keys %config_files) { $config{$key} = $config_files{$key}->{'filepath'}; if (length($config{$key}) > 0) { if (defined $config_files{$key}->{'directive'}) { $config{$key} = "$config_files{$key}->{'directive'} $config{$key}"; } } } if ($role eq "standalone" or $role =~ /^[pb]dc$/) { # I don't like this; forcing users to change their passwords is of very dubious # value with modern computing power. # I'm removing this for now. # my $pwavalid = 0; # while ($pwavalid == 0) { # $pwavalid = 1; # &prompt ("Please enter the maximum password age (in days) for your network: [".$config{"max_passwd_age"}."] "); # if (defined($config{"max_passwd_age_set"})) { &log ("$default_set_msg"); } # chomp (my $new_pwa = readline STDIN); # if (length($new_pwa) > 0) { # if ($new_pwa =~ /^[0-9]+$/) { # $config{"max_passwd_age"} = $new_pwa; # } else { # $pwavalid = 0; # } # } # } # if (!defined($config{"max_passwd_age_set"})) { # &store_answer("max_passwd_age", $config{"max_passwd_age"}); # } my $netif_entered = 0; while ($netif_entered == 0) { $netif_entered = 1; ($config{"net_interfaces"}, my @if_info) = &do_get_net_ifs(0); &log ("${separator}We each have things we want to keep secret, and the contents of your Samba server should be one of yours.\n"); &log ("You can probably accept the default here unless one of the interfaces on this server is connected directly to the Internet.\n"); &log ("I do not recommend that you let an Internet-facing interface serve Samba.\n"); &log ("Your system has the following network interfaces.\n"); foreach my $if (@if_info) { &log ("\t$if\n"); } &prompt ("Please enter a comma-separated list of the interfaces\n\tconnected to your Windows/SAMBA network: [".$config{"net_interfaces"}."]\n"); chomp (my $new_iflist = readline STDIN); if (length($new_iflist) > 0) { # the user entered a new list of interfaces # get rid of spaces $new_iflist =~ s/ //g; # verify that each interface listed by the user exists foreach my $user_if (split /,/, $new_iflist) { my $done = 0; # loop through the system interfaces to find the interface # entered by the user foreach my $sys_if (@if_info) { $sys_if =~ s/:.*$//; if ($user_if eq $sys_if) { $done = 1; } } if ($done == 0) { $netif_entered = 0; &warn ("\nUh-oh! I couldn't find the \"$user_if\" interface on the system.\n"); } } if ($netif_entered != 0) { # Always add the loopback interface $config{"net_interfaces"} = "$new_iflist,lo"; } } } # while loop to verify network interface input &only_log ("Using net_interfaces=".$config{"net_interfaces"}."\n"); &warn ("You have chosen...wisely.\n"); &log ("${separator}NFS is so much fun, we could share files to everyone!\n"); &log ("NFS can be used to share files from this server to other Linux systems.\n"); &log ("If you have Linux clients (or an LTSP server separate from this system) on your network, you'll want NFS.\n"); &log ("If you want me to help you export your entire /home directory via NFS, then answer 'y' below.\n"); &log ("If you know how to handle /etc/exports all by yourself, then feel free to say 'n' and I'll leave you alone.\n"); &log ("I REALLY do not recommend that you let an Internet-facing interface serve NFS.\n"); &prompt ("Will other Linux machines need to access home directories\n"); &prompt ("stored on this server? [y/N] "); chomp ($config{"do_nfs"} = readline STDIN); if ($config{"do_nfs"} =~ /y/i) { my ($trash, @if_info) = &do_get_net_ifs(1); while ($config{"nfs_net"} !~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/) { if (length($config{"nfs_net"}) > 0) { &warn ("Uh-oh! ".$config{"nfs_net"}." is not a valid IP/Netmask specification for NFS.\n"); } &prompt ("Please enter the network you wish to allow NFS access to /home on this system.\n"); if ($#if_info > 0) { &log ("Here are some guesses based on your current network configuration:\n"); } else { &log ("Here is a guess based on your current network configuration:\n"); } foreach my $if (@if_info) { &log ("\t$if\n"); } chomp ($config{"nfs_net"} = readline STDIN); } &only_log ("Using nfs_net=".$config{"nfs_net"}."\n"); } } &log ("${separator}I'm done asking questions for now.\n"); &prompt ("If you want to go back and change an answer, type CTRL-C and re-run this script.\n"); &prompt ("Otherwise, hit Enter to continue."); chomp (my $good_to_go = readline STDIN); } # get network interface info sub do_get_net_ifs ($) { my $get_nfsnet = shift; my @if_info = (); my $if_count = 0; my $if_list = undef; my @ifconfig = `/sbin/ifconfig -a`; for (my $count = 0; $count <= $#ifconfig; $count++) { chomp (my $line = $ifconfig[$count]); my $bootproto = my $hwaddr = my $ipaddr = my $onboot = my $netmask = ''; if ($line =~ /^([A-Za-z0-9]+) /) { # this line begins a new interface section # skip the loopback interface if ($line =~ /^lo/) { next; } # skip the sit0 interface if ($line =~ /^sit0/) { next; } $if_info[$if_count] = $1; $count++; chomp (my $inet_addr = $ifconfig[$count]); # grab the current ip address if the interface is live if ($inet_addr =~ /inet addr:([0-9\.]*) /) { $ipaddr = "$1, "; } if ($inet_addr =~ /Mask:([0-9\.]*)$/) { $netmask = "$1, "; } # read the ifcfg file for this interface # Note that if the ifcfg file specifies an IP address for this # interface, that ip address will be overwrite our presentation of # the current IP address of the interface. # my $ifcfg = "/etc/sysconfig/network-scripts/ifcfg-$if_info[$if_count]"; # if (! -f "$ifcfg") { # delete $if_info[$count]; # } else { # open IFCFG, "< /etc/sysconfig/network-scripts/ifcfg-$if_info[$if_count]"; # foreach my $line () { # chomp $line; # if ($line =~ s/^bootproto=//i) { $bootproto = "$line, "; } # elsif ($line =~ s/^hwaddr=//i) { $hwaddr = "$line"; } # elsif ($line =~ s/^ipaddr=//i) { $ipaddr = "$line, "; } # elsif ($line =~ s/^netmask=//i) { $netmask = "$line, "; } # elsif ($line =~ s/^onboot=//i) { # if ($line =~ /yes/) { $onboot = "start on boot, "; } # else { $onboot = "manual start, "; } # } # } # close IFCFG; # add this interface to our default interface list if (defined($if_list)) { $if_list .= ",$if_info[$if_count]"; } else { $if_list = "$if_info[$if_count]"; } if ($get_nfsnet == 1) { if (length($ipaddr) > 0 and length($netmask) > 0) { $if_info[$if_count] = "${ipaddr}/${netmask}"; $if_info[$if_count] =~ s/, //g; } else { $if_count--; } } else { $if_info[$if_count] .= ": ${bootproto}${ipaddr}${onboot}${hwaddr}"; $if_info[$if_count] =~ s/, *$//; } $if_count++; # } } } return $if_list, @if_info; } sub munge_files ($$) { my $stage = shift; my $filename = shift; for my $key (keys %config_files) { my %conf_file = %{$config_files{$key}}; my $template = "$templates_path/$key"; # If we're trying to process a particular file, ignore all others and set # the specified file to be munged. if (defined($filename)) { if ($key ne $filename) { next; } else { $conf_file{specified} = 1; } } # process this conf file if it should be munged at or before our # current processing stage if ((defined $conf_file{stage} and $conf_file{stage} <= $stage and !defined $conf_file{complete}) or (defined ($conf_file{specified}) and $conf_file{specified})) { &make_bak ("$conf_file{filepath}"); if (! -f "$template") { &warn ("\nUh-oh! $template not found!\n"); &prompt ("Please specify the location of this file: [$template] "); chomp (my $new_loc = readline STDIN); if (length($new_loc) > 0) { $template = $new_loc; } } if (open CONF, "> $conf_file{filepath}") { open TEMPLATE, "< $template"; foreach my $line (