initial import of smbldap-tools 0.9.2a

A collection of system tools to manipulate users and groups stored in an
LDAP directory, specifically to be used with SAMBA-LDAP.

Additionally, some scripts are designed to ease your migration from a
Windows NT 4.0 PDC Server to a Samba-LDAP PDC Server.

ok mbalmer@
This commit is contained in:
msf 2007-01-29 08:32:50 +00:00
parent 08b35c5938
commit 9d37902a86
7 changed files with 291 additions and 0 deletions

View File

@ -0,0 +1,83 @@
# $OpenBSD: Makefile,v 1.1.1.1 2007/01/29 08:32:50 msf Exp $
COMMENT= "tools for managing samba ldap"
DISTNAME= smbldap-tools-0.9.2a
CATEGORIES= sysutils
EXTRACT_SUFX= .tgz
MAINTAINER= Mathieu Sauve-Frankel <msf@openbsd.org>
HOMEPAGE= http://samba.idealx.org/
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=smbldap-tools/}
RUN_DEPENDS= ::converters/p5-Unicode-MapUTF8 \
::databases/p5-ldap \
::security/p5-Crypt-SmbHash
WRKDIST= ${WRKDIR}/${DISTNAME:S/2a/2/}
NO_BUILD= Yes
NO_REGRESS= Yes
PKG_ARCH= *
SITE_PERL= ${PREFIX}/libdata/perl5/site_perl
HTML= contents_motif.gif index.html next_motif.gif \
previous_motif.gif smbldap-tools.html smbldap-tools001.html \
smbldap-tools002.html smbldap-tools003.html \
smbldap-tools004.html smbldap-tools005.html \
smbldap-tools006.html smbldap-tools007.html \
smbldap-tools008.html smbldap-tools009.html \
smbldap-tools010.html
TOOLS= groupadd groupdel groupmod groupshow useradd userdel usermod \
usershow passwd populate
MIGRATION= pwdump-accounts pwdump-groups unix-accounts unix-groups
pre-configure:
@for f in configure.pl smbldap.conf smbldap_tools.pm; do \
perl -pi -e 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/$$f; \
perl -pi -e 's|%%SYSCONFDIR%%|${SYSCONFDIR}|g' ${WRKSRC}/$$f; \
done
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/smbldap-tools/
${INSTALL_DATA} ${WRKSRC}/doc/smbldap-tools.pdf \
${PREFIX}/share/doc/smbldap-tools/
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/smbldap-tools/html/
@for f in ${HTML}; do \
${INSTALL_DATA} ${WRKSRC}/doc/html/$$f \
${PREFIX}/share/doc/smbldap-tools/html/ ; \
done
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/smbldap-tools/
@for f in smb.conf smbldap.conf smbldap_bind.conf; do \
${INSTALL_DATA} ${WRKSRC}/$$f \
${PREFIX}/share/examples/smbldap-tools/; \
done
${INSTALL_DATA} ${WRKSRC}/smbldap_tools.pm ${SITE_PERL}
${INSTALL_SCRIPT} ${WRKSRC}/configure.pl \
${PREFIX}/sbin/smbldap-configure
@for f in ${TOOLS}; do \
${INSTALL_SCRIPT} ${WRKSRC}/smbldap-$$f ${PREFIX}/sbin; \
done
@for f in ${MIGRATION}; do \
${INSTALL_SCRIPT} ${WRKSRC}/doc/smbldap-migrate-$$f \
${PREFIX}/sbin; \
done
.include <bsd.port.mk>

View File

@ -0,0 +1,4 @@
MD5 (smbldap-tools-0.9.2a.tgz) = bb8eb44adb4e7946de5b486acf480c24
RMD160 (smbldap-tools-0.9.2a.tgz) = a65a9996e5fdd5778907e75ef6337f63f9322eac
SHA1 (smbldap-tools-0.9.2a.tgz) = 8e46f52d4a49a03c20aca61ecc2dff315d537f67
SIZE (smbldap-tools-0.9.2a.tgz) = 299341

View File

