136f9935f7
2010-11-15 <mm@FreeBSD.org> * smbldap-useradd: - fix Z option in getopt (custom LDAP attribute) - drop unused L option from getopt - alphabetically reorganize getopt options - fix several mis-spellings and typos (thx to Paul Howarth <paul@city-fan.org>) * other utilities: - alphabetically reorganize getopt and help * new tag 0.9.6 2010-10-21 <mm@FreeBSD.org> * new tool: smbldap-grouplist (list LDAP groups) * smbldap-useradd, smbldap-usershow, smbldap-usermod: - change default encoding of givenName and sn to UTF-8 (bug #11717) - new option: -X (input/output encoding, defaults to UTF-8) - new option: -O (localMailAddress attribute) - changed option: -M (now sets only mail attribute) - home directory is now chowned as $userUidNumber:$userGidNumber (bug #11721) - use gecos as displayName if givenName and userSN not provided (bug #14517) * smbldap-passwd: - new option: -p (allow root to set password from STDIN without verification, e.g. using a pipe) (bug #11964) - change userPassword, shadowLastChange and shadowMax individually e.g. no shadow class or user may not have rights (bug #15052) * smbldap-groupmod: allow deletion of users from groups without a defined samba group SID) * remove references to smbldap_conf.pm
99 lines
2.9 KiB
Text
99 lines
2.9 KiB
Text
$NetBSD: patch-aa,v 1.2 2010/12/25 08:08:06 taca Exp $
|
|
|
|
- Fix paths for pkgsrc.
|
|
- Check samba is running.
|
|
|
|
--- configure.pl.orig 2010-11-15 14:45:49.000000000 +0000
|
|
+++ configure.pl
|
|
@@ -30,6 +30,7 @@
|
|
|
|
use strict;
|
|
use File::Basename;
|
|
+use FileHandle;
|
|
|
|
# we need to be root to configure the scripts
|
|
if ($< != 0) {
|
|
@@ -48,16 +49,19 @@ Before starting, check
|
|
print "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n";
|
|
|
|
# we first check if Samba is up and running
|
|
-my $test_smb=`pidof smbd`;
|
|
-chomp($test_smb);
|
|
+my $test_smb;
|
|
+$test_smb = read_pidfile('@SAMBA_PIDDIR@/smbd.pid');
|
|
+if (not defined $test_smb) {
|
|
+ $test_smb =`pidof smbd`;
|
|
+ chomp($test_smb);
|
|
+}
|
|
+
|
|
die "\nSamba need to be started first !\n" if ($test_smb eq "" || not defined $test_smb);
|
|
|
|
print "Looking for configuration files...\n\n";
|
|
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";
|
|
+if (-e "@PREFIX@/etc/samba/smb.conf") {
|
|
+ $smb_conf="@PREFIX@/etc/samba/smb.conf";
|
|
}
|
|
print "Samba Configuration File Path [$smb_conf] > ";
|
|
chomp(my $config_smb=<STDIN>);
|
|
@@ -65,14 +69,7 @@ if ($config_smb ne "") {
|
|
$smb_conf=$config_smb;
|
|
}
|
|
|
|
-my $conf_dir;
|
|
-if (-d "/etc/opt/IDEALX/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/";
|
|
-}
|
|
+my $conf_dir = '@PKG_SYSCONFDIR@';
|
|
|
|
print "\nThe default directory in which the smbldap configuration files are stored is shown.\n";
|
|
print "If you need to change this, enter the full directory path, then press enter to continue.\n";
|
|
@@ -303,7 +300,7 @@ my $default_user_gidnumber=read_entry(".
|
|
|
|
my $default_computer_gidnumber=read_entry(". default computer gidNumber","","515",0);
|
|
|
|
-my $userLoginShell=read_entry(". default login shell","","/bin/bash",0);
|
|
+my $userLoginShell=read_entry(". default login shell","","/bin/csh",0);
|
|
|
|
my $skeletonDir=read_entry(". default skeleton directory","","/etc/skel",0);
|
|
|
|
@@ -527,12 +524,12 @@ mailDomain=\"$mailDomain\"
|
|
# Allows not to use smbpasswd (if with_smbpasswd="0" in smbldap.conf) but
|
|
# prefer Crypt::SmbHash library
|
|
with_smbpasswd=\"0\"
|
|
-smbpasswd=\"/usr/bin/smbpasswd\"
|
|
+smbpasswd=\"@PREFIX@/bin/smbpasswd\"
|
|
|
|
# Allows not to use slappasswd (if with_slappasswd="0" in smbldap.conf)
|
|
# but prefer Crypt:: libraries
|
|
with_slappasswd=\"0\"
|
|
-slappasswd=\"/usr/sbin/slappasswd\"
|
|
+slappasswd=\"@PREFIX@/sbin/slappasswd\"
|
|
|
|
# comment out the following line to get rid of the default banner
|
|
# no_banner=\"1\"
|
|
@@ -573,5 +570,15 @@ print " $smbldap_bind_conf done.\n";
|
|
$mode=0600;
|
|
chmod $mode,"$smbldap_bind_conf","$smbldap_bind_conf.old";
|
|
|
|
-
|
|
-
|
|
+sub read_pidfile {
|
|
+ my($file) = @_;
|
|
+ my($fh, $line);
|
|
+
|
|
+ $fh = new FileHandle $file;
|
|
+ if (defined $fh) {
|
|
+ $line = $fh->getline;
|
|
+ chomp($line);
|
|
+ $fh->close;
|
|
+ }
|
|
+ return $line;
|
|
+}
|