aboutsummaryrefslogtreecommitdiff
path: root/net/smbldap-tools
diff options
context:
space:
mode:
Diffstat (limited to 'net/smbldap-tools')
-rw-r--r--net/smbldap-tools/Makefile2
-rw-r--r--net/smbldap-tools/files/patch-smbldap-useradd47
-rw-r--r--net/smbldap-tools/files/patch-smbldap-usermod81
-rw-r--r--net/smbldap-tools/files/patch-smbldap-usershow44
-rw-r--r--net/smbldap-tools/files/patch-smbldap_tools.pm60
5 files changed, 231 insertions, 3 deletions
diff --git a/net/smbldap-tools/Makefile b/net/smbldap-tools/Makefile
index 792580c9f215..6033de72a20a 100644
--- a/net/smbldap-tools/Makefile
+++ b/net/smbldap-tools/Makefile
@@ -7,7 +7,7 @@
PORTNAME= smbldap-tools
PORTVERSION= 0.9.5
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net
MASTER_SITES= http://download.gna.org/smbldap-tools/packages/ \
http://download.gna.org/smbldap-tools/packages/old-Idealx-release/
diff --git a/net/smbldap-tools/files/patch-smbldap-useradd b/net/smbldap-tools/files/patch-smbldap-useradd
index 4b875340cfdd..1a7f2ea79249 100644
--- a/net/smbldap-tools/files/patch-smbldap-useradd
+++ b/net/smbldap-tools/files/patch-smbldap-useradd
@@ -1,6 +1,49 @@
--- smbldap-useradd.orig 2008-04-22 10:13:29.000000000 +0200
-+++ smbldap-useradd 2008-05-06 11:58:30.000000000 +0200
-@@ -461,7 +461,7 @@
++++ smbldap-useradd 2010-10-05 12:04:47.827698271 +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:S:T:X:Z?', \%Options );
+
+ if ( ( !$ok ) || ( @ARGV < 1 ) || ( $Options{'?'} ) ) {
+ print_banner;
+@@ -74,6 +74,7 @@
+ 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 +93,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 ) {
+@@ -278,8 +287,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";
+ }
+@@ -461,7 +470,7 @@
if ( !( -d $userHomeDirectory ) ) {
if ( $config{skeletonDir} ne "" ) {
system
diff --git a/net/smbldap-tools/files/patch-smbldap-usermod b/net/smbldap-tools/files/patch-smbldap-usermod
new file mode 100644
index 000000000000..f1b1db8a6000
--- /dev/null
+++ b/net/smbldap-tools/files/patch-smbldap-usermod
@@ -0,0 +1,81 @@
+--- smbldap-usermod.orig 2008-04-22 10:13:29.000000000 +0200
++++ smbldap-usermod 2010-10-05 12:05:23.220769671 +0200
+@@ -54,6 +54,7 @@
+ "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 +74,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: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;
+@@ -134,6 +135,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 +149,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 +333,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 +351,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
+@@ -841,12 +852,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
new file mode 100644
index 000000000000..3f417bc1de9e
--- /dev/null
+++ b/net/smbldap-tools/files/patch-smbldap-usershow
@@ -0,0 +1,44 @@
+--- 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
new file mode 100644
index 000000000000..f05d6a6225c3
--- /dev/null
+++ b/net/smbldap-tools/files/patch-smbldap_tools.pm
@@ -0,0 +1,60 @@
+--- smbldap_tools.pm.orig 2008-04-22 10:13:29.000000000 +0200
++++ smbldap_tools.pm 2010-10-05 12:53:27.592346981 +0200
+@@ -825,9 +825,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";
+ }
+ }
+@@ -1209,22 +1209,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;
+-