aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2010-11-15 15:16:28 +0000
committerMartin Matuska <mm@FreeBSD.org>2010-11-15 15:16:28 +0000
commit40c400148e6bdc9cc38185e80c10bfbf83dd124e (patch)
tree19933743bfd6e203ab5dc802e59d0c36dafa771a
parent5d6c82bd43b81ab7192948c87cbc03b63e940a65 (diff)
downloadports-40c400148e6bdc9cc38185e80c10bfbf83dd124e.tar.gz
ports-40c400148e6bdc9cc38185e80c10bfbf83dd124e.zip
Notes
-rw-r--r--net/smbldap-tools/Makefile7
-rw-r--r--net/smbldap-tools/distinfo5
-rw-r--r--net/smbldap-tools/files/patch-configure.pl14
-rw-r--r--net/smbldap-tools/files/patch-smbldap-grouplist206
-rw-r--r--net/smbldap-tools/files/patch-smbldap-groupmod11
-rw-r--r--net/smbldap-tools/files/patch-smbldap-useradd155
-rw-r--r--net/smbldap-tools/files/patch-smbldap-usermod177
-rw-r--r--net/smbldap-tools/files/patch-smbldap-usershow44
-rw-r--r--net/smbldap-tools/files/patch-smbldap_tools.pm85
9 files changed, 11 insertions, 693 deletions
diff --git a/net/smbldap-tools/Makefile b/net/smbldap-tools/Makefile
index 5c978de9ad30..4a1f1cbf5fe6 100644
--- a/net/smbldap-tools/Makefile
+++ b/net/smbldap-tools/Makefile
@@ -6,12 +6,9 @@
#
PORTNAME= smbldap-tools
-PORTVERSION= 0.9.5
-PORTREVISION= 5
+PORTVERSION= 0.9.6
CATEGORIES= net
-MASTER_SITES= http://download.gna.org/smbldap-tools/packages/ \
- http://download.gna.org/smbldap-tools/packages/old-Idealx-release/
-EXTRACT_SUFX= .tgz
+MASTER_SITES= http://download.gna.org/smbldap-tools/sources/${PORTVERSION}/
MAINTAINER= mm@FreeBSD.org
COMMENT= Samba-LDAP management and support tools
diff --git a/net/smbldap-tools/distinfo b/net/smbldap-tools/distinfo
index 2c5a918e1b87..ccabf3d4d9c0 100644
--- a/net/smbldap-tools/distinfo
+++ b/net/smbldap-tools/distinfo
@@ -1,3 +1,2 @@
-MD5 (smbldap-tools-0.9.5.tgz) = 2a9a84c657af35b9c9734a5b1bc5fe8f
-SHA256 (smbldap-tools-0.9.5.tgz) = 9c69c8245af90e1c2e3d53283ad2188b1b27e88bf86516c3b8f37ae7ac1e0e33
-SIZE (smbldap-tools-0.9.5.tgz) = 303131
+SHA256 (smbldap-tools-0.9.6.tar.gz) = e3bd27a5237c0f3f38c178b40cda982e0e4e9740c82949b40653f84d29becfe5
+SIZE (smbldap-tools-0.9.6.tar.gz) = 304912
diff --git a/net/smbldap-tools/files/patch-configure.pl b/net/smbldap-tools/files/patch-configure.pl
index 5962d3a1d698..b9385f63e2f0 100644
--- a/net/smbldap-tools/files/patch-configure.pl
+++ b/net/smbldap-tools/files/patch-configure.pl
@@ -1,6 +1,6 @@
---- configure.pl.orgi Wed Jul 12 18:36:29 2006
-+++ configure.pl Wed Jul 12 18:40:30 2006
-@@ -49,7 +49,7 @@
+--- configure.pl.orig 2010-11-15 15:45:49.000000000 +0100
++++ configure.pl 2010-11-15 16:02:51.745592626 +0100
+@@ -48,7 +48,7 @@
print "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n";
# we first check if Samba is up and running
@@ -9,7 +9,7 @@
chomp($test_smb);
die "\nSamba need to be started first !\n" if ($test_smb eq "" || not defined $test_smb);
-@@ -304,7 +304,7 @@
+@@ -303,7 +303,7 @@
my $default_computer_gidnumber=read_entry(". default computer gidNumber","","515",0);
@@ -18,14 +18,14 @@
my $skeletonDir=read_entry(". default skeleton directory","","/etc/skel",0);
-@@ -528,12 +528,12 @@
- # Allows not to use smbpasswd (if with_smbpasswd == 0 in smbldap_conf.pm) but
+@@ -527,12 +527,12 @@
+ # 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=\"%%LOCALBASE%%/bin/smbpasswd\"
- # Allows not to use slappasswd (if with_slappasswd == 0 in smbldap_conf.pm)
+ # Allows not to use slappasswd (if with_slappasswd="0" in smbldap.conf)
# but prefer Crypt:: libraries
with_slappasswd=\"0\"
-slappasswd=\"/usr/sbin/slappasswd\"
diff --git a/net/smbldap-tools/files/patch-smbldap-grouplist b/net/smbldap-tools/files/patch-smbldap-grouplist
deleted file mode 100644
index 5e951af79a97..000000000000
--- a/net/smbldap-tools/files/patch-smbldap-grouplist
+++ /dev/null
@@ -1,206 +0,0 @@
---- smbldap-grouplist.orig 2010-10-13 10:51:05.808787252 +0200
-+++ smbldap-grouplist 2010-10-13 10:50:57.535195866 +0200
-@@ -0,0 +1,203 @@
-+#!/usr/bin/perl -w
-+
-+# This code was developped by Jerome Tournier (jtournier@gmail.com) and
-+# contributors (their names can be found in the CONTRIBUTORS file).
-+
-+# This was first created by tarjei Huse <tarjei@nu.no>
-+
-+# 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 of smbldap-grouplist : list groups
-+
-+use strict;
-+use Getopt::Std;
-+use FindBin;
-+use FindBin qw($RealBin);
-+use lib "$RealBin/";
-+use smbldap_tools;
-+#use Date::Format;
-+
-+# function declaration
-+sub exist_in_tab;
-+
-+my %Options;
-+
-+my $ok = getopts('dtS?', \%Options);
-+if ( (!$ok) || ($Options{'?'}) || $Options{'h'} ) {
-+ print "Usage: $0 [options] [user template]\n\n";
-+ print "Available UNIX options are:\n";
-+ print "-d Show displayName\n";
-+ print "-t Show samba group type\n";
-+ print "-S Show samba SID\n";
-+ print "-? show the help message\n";
-+ exit (1);
-+}
-+
-+my $binduser;
-+my $pass;
-+
-+if (!defined($binduser)) {
-+ $binduser = getpwuid($<);
-+}
-+
-+my $search;
-+if ( $ARGV[0] ) {
-+ if ( $< != 0 ) {
-+ die "Only root can show group inormation\n";
-+ } else {
-+ $search=$ARGV[0];
-+ }
-+} elsif ( $< != 0 ) {
-+ $search=$binduser;
-+}
-+
-+
-+my ($dn,$ldap_master);
-+# First, connecting to the directory
-+if ($< != 0) {
-+ # non-root user
-+ if (!defined($pass)) {
-+ # prompt for password
-+ print "UNIX password: ";
-+system "stty -echo" if (-t STDIN);
-+chomp($pass=<STDIN>);
-+system "stty echo" if (-t STDIN);
-+print "\n";
-+
-+# JTO: search real basedn: may be different in case ou=bla1,ou=bla2 !
-+# JTO: faire afficher egalement lock, expire et lastChange
-+$config{masterDN}="uid=$binduser,$config{usersdn}";
-+$config{masterPw}="$pass";
-+$ldap_master=connect_ldap_master();
-+$dn=$config{masterDN};
-+if (!is_user_valid($binduser, $dn, $pass)) {
-+ print "Authentication failure\n";
-+ exit (10);
-+}
-+}
-+} else {
-+ # root user
-+ $ldap_master=connect_ldap_master();
-+# test existence of user in LDAP
-+my $dn_line;
-+}
-+
-+sub print_group {
-+ my ($entry, %Options) = @_;
-+ printf "%4s ", $entry->get_value('gidNumber') ;
-+ printf "|%-20s ", $entry->get_value('cn');
-+ if ($Options{'d'})
-+ {
-+ if (defined $entry->get_value('displayName'))
-+ {
-+ printf "|%-20s", $entry->get_value('displayName');
-+ } else {
-+ print "|-";
-+ }
-+ }
-+ if ($Options{'t'})
-+ {
-+ my $group_name;
-+ if (defined($entry->get_value('sambaGroupType')) && \
-+ defined($group_name = &group_name_by_type($entry->get_value('sambaGroupType'))))
-+ {
-+ printf "|%-14s", $group_name;
-+ } else {
-+ print "|-";
-+ }
-+ }
-+ if ($Options{'S'})
-+ {
-+ if (defined $entry->get_value('sambaSID'))
-+ {
-+ printf "|%-47s", $entry->get_value('sambaSID');
-+ } else {
-+ print "|-";
-+ }
-+ }
-+ print "|\n";
-+}
-+
-+my $attrs="['gid','cn'";
-+my $banner="gid |cn ";
-+if ($Options{'d'})
-+{
-+ $banner .= "|displayName ";
-+ $attrs .= ",'displayName'";
-+}
-+if ($Options{'t'})
-+{
-+ $banner .= "|sambaGroupType";
-+ $attrs .= ",'sambaGroupType'";
-+}
-+if ($Options{'S'})
-+{
-+ $banner .= "|sambaSID ";
-+ $attrs .= ",'sambaSID'";
-+}
-+$attrs.="]";
-+$banner.="|";
-+print "$banner\n\n";
-+my $filter;
-+$filter = "(&(objectclass=posixGroup)";
-+my $base = $config{groupsdn};
-+
-+if ($search) {
-+ $filter.="(displayName=$search)";
-+}
-+
-+$filter.=")";
-+
-+my $mesg = $ldap_master->search ( base => $base,
-+ scope => $config{scope},
-+ filter => $filter,
-+ attrs => "$attrs"
-+ );
-+$mesg->code && warn $mesg->error;
-+
-+foreach my $entry ($mesg->all_entries) {
-+ print_group($entry,%Options);
-+}
-+########################################
-+
-+=head1 NAME
-+
-+smbldap-grouplist list groups
-+
-+=head1 SYNOPSIS
-+
-+smbldap-grouplist [-S] [group template]
-+
-+
-+=head1 DESCRIPTION
-+
-+-d Show displayName
-+
-+-S Show samba SID entry
-+
-+-? show the help message
-+
-+=head1 EXAMPLE
-+
-+smbldap-grouplist -dS
-+
-+smbldap-grouplist "*ourn*"
-+
-+=cut
-+
-+#'
-+
-+# The End
diff --git a/net/smbldap-tools/files/patch-smbldap-groupmod b/net/smbldap-tools/files/patch-smbldap-groupmod
deleted file mode 100644
index 66a3f91d6066..000000000000
--- a/net/smbldap-tools/files/patch-smbldap-groupmod
+++ /dev/null
@@ -1,11 +0,0 @@
---- smbldap-groupmod.orig 2010-10-07 11:45:07.992987934 +0200
-+++ smbldap-groupmod 2010-10-07 11:46:51.438545715 +0200
-@@ -142,7 +142,7 @@
- $config{groupsdn}=$group_entry->dn;
- if (is_group_member("$config{groupsdn}",$member)) {
- my $delete=1;
-- if (defined $group_entry->get_value('sambaSID')) {
-+ if (defined ($user_entry) && defined $group_entry->get_value('sambaSID')) {
- if ($group_entry->get_value('sambaSID') eq $user_entry->get_value('sambaPrimaryGroupSID')) {
- $delete=0;
- print "Cannot delete user ($member) from his primary group ($groupName)\n";
diff --git a/net/smbldap-tools/files/patch-smbldap-useradd b/net/smbldap-tools/files/patch-smbldap-useradd
deleted file mode 100644
index a898147e4f6a..000000000000
--- a/net/smbldap-tools/files/patch-smbldap-useradd
+++ /dev/null
@@ -1,155 +0,0 @@
---- smbldap-useradd.orig 2010-10-07 13:29:52.246293547 +0200
-+++ smbldap-useradd 2010-10-07 13:30:32.544088110 +0200
-@@ -35,7 +35,7 @@
- my %Options;
-
- my $ok =
-- getopts( 'o:abnmwWiPG:u:g:d:s:c:k:t:A:B:C:D:E:F:H:L:M:N:S:T:?', \%Options );
-+ getopts( 'o:abnmwWiPG:u:g:d:s:c:k:t:A:B:C:D:E:F:H:L:M:N:O:S:T:X:Z?', \%Options );
-
- if ( ( !$ok ) || ( @ARGV < 1 ) || ( $Options{'?'} ) ) {
- print_banner;
-@@ -69,11 +69,13 @@
- print " -G supplementary comma-separated groups\n";
- print
- " -H sambaAcctFlags (samba account control bits like '[NDHTUMWSLKI]')\n";
-- print " -M local mailAddress (comma seperated)\n";
-+ print " -M e-mail address (comma seperated)\n";
- print " -N given name \n";
-+ print " -O localMailAddress (comma separated)\n";
- print " -P ends by invoking smbldap-passwd\n";
- print " -S surname (Family name)\n";
- print " -T mailToAddress (forward address) (comma seperated)\n";
-+ print " -X input encoding for givenname and surname (default UTF-8)\n";
- print " -Z set custom LDAP attributes, name=value pairs comma separated\n";
- print " -? show this help message\n";
- exit(1);
-@@ -92,6 +94,14 @@
- # Read only first @ARGV
- my $userName = $ARGV[0];
-
-+# Get the input encoding
-+my $characterSet;
-+if ( defined( $Options{'X'} ) ) {
-+ $characterSet = $Options{'X'};
-+} else {
-+ $characterSet = "UTF-8";
-+}
-+
- # For computers account, add a trailing dollar if missing
- if ( defined( $Options{'w'} ) or defined( $Options{'W'} ) ) {
- if ( $userName =~ /[^\$]$/s ) {
-@@ -256,6 +266,7 @@
-
- my $userHomeDirectory;
- my ( $givenName, $userCN, $userSN, $displayName );
-+my @mail;
- my @userMailLocal;
- my @userMailTo;
- my $tmp;
-@@ -278,8 +289,8 @@
- $config{userLoginShell} = $tmp if ( defined( $tmp = $Options{'s'} ) );
- $config{userGecos} = $tmp if ( defined( $tmp = $Options{'c'} ) );
- $config{skeletonDir} = $tmp if ( defined( $tmp = $Options{'k'} ) );
--$givenName = ( utf8Encode( $Options{'N'} ) || $userName );
--$userSN = ( utf8Encode( $Options{'S'} ) || $userName );
-+$givenName = ( utf8Encode( $characterSet, $Options{'N'} ) || $userName );
-+$userSN = ( utf8Encode( $characterSet, $Options{'S'} ) || $userName );
- if ( $Options{'N'} and $Options{'S'} ) {
- $displayName = $userCN = "$givenName" . " $userSN";
- }
-@@ -287,7 +298,8 @@
- $displayName = $userCN = $userName;
- }
-
--@userMailLocal = &split_arg_comma( $Options{'M'} );
-+@mail = &split_arg_comma( $Options{'M'} );
-+@userMailLocal = &split_arg_comma( $Options{'O'} );
- @userMailTo = &split_arg_comma( $Options{'T'} );
-
- ########################
-@@ -461,7 +473,7 @@
- if ( !( -d $userHomeDirectory ) ) {
- if ( $config{skeletonDir} ne "" ) {
- system
-- "cp -r $config{skeletonDir} $userHomeDirectory 2>/dev/null";
-+ "cp -pRP $config{skeletonDir} $userHomeDirectory 2>/dev/null";
- }
- else {
- system "mkdir $userHomeDirectory 2>/dev/null";
-@@ -483,31 +495,27 @@
- }
- }
-
--# we start to defined mail adresses if option M or T is given in option
-+# we start to defined mail adresses if option M, O or T are given
- my @adds;
--if (@userMailLocal) {
-- my @mail;
-- foreach my $m (@userMailLocal) {
-+if ( @userMailLocal || @userMailTo ) {
-+ push( @adds, 'objectClass' => 'inetLocalMailRecipient' );
-+}
-+if (@mail) {
-+ foreach my $m (@mail) {
- my $domain = $config{mailDomain};
-- if ( $m =~ /^(.+)@/ ) {
-- push( @mail, $m );
--
-- # mailLocalAddress contains only the first part
-- $m = $1;
-- }
-- else {
-- push( @mail, $m . ( $domain ? '@' . $domain : '' ) );
-+ if ( $m !~ /^(.+)@/ ) {
-+ $m = $m . ( $domain ? '@' . $domain : '' );
- }
- }
-- push( @adds, 'mailLocalAddress' => [@userMailLocal] );
- push( @adds, 'mail' => [@mail] );
- }
-+
-+if (@userMailLocal) {
-+ push( @adds, 'mailLocalAddress' => [@userMailLocal] );
-+}
- if (@userMailTo) {
- push( @adds, 'mailRoutingAddress' => [@userMailTo] );
- }
--if ( @userMailLocal || @userMailTo ) {
-- push( @adds, 'objectClass' => 'inetLocalMailRecipient' );
--}
-
- # Custom modification - MPK
- if ( $Options{'Z'} ) {
-@@ -623,6 +631,9 @@
- push( @adds, 'sambaLMPassword' => "XXX" );
- push( @adds, 'sambaNTPassword' => "XXX" );
- }
-+}
-+
-+if (@adds) {
- my $modify =
- $ldap_master->modify( "uid=$userName,$config{usersdn}", add => {@adds} );
-
-@@ -742,16 +753,19 @@
- spaces and trailing bracket are ignored (samba account control bits like '[NDHTUMWSLKI]'
-
- -M mail
-- local mail aliases (multiple addresses are seperated by spaces)
-+ e-mail adresses (multiple addresses are seperated by commas)
-
- -N givenname
- family name. Defaults to username
-
-+-O localMailAddress
-+ localMailAddresses (multiple addresses are seperated by commas)
-+
- -S surname
- defaults to username
-
- -T mailToAddress
-- Forward address (multiple addresses are seperated by spaces)
-+ Forward address (multiple addresses are seperated by commas)
-
- -n
- do not print banner message
diff --git a/net/smbldap-tools/files/patch-smbldap-usermod b/net/smbldap-tools/files/patch-smbldap-usermod
deleted file mode 100644
index 715dec80e045..000000000000
--- a/net/smbldap-tools/files/patch-smbldap-usermod
+++ /dev/null
@@ -1,177 +0,0 @@
---- smbldap-usermod.orig 2010-10-07 13:29:58.221685434 +0200
-+++ smbldap-usermod 2010-10-07 13:31:31.821463290 +0200
-@@ -48,12 +48,14 @@
- "I|sambaDisable" => \$Options{I},
- "J|sambaEnable" => \$Options{J},
- "L|shadowLock" => \$Options{L},
-- "M|mailAddresses=s" => \$Options{M},
-+ "M|mail=s" => \$Options{M},
- "N|givenName=s" => \$Options{N},
-+ "O|mailLocalAddress=s" => \$Options{O},
- "P=s" => \$Options{P},
- "U|shadowUnlock" => \$Options{U},
- "S|surname=s" => \$Options{S},
- "T|mailToAddress=s" => \$Options{T},
-+ "X|inputEncoding=s" => \$Options{X},
- "Z|attr=s" => \$Options{Z},
- "a|addsambaSAMAccount" => \$Options{a},
- "c|gecos=s" => \$Options{c},
-@@ -73,7 +75,7 @@
- "u|uid=s" => \$Options{u}
- );
-
--#my $ok = getopts('A:B:C:D:E:F:H:IJM:N:S:PT:ame:f:u:g:G:d:l:r:s:c:ok:?h', \%Options);
-+#my $ok = getopts('A:B:C:D:E:F:H:IJM:N:O:S:PT:X:Z:ame:f:u:g:G:d:l:r:s:c:ok:?h', \%Options);
-
- if ( ( !$ok ) || ( @ARGV < 1 ) || ( $Options{'h'} ) ) {
- print_banner;
-@@ -92,11 +94,13 @@
- print " -N|--givenName <name> given name (first name)\n";
- print " -S|--surname <suname> surname (family name)\n";
- print " -P ends by invoking smbldap-passwd\n";
-- print " -M|--mailAddresses <mail,> mailAddresses (comma seperated)\n";
-+ print " -M|--mail <mail,> e-mail addresses (comma seperated)\n";
- print
--" -T|--mailToAddress <mail,> mailToAddress (forward address) (comma seperated)\n";
-+" -O|--mailLocalAddress <mail,> mailLocalAddress (comma separated)\n";
- print
--" -e|--expire <date> Sets both shadow and samba expiration date: like \"YYYY-MM-DD(HH:MM:SS)\", or \"yYmMdD\" to extand y year,m months and d days\n";
-+" -T|--mailToAddress <mail,> mailToAddress (forward address) (comma separated)\n";
-+ print
-+" -e|--expire <date> Sets both shadow and samba expiration date: like \"YYYY-MM-DD(HH:MM:SS)\", or \"yYmMdD\" to extend y year,m months and d days\n";
- print
- " --shadowExpire <date/n> Shadow expiration date (like \"YYYY-MM-DD\") or 'n' days from today\n";
- print
-@@ -134,6 +138,8 @@
- " -I|--sambaDisable disable an user. Can't be used with -H or -J\n";
- print
- " -J|--sambaEnable enable an user. Can't be used with -H or -I\n";
-+ print
-+" -X|--inputEncoding input encoding for givenname and surname (defaults to UTF-8)\n";
- print " -h|--help show this help message\n";
- exit(1);
- }
-@@ -146,6 +152,14 @@
- # Read only first @ARGV
- my $user = $ARGV[0];
-
-+# Get the input encoding
-+my $characterSet;
-+if ( defined( $Options{'X'} ) ) {
-+ $characterSet = $Options{'X'};
-+} else {
-+ $characterSet = "UTF-8";
-+}
-+
- # Let's connect to the directory first
- my $ldap_master = connect_ldap_master();
-
-@@ -322,11 +336,11 @@
- # my givenname: Jerome
-
- if ( defined( $tmp = $Options{'N'} ) ) {
-- push( @mods, 'givenName' => utf8Encode($tmp) );
-+ push( @mods, 'givenName' => utf8Encode($characterSet,$tmp) );
- }
-
- if ( defined( $tmp = $Options{'S'} ) ) {
-- push( @mods, 'sn' => utf8Encode($tmp) );
-+ push( @mods, 'sn' => utf8Encode($characterSet,$tmp) );
- }
-
- my $cn;
-@@ -340,7 +354,7 @@
- $cn = "$Options{'N'}";
- $cn .= " " . $Options{'S'}
- unless ( $Options{'S'} eq $Options{'N'} and $Options{'N'} eq $user );
-- my $push_val = utf8Encode($cn);
-+ my $push_val = utf8Encode($characterSet,$cn);
- push( @mods, 'cn' => $push_val );
-
- # set displayName for Samba account
-@@ -462,44 +476,53 @@
- push( @mods, 'userPassword' => $tmp );
- }
-
--my $mailobj = 0;
--if ( $tmp = $Options{'M'} ) {
-+if ( $tmp = $Options{'M'} ) {
-
- # action si + or - for adding or deleting an entry
- my $action = '';
- if ( $tmp =~ s/^([+-])+\s*// ) {
- $action = $1;
- }
-- my @userMailLocal = &split_arg_comma($tmp);
-- my @mail;
-- foreach my $m (@userMailLocal) {
-+ my @mail = &split_arg_comma($tmp);
-+ foreach my $m (@mail) {
- my $domain = $config{mailDomain};
-- if ( $m =~ /^(.+)@/ ) {
-- push( @mail, $m );
--
-- # mailLocalAddress contains only the first part
-- $m = $1;
-- }
-- else {
-- push( @mail, $m . ( $domain ? '@' . $domain : '' ) );
-+ if ( $m !~ /^(.+)@/ ) {
-+ $m = $m . ( $domain ? '@' . $domain : '' );
- }
- }
- if ($action) {
-- my @old_MailLocal;
- my @old_mail;
- @old_mail = $user_entry->get_value('mail');
-+ if ( $action eq '+' ) {
-+ @mail = &list_union( \@old_mail, \@mail );
-+ }
-+ elsif ( $action eq '-' ) {
-+ @mail = &list_minus( \@old_mail, \@mail );
-+ }
-+ }
-+ push( @mods, 'mail' => [@mail] );
-+}
-+
-+my $mailobj = 0;
-+if ( $tmp = $Options{'O'} ) {
-+
-+ # action si + or - for adding or deleting an entry
-+ my $action = '';
-+ if ( $tmp =~ s/^([+-])+\s*// ) {
-+ $action = $1;
-+ }
-+ my @userMailLocal = &split_arg_comma($tmp);
-+ if ($action) {
-+ my @old_MailLocal;
- @old_MailLocal = $user_entry->get_value('mailLocalAddress');
- if ( $action eq '+' ) {
- @userMailLocal = &list_union( \@old_MailLocal, \@userMailLocal );
-- @mail = &list_union( \@old_mail, \@mail );
- }
- elsif ( $action eq '-' ) {
- @userMailLocal = &list_minus( \@old_MailLocal, \@userMailLocal );
-- @mail = &list_minus( \@old_mail, \@mail );
- }
- }
- push( @mods, 'mailLocalAddress', [@userMailLocal] );
-- push( @mods, 'mail' => [@mail] );
- $mailobj = 1;
- }
-
-@@ -841,12 +864,12 @@
- # Then assume it has been set correctly with -N and -S before.
- push( @mods, "cn" => $new_user )
- unless ( $user_entry->get_value("cn")
-- and $user_entry->get_value("cn") ne utf8Encode($user)
-+ and $user_entry->get_value("cn") ne utf8Encode($characterSet,$user)
- or $Options{'N'} and $Options{'S'} );
- push( @mods, "displayName" => $new_user )
- unless ( not $samba
- or $user_entry->get_value("displayName")
-- and $user_entry->get_value("displayName") ne utf8Encode($user)
-+ and $user_entry->get_value("displayName") ne utf8Encode($characterSet,$user)
- or $Options{'N'} and $Options{'S'} );
-
- if ( @mods > 0 ) { # only change if there is something to change
diff --git a/net/smbldap-tools/files/patch-smbldap-usershow b/net/smbldap-tools/files/patch-smbldap-usershow
deleted file mode 100644
index 3f417bc1de9e..000000000000
--- a/net/smbldap-tools/files/patch-smbldap-usershow
+++ /dev/null
@@ -1,44 +0,0 @@
---- smbldap-usershow.orig 2008-04-22 10:13:29.000000000 +0200
-+++ smbldap-usershow 2010-10-05 12:06:07.679718377 +0200
-@@ -31,12 +31,13 @@
- use Getopt::Std;
- my %Options;
-
--my $ok = getopts('?h',\%Options);
-+my $ok = getopts('?hX:',\%Options);
-
- if ( (!$ok) || (@ARGV < 1) || ($Options{'?'}) ) {
- print_banner;
- print "Usage: $0 [-h?] username\n";
- print " -h print Samba dates in human-readable form\n";
-+ print " -X output character set (default UTF-8)\n";
- print " -? show this help message\n";
- exit (1);
- }
-@@ -44,6 +45,14 @@
- # Read only first @ARGV
- my $user = $ARGV[0];
-
-+# Get the input encoding
-+my $characterSet;
-+if ( defined( $Options{'X'} ) ) {
-+ $characterSet = $Options{'X'};
-+} else {
-+ $characterSet = "UTF-8";
-+}
-+
- my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1";
- if ($nscd_status == 0) {
- system "/etc/init.d/nscd restart > /dev/null 2>&1";
-@@ -53,9 +62,9 @@
-
- my $lines;
- if ($Options{'h'}) {
-- $lines = utf8Decode(read_user_human_readable($user));
-+ $lines = utf8Decode($characterSet,read_user_human_readable($user));
- } else {
-- $lines = utf8Decode(read_user($user));
-+ $lines = utf8Decode($characterSet,read_user($user));
- }
-
- if ($lines) {
diff --git a/net/smbldap-tools/files/patch-smbldap_tools.pm b/net/smbldap-tools/files/patch-smbldap_tools.pm
deleted file mode 100644
index 73c1d238a9db..000000000000
--- a/net/smbldap-tools/files/patch-smbldap_tools.pm
+++ /dev/null
@@ -1,85 +0,0 @@
---- smbldap_tools.pm.orig 2008-04-22 10:13:29.000000000 +0200
-+++ smbldap_tools.pm 2010-10-13 10:50:48.831761476 +0200
-@@ -92,6 +92,7 @@
- get_user_dn2
- connect_ldap_master
- connect_ldap_slave
-+ group_name_by_type
- group_type_by_name
- subst_configvar
- read_config
-@@ -825,9 +826,9 @@
- $lines .= "dn: " . $entry->dn . "\n";
- foreach my $attr ( $entry->attributes ) {
- my @vals = $entry->get_value($attr);
-- foreach my $val (@vals) {
-- $val = "**UNPRINTABLE**" if ( $val =~ /[^[:print:]]/ );
-- }
-+# foreach my $val (@vals) {
-+# $val = "**UNPRINTABLE**" if ( $val =~ /[^[:print:]]/ );
-+# }
- $lines .= $attr . ": " . join( ',', @vals ) . "\n";
- }
- }
-@@ -1109,6 +1110,16 @@
- return $groupmap{$type_name};
- }
-
-+sub group_name_by_type {
-+ my $groupmap = shift;
-+ my %type_name = (
-+ 2 => 'domain',
-+ 4 => 'local',
-+ 5 => 'builtin'
-+ );
-+ return $type_name{$groupmap};
-+}
-+
- sub subst_user {
- my ( $str, $username ) = @_;
- $str =~ s/%U/$username/ if ($str);
-@@ -1209,22 +1220,33 @@
- }
-
- sub utf8Encode {
-- my $arg = shift;
-+ my $charset = shift;
-+ my $string = shift;
-
-- return to_utf8(
-- -string => $arg,
-- -charset => 'ISO-8859-1',
-- );
-+ if ($charset eq "UTF-8") {
-+ return $string;
-+ }
-+ else {
-+ return to_utf8(
-+ -string => $string,
-+ -charset => $charset,
-+ );
-+ }
- }
-
- sub utf8Decode {
-- my $arg = shift;
-+ my $charset = shift;
-+ my $string = shift;
-
-- return from_utf8(
-- -string => $arg,
-- -charset => 'ISO-8859-1',
-- );
-+ if ($charset eq "UTF-8") {
-+ return $string;
-+ }
-+ else {
-+ return from_utf8(
-+ -string => $string,
-+ -charset => $charset,
-+ );
-+ }
- }
-
- 1;
--