@ -0,0 +1,53 @@
$OpenBSD: patch-configure_pl,v 1.1.1.1 2007/01/29 08:32:50 msf Exp $
--- configure.pl.orig Mon Jan 29 15:00:14 2007
+++ configure.pl Mon Jan 29 15:02:36 2007
@@ -49,7 +49,7 @@ Before starting, check
print "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n";
# we first check if Samba is up and running
-my $test_smb=`pidof smbd`;
+my $test_smb=`pgrep -x smbd`;
chomp($test_smb);
die "\nSamba need to be started first !\n" if ($test_smb eq "" || not defined $test_smb);
@@ -57,8 +57,8 @@ print "Looking for configuration files..
my $smb_conf="";
if (-e "/etc/samba/smb.conf") {
$smb_conf="/etc/samba/smb.conf";
-} elsif (-e "/usr/local/samba/lib/smb.conf") {
- $smb_conf="/usr/local/samba/lib/smb.conf";
+} elsif (-e "%%SYSCONFDIR%%/samba/smb.conf") {
+ $smb_conf="%%SYSCONFDIR%%/samba/smb.conf";
}
print "Samba Configuration File Path [$smb_conf] > ";
chomp(my $config_smb=<STDIN>);
@@ -67,12 +67,12 @@ if ($config_smb ne "") {
}
my $conf_dir;
-if (-d "/etc/opt/IDEALX/smbldap-tools") {
+if (-d "%%SYSCONFDIR%%/smbldap-tools") {
$conf_dir="/etc/opt/IDEALX/smbldap-tools/";
} elsif (-d "/etc/smbldap-tools") {
$conf_dir="/etc/smbldap-tools/";
} else {
- $conf_dir="/etc/opt/IDEALX/smbldap-tools/";
+ $conf_dir="%%SYSCONFDIR%%/smbldap-tools/";
}
print "\nThe default directory in which the smbldap configuration files are stored is shown.\n";
@@ -528,12 +528,12 @@ mailDomain=\"$mailDomain\"
# 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\"
+smbpasswd=\"%%LOCALBASE%%/bin/smbpasswd\"
# Allows not to use slappasswd (if with_slappasswd == 0 in smbldap_conf.pm)
# but prefer Crypt:: libraries
with_slappasswd=\"0\"
-slappasswd=\"/usr/sbin/slappasswd\"
+slappasswd=\"%%LOCALBASE%%/sbin/slappasswd\"
# comment out the following line to get rid of the default banner
# no_banner=\"1\"

View File

@ -0,0 +1,80 @@
$OpenBSD: patch-smbldap_conf,v 1.1.1.1 2007/01/29 08:32:50 msf Exp $
--- smbldap.conf.orig Mon Jan 29 14:39:29 2007
+++ smbldap.conf Mon Jan 29 14:59:05 2007
@@ -34,12 +34,12 @@
# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
-SID="S-1-5-21-4205727931-4131263253-1851132061"
+# SID="S-1-5-21-4205727931-4131263253-1851132061"
# Domain name the Samba server is in charged.
# If not defined, parameter is taking from smb.conf configuration file
# Ex: sambaDomain="IDEALX-NT"
-sambaDomain="IDEALX-NT"
+# sambaDomain="IDEALX-NT"
##############################################################################
#
@@ -85,15 +85,15 @@ verify="require"
# CA certificate
# see "man Net::LDAP" in start_tls section for more details
-cafile="/etc/opt/IDEALX/smbldap-tools/ca.pem"
+cafile="%%SYSCONFDIR%%/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/opt/IDEALX/smbldap-tools/smbldap-tools.pem"
+clientcert="%%SYSCONFDIR/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/opt/IDEALX/smbldap-tools/smbldap-tools.key"
+clientkey="%%SYSCONFDIR/smbldap-tools/smbldap-tools.key"
# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
@@ -123,7 +123,7 @@ idmapdn="ou=Idmap,${suffix}"
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
-sambaUnixIdPooldn="sambaDomainName=IDEALX-NT,${suffix}"
+# sambaUnixIdPooldn="sambaDomainName=IDEALX-NT,${suffix}"
# Default scope Used
scope="sub"
@@ -144,15 +144,15 @@ crypt_salt_format="%s"
# Login defs
# Default Login Shell
-# Ex: userLoginShell="/bin/bash"
-userLoginShell="/bin/bash"
+# Ex: userLoginShell="/bin/ksh"
+userLoginShell="/bin/ksh"
# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"
# Default mode used for user homeDirectory
-userHomeDirectoryMode="700"
+userHomeDirectoryMode="755"
# Gecos
userGecos="System User"
@@ -214,12 +214,12 @@ mailDomain="idealx.com"
# 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"
+smbpasswd="%%LOCALBASE%%/bin/smbpasswd"
# Allows not to use slappasswd (if with_slappasswd == 0 in smbldap_conf.pm)
# but prefer Crypt:: libraries
with_slappasswd="0"
-slappasswd="/usr/sbin/slappasswd"
+slappasswd="%%LOCALBASE%%/sbin/slappasswd"
# comment out the following line to get rid of the default banner
# no_banner="1"

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-smbldap_tools_pm,v 1.1.1.1 2007/01/29 08:32:50 msf Exp $
--- smbldap_tools.pm.orig Mon Jan 29 14:35:45 2007
+++ smbldap_tools.pm Mon Jan 29 14:38:50 2007
@@ -35,20 +35,20 @@ my $smbldap_conf;
if (-e "/etc/smbldap-tools/smbldap.conf") {
$smbldap_conf="/etc/smbldap-tools/smbldap.conf";
} else {
- $smbldap_conf="/etc/opt/IDEALX/smbldap-tools/smbldap.conf";
+ $smbldap_conf="%%SYSCONFDIR%%/smbldap-tools/smbldap.conf";
}
my $smbldap_bind_conf;
if (-e "/etc/smbldap-tools/smbldap_bind.conf") {
$smbldap_bind_conf="/etc/smbldap-tools/smbldap_bind.conf";
} else {
- $smbldap_bind_conf="/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf";
+ $smbldap_bind_conf="%%SYSCONFDIR%%/smbldap-tools/smbldap_bind.conf";
}
my $samba_conf;
if (-e "/etc/samba/smb.conf") {
$samba_conf="/etc/samba/smb.conf";
} else {
- $samba_conf="/usr/local/samba/lib/smb.conf";
+ $samba_conf="%%SYSCONFDIR%%/samba/smb.conf";
}
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

View File

@ -0,0 +1,5 @@
A collection of system tools to manipulate users and groups stored in an
LDAP directory, specifically to be used with SAMBA-LDAP.
Additionally, some scripts are designed to ease your migration from a
Windows NT 4.0 PDC Server to a Samba-LDAP PDC Server.

View File

@ -0,0 +1,39 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2007/01/29 08:32:50 msf Exp $
libdata/perl5/site_perl/smbldap_tools.pm
sbin/smbldap-configure
sbin/smbldap-groupadd
sbin/smbldap-groupdel
sbin/smbldap-groupmod
sbin/smbldap-groupshow
sbin/smbldap-migrate-pwdump-accounts
sbin/smbldap-migrate-pwdump-groups
sbin/smbldap-migrate-unix-accounts
sbin/smbldap-migrate-unix-groups
sbin/smbldap-passwd
sbin/smbldap-populate
sbin/smbldap-useradd
sbin/smbldap-userdel
sbin/smbldap-usermod
sbin/smbldap-usershow
share/doc/smbldap-tools/
share/doc/smbldap-tools/html/
share/doc/smbldap-tools/html/contents_motif.gif
share/doc/smbldap-tools/html/index.html
share/doc/smbldap-tools/html/next_motif.gif
share/doc/smbldap-tools/html/previous_motif.gif
share/doc/smbldap-tools/html/smbldap-tools.html
share/doc/smbldap-tools/html/smbldap-tools001.html
share/doc/smbldap-tools/html/smbldap-tools002.html
share/doc/smbldap-tools/html/smbldap-tools003.html
share/doc/smbldap-tools/html/smbldap-tools004.html
share/doc/smbldap-tools/html/smbldap-tools005.html
share/doc/smbldap-tools/html/smbldap-tools006.html
share/doc/smbldap-tools/html/smbldap-tools007.html
share/doc/smbldap-tools/html/smbldap-tools008.html
share/doc/smbldap-tools/html/smbldap-tools009.html
share/doc/smbldap-tools/html/smbldap-tools010.html
share/doc/smbldap-tools/smbldap-tools.pdf
share/examples/smbldap-tools/
share/examples/smbldap-tools/smb.conf
share/examples/smbldap-tools/smbldap.conf
share/examples/smbldap-tools/smbldap_bind.conf