From 452e2b744d488df4ef8d4f179f56e6817a2f916e Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Dec 09 2010 16:01:28 +0000 Subject: Update to 0.9.6 - new upstream release 0.9.6: - 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 to avoid race conditions (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 - fix Z option in smbldap-useradd (custom LDAP attribute) (fixes #590429) - alphabetically reorganize options - fix several mis-spellings and typos in smbldap-useradd - update source URL to reflect new upstream file layout - drop upstreamed chown patch - update remaining patches to remove fuzz - drop dependency on openldap-servers (for /usr/sbin/slappasswd) as the default configuration is to hash passwords directly rather than calling out to slappasswd (#609056) - drop dependency on samba-common (for /usr/bin/smbpasswd) as the default configuration handles the functionality directly rather than calling out to smbpasswd - drop execute permissions from configuration/migration scripts in %doc --- diff --git a/.gitignore b/.gitignore index 44db9f5..4437ece 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -smbldap-tools-0.9.5.tgz +/smbldap-tools-0.9.6.tar.gz diff --git a/smbldap-tools-0.9.5-chown.patch b/smbldap-tools-0.9.5-chown.patch deleted file mode 100644 index a4db977..0000000 --- a/smbldap-tools-0.9.5-chown.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- smbldap-tools-0.9.5/smbldap-useradd 2008-04-22 09:13:29.000000000 +0100 -+++ smbldap-tools-0.9.5/smbldap-useradd 2008-05-23 11:26:00.000000000 +0100 -@@ -467,7 +467,7 @@ - system "mkdir $userHomeDirectory 2>/dev/null"; - } - system --"chown -R $userName:$userGidNumber $userHomeDirectory 2>/dev/null"; -+"chown -R $userUidNumber:$userGidNumber $userHomeDirectory 2>/dev/null"; - if ( defined $config{userHomeDirectoryMode} ) { - system - "chmod $config{userHomeDirectoryMode} $userHomeDirectory 2>/dev/null"; diff --git a/smbldap-tools-0.9.5-config.patch b/smbldap-tools-0.9.5-config.patch deleted file mode 100644 index 2583756..0000000 --- a/smbldap-tools-0.9.5-config.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- smbldap-tools-0.9.5/smbldap.conf 2008-04-22 09:13:29.000000000 +0100 -+++ smbldap-tools-0.9.5/smbldap.conf 2008-04-23 17:00:18.000000000 +0100 -@@ -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-2252255531-4061614174-2474224977" -+#SID="S-1-5-21-2252255531-4061614174-2474224977" - - # Domain name the Samba server is in charged. - # If not defined, parameter is taking from smb.conf configuration file - # Ex: sambaDomain="IDEALX-NT" --sambaDomain="DOMSMB" -+#sambaDomain="DOMSMB" - - ############################################################################## - # -@@ -71,7 +71,6 @@ - - # Master LDAP port - # If not defined, parameter is set to "389" --#masterPort="389" - masterPort="389" - - # Use TLS for LDAP -@@ -92,15 +91,15 @@ - - # CA certificate - # see "man Net::LDAP" in start_tls section for more details --cafile="/etc/smbldap-tools/ca.pem" -+cafile="/etc/pki/tls/certs/ldapserverca.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.iallanis.info.pem" -+clientcert="/etc/pki/tls/certs/ldapclient.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.iallanis.info.key" -+clientkey="/etc/pki/tls/certs/ldapclientkey.pem" - - # LDAP Suffix - # Ex: suffix=dc=IDEALX,dc=ORG -@@ -109,7 +108,7 @@ - # Where are stored Users - # Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG" - # Warning: if 'suffix' is not set here, you must set the full dn for usersdn --usersdn="ou=Users,${suffix}" -+usersdn="ou=People,${suffix}" - - # Where are stored Computers - # Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG" -@@ -119,10 +118,10 @@ - # Where are stored Groups - # Ex: groupsdn="ou=Groups,dc=IDEALX,dc=ORG" - # Warning: if 'suffix' is not set here, you must set the full dn for groupsdn --groupsdn="ou=Groups,${suffix}" -+groupsdn="ou=Group,${suffix}" - - # Where are stored Idmap entries (used if samba is a domain member server) --# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG" -+# Ex: idmapdn="ou=Idmap,dc=IDEALX,dc=ORG" - # Warning: if 'suffix' is not set here, you must set the full dn for idmapdn - idmapdn="ou=Idmap,${suffix}" - diff --git a/smbldap-tools-0.9.5-nscd.patch b/smbldap-tools-0.9.5-nscd.patch deleted file mode 100644 index f6f11d9..0000000 --- a/smbldap-tools-0.9.5-nscd.patch +++ /dev/null @@ -1,196 +0,0 @@ ---- smbldap-groupadd 2009-03-04 16:46:42.000000000 +0000 -+++ smbldap-groupadd 2009-03-06 10:38:36.000000000 +0000 -@@ -47,10 +47,11 @@ - exit (1); - } - --my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ($nscd_status == 0) { -- system "/etc/init.d/nscd stop > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - -@@ -146,7 +147,8 @@ - $ldap_master->unbind; - - if ($nscd_status == 0) { -- system "/etc/init.d/nscd start > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - if ($Options{'p'}) { ---- smbldap-groupdel 2009-03-03 21:29:44.000000000 +0000 -+++ smbldap-groupdel 2009-03-03 21:32:09.000000000 +0000 -@@ -54,10 +54,11 @@ - - group_del($dn); - --my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ($nscd_status == 0) { -- system "/etc/init.d/nscd restart > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - #if (defined($dn_line = get_group_dn($_groupName))) { ---- smbldap-groupmod 2009-03-06 10:39:43.000000000 +0000 -+++ smbldap-groupmod 2009-03-06 10:41:27.000000000 +0000 -@@ -63,10 +63,11 @@ - - my $newname = $Options{'n'}; - --my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ($nscd_status == 0) { -- system "/etc/init.d/nscd restart > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - my $gid=$group_entry->get_value('gidNumber'); -@@ -220,10 +221,11 @@ - $modify->code && warn "failed to delete entry: ", $modify->error ; - } - --$nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+$nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ($nscd_status == 0) { -- system "/etc/init.d/nscd restart > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - # take down session ---- smbldap_tools.pm 2009-03-06 10:44:24.000000000 +0000 -+++ smbldap_tools.pm 2009-03-06 10:43:17.000000000 +0000 -@@ -742,9 +742,10 @@ - # $gid = group_add($groupname, $group_gid, $force_using_existing_gid) - sub group_add { - my ( $gname, $gid, $force ) = @_; -- my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+ my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd stop > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - if ( !defined($gid) ) { - -@@ -762,7 +763,8 @@ - } - } - if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd start > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - my $modify = $ldap->add( - "cn=$gname,$config{groupsdn}", ---- smbldap-useradd 2009-03-03 21:28:00.000000000 +0000 -+++ smbldap-useradd 2009-03-06 10:50:08.000000000 +0000 -@@ -83,10 +83,11 @@ - - # cause problems when dealing with getpwuid because of the - # negative ttl and ldap modification --my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd stop > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - # Read only first @ARGV -@@ -176,7 +177,8 @@ - } - - if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd start > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - my $createGroup = 0; ---- smbldap-userdel 2008-04-22 09:13:29.000000000 +0100 -+++ smbldap-userdel 2009-03-06 10:51:31.000000000 +0000 -@@ -93,10 +93,11 @@ - system('rm', @rmargs, $homedir); - } - --my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ($nscd_status == 0) { -- system "/etc/init.d/nscd restart > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - $ldap_master->unbind; # take down session ---- smbldap-usermod 2009-03-03 21:32:34.000000000 +0000 -+++ smbldap-usermod 2009-03-06 10:39:26.000000000 +0000 -@@ -237,22 +237,15 @@ - - if ( defined( $tmp = $Options{'u'} ) ) { - if ( !defined( $Options{'o'} ) ) { -- $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+ $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd stop > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } -- - if ( getpwuid($tmp) ) { -- if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd start > /dev/null 2>&1"; -- } -- - print "$0: uid number $tmp exists\n"; - exit(6); - } -- if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd start > /dev/null 2>&1"; -- } - } - - push( @mods, 'uidNumber', $tmp ); -@@ -878,10 +871,11 @@ - $ldap_master->unbind; - } - --$nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+$nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - - if ( $nscd_status == 0 ) { -- system "/etc/init.d/nscd restart > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - if ( defined( $Options{'P'} ) ) { ---- smbldap-usershow 2008-04-22 09:13:29.000000000 +0100 -+++ smbldap-usershow 2009-03-06 10:53:36.000000000 +0000 -@@ -44,9 +44,10 @@ - # Read only first @ARGV - my $user = $ARGV[0]; - --my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; -+my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; - if ($nscd_status == 0) { -- system "/etc/init.d/nscd restart > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; -+ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; - } - - my $ldap_slave=connect_ldap_slave(); diff --git a/smbldap-tools-0.9.5-utf-8.patch b/smbldap-tools-0.9.5-utf-8.patch deleted file mode 100644 index 4813580..0000000 --- a/smbldap-tools-0.9.5-utf-8.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- smbldap-tools-0.9.5/smbldap_tools.pm 2008-05-22 12:18:05.000000000 +0100 -+++ smbldap-tools-0.9.5/smbldap_tools.pm 2008-05-22 15:50:58.000000000 +0100 -@@ -826,7 +826,7 @@ - foreach my $attr ( $entry->attributes ) { - my @vals = $entry->get_value($attr); - foreach my $val (@vals) { -- $val = "**UNPRINTABLE**" if ( $val =~ /[^[:print:]]/ ); -+ $val = "**UNPRINTABLE**" if ( $val =~ /\P{IsPrint}/ ); - } - $lines .= $attr . ": " . join( ',', @vals ) . "\n"; - } -@@ -854,7 +854,7 @@ - foreach my $attr ( $entry->attributes ) { - my @vals = $entry->get_value($attr); - foreach my $val (@vals) { -- $val = "**UNPRINTABLE**" if ( $val =~ /[^[:print:]]/ ); -+ $val = "**UNPRINTABLE**" if ( $val =~ /\P{IsPrint}/ ); - } - if ( $attr eq "sambaPwdLastSet" - or $attr eq "sambaPwdCanChange" -@@ -1213,7 +1213,7 @@ - - return to_utf8( - -string => $arg, -- -charset => 'ISO-8859-1', -+ -charset => 'UTF8', - ); - } - -@@ -1222,7 +1222,7 @@ - - return from_utf8( - -string => $arg, -- -charset => 'ISO-8859-1', -+ -charset => 'UTF8', - ); - } - diff --git a/smbldap-tools-0.9.6-config.patch b/smbldap-tools-0.9.6-config.patch new file mode 100644 index 0000000..13fd267 --- /dev/null +++ b/smbldap-tools-0.9.6-config.patch @@ -0,0 +1,66 @@ +--- smbldap-tools-0.9.6/smbldap.conf 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap.conf 2010-12-09 14:43:37.663407103 +0000 +@@ -33,12 +33,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-2252255531-4061614174-2474224977" ++#SID="S-1-5-21-2252255531-4061614174-2474224977" + + # Domain name the Samba server is in charged. + # If not defined, parameter is taking from smb.conf configuration file + # Ex: sambaDomain="IDEALX-NT" +-sambaDomain="DOMSMB" ++#sambaDomain="DOMSMB" + + ############################################################################## + # +@@ -70,7 +70,6 @@ + + # Master LDAP port + # If not defined, parameter is set to "389" +-#masterPort="389" + masterPort="389" + + # Use TLS for LDAP +@@ -91,15 +90,15 @@ + + # CA certificate + # see "man Net::LDAP" in start_tls section for more details +-cafile="/etc/smbldap-tools/ca.pem" ++cafile="/etc/pki/tls/certs/ldapserverca.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.iallanis.info.pem" ++clientcert="/etc/pki/tls/certs/ldapclient.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.iallanis.info.key" ++clientkey="/etc/pki/tls/certs/ldapclientkey.pem" + + # LDAP Suffix + # Ex: suffix=dc=IDEALX,dc=ORG +@@ -108,7 +107,7 @@ + # Where are stored Users + # Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG" + # Warning: if 'suffix' is not set here, you must set the full dn for usersdn +-usersdn="ou=Users,${suffix}" ++usersdn="ou=People,${suffix}" + + # Where are stored Computers + # Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG" +@@ -118,10 +117,10 @@ + # Where are stored Groups + # Ex: groupsdn="ou=Groups,dc=IDEALX,dc=ORG" + # Warning: if 'suffix' is not set here, you must set the full dn for groupsdn +-groupsdn="ou=Groups,${suffix}" ++groupsdn="ou=Group,${suffix}" + + # Where are stored Idmap entries (used if samba is a domain member server) +-# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG" ++# Ex: idmapdn="ou=Idmap,dc=IDEALX,dc=ORG" + # Warning: if 'suffix' is not set here, you must set the full dn for idmapdn + idmapdn="ou=Idmap,${suffix}" + diff --git a/smbldap-tools-0.9.6-nscd.patch b/smbldap-tools-0.9.6-nscd.patch new file mode 100644 index 0000000..323ef52 --- /dev/null +++ b/smbldap-tools-0.9.6-nscd.patch @@ -0,0 +1,204 @@ +diff -up smbldap-tools-0.9.6/smbldap-groupadd.orig smbldap-tools-0.9.6/smbldap-groupadd +--- smbldap-tools-0.9.6/smbldap-groupadd.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-groupadd 2010-12-09 14:33:14.425277037 +0000 +@@ -49,10 +49,11 @@ if ( (!$ok) || (@ARGV < 1) || ($Options{ + exit (1); + } + +-my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ($nscd_status == 0) { +- system "/etc/init.d/nscd stop > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + +@@ -148,7 +149,8 @@ if ($Options{'b'}) { + $ldap_master->unbind; + + if ($nscd_status == 0) { +- system "/etc/init.d/nscd start > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + if ($Options{'p'}) { +diff -up smbldap-tools-0.9.6/smbldap-groupdel.orig smbldap-tools-0.9.6/smbldap-groupdel +--- smbldap-tools-0.9.6/smbldap-groupdel.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-groupdel 2010-12-09 14:33:14.428277129 +0000 +@@ -56,10 +56,11 @@ my $dn = get_dn_from_line($dn_line); + + group_del($dn); + +-my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ($nscd_status == 0) { +- system "/etc/init.d/nscd restart > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + #if (defined($dn_line = get_group_dn($_groupName))) { +diff -up smbldap-tools-0.9.6/smbldap-groupmod.orig smbldap-tools-0.9.6/smbldap-groupmod +--- smbldap-tools-0.9.6/smbldap-groupmod.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-groupmod 2010-12-09 14:33:14.428277129 +0000 +@@ -65,10 +65,11 @@ if (! ($group_entry = read_group_entry($ + + my $newname = $Options{'n'}; + +-my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ($nscd_status == 0) { +- system "/etc/init.d/nscd restart > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + my $gid=$group_entry->get_value('gidNumber'); +@@ -222,10 +223,11 @@ if ($group_sid) { + $modify->code && warn "failed to delete entry: ", $modify->error ; + } + +-$nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++$nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ($nscd_status == 0) { +- system "/etc/init.d/nscd restart > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + # take down session +diff -up smbldap-tools-0.9.6/smbldap_tools.pm.orig smbldap-tools-0.9.6/smbldap_tools.pm +--- smbldap-tools-0.9.6/smbldap_tools.pm.orig 2010-12-09 14:33:14.422276943 +0000 ++++ smbldap-tools-0.9.6/smbldap_tools.pm 2010-12-09 14:33:14.429277160 +0000 +@@ -745,9 +745,10 @@ sub delete_user { + # $gid = group_add($groupname, $group_gid, $force_using_existing_gid) + sub group_add { + my ( $gname, $gid, $force ) = @_; +- my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++ my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd stop > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + if ( !defined($gid) ) { + +@@ -765,7 +766,8 @@ sub group_add { + } + } + if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd start > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + my $modify = $ldap->add( + "cn=$gname,$config{groupsdn}", +diff -up smbldap-tools-0.9.6/smbldap-useradd.orig smbldap-tools-0.9.6/smbldap-useradd +--- smbldap-tools-0.9.6/smbldap-useradd.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-useradd 2010-12-09 14:33:14.430277191 +0000 +@@ -87,10 +87,11 @@ my $ldap_master = connect_ldap_master(); + + # cause problems when dealing with getpwuid because of the + # negative ttl and ldap modification +-my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd stop > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + # Read only first @ARGV +@@ -188,7 +189,8 @@ elsif ( getpwuid($userUidNumber) ) { + } + + if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd start > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + my $createGroup = 0; +diff -up smbldap-tools-0.9.6/smbldap-userdel.orig smbldap-tools-0.9.6/smbldap-userdel +--- smbldap-tools-0.9.6/smbldap-userdel.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-userdel 2010-12-09 14:33:14.430277191 +0000 +@@ -96,10 +96,11 @@ if ($homedir) { + system('rm', @rmargs, $homedir); + } + +-my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ($nscd_status == 0) { +- system "/etc/init.d/nscd restart > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + $ldap_master->unbind; # take down session +diff -up smbldap-tools-0.9.6/smbldap-usermod.orig smbldap-tools-0.9.6/smbldap-usermod +--- smbldap-tools-0.9.6/smbldap-usermod.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-usermod 2010-12-09 14:33:14.431277221 +0000 +@@ -253,22 +253,15 @@ my $_userRid; + + if ( defined( $tmp = $Options{'u'} ) ) { + if ( !defined( $Options{'o'} ) ) { +- $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++ $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd stop > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } +- + if ( getpwuid($tmp) ) { +- if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd start > /dev/null 2>&1"; +- } +- + print "$0: uid number $tmp exists\n"; + exit(6); + } +- if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd start > /dev/null 2>&1"; +- } + } + + push( @mods, 'uidNumber', $tmp ); +@@ -903,10 +896,11 @@ if ( defined( my $new_user = $Options{'r + $ldap_master->unbind; + } + +-$nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++$nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + + if ( $nscd_status == 0 ) { +- system "/etc/init.d/nscd restart > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + if ( defined( $Options{'P'} ) ) { +diff -up smbldap-tools-0.9.6/smbldap-usershow.orig smbldap-tools-0.9.6/smbldap-usershow +--- smbldap-tools-0.9.6/smbldap-usershow.orig 2010-11-15 14:45:49.000000000 +0000 ++++ smbldap-tools-0.9.6/smbldap-usershow 2010-12-09 14:39:44.214244168 +0000 +@@ -55,9 +55,10 @@ if ( defined( $Options{'X'} ) ) { + $characterSet = "UTF-8"; + } + +-my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1"; ++my $nscd_status = system "/etc/rc.d/init.d/nscd status >/dev/null 2>&1"; + if ($nscd_status == 0) { +- system "/etc/init.d/nscd restart > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i passwd > /dev/null 2>&1"; ++ system "/usr/sbin/nscd -i group > /dev/null 2>&1"; + } + + my $ldap_slave=connect_ldap_slave(); diff --git a/smbldap-tools-0.9.6-utf-8.patch b/smbldap-tools-0.9.6-utf-8.patch new file mode 100644 index 0000000..a94aeea --- /dev/null +++ b/smbldap-tools-0.9.6-utf-8.patch @@ -0,0 +1,24 @@ +--- smbldap-tools-0.9.6/smbldap_tools.pm 2010-12-09 13:31:10.191649352 +0000 ++++ smbldap-tools-0.9.6/smbldap_tools.pm 2010-12-09 14:29:52.083037534 +0000 +@@ -828,9 +828,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 =~ /\P{IsPrint}/ ); ++ } + $lines .= $attr . ": " . join( ',', @vals ) . "\n"; + } + } +@@ -857,7 +857,7 @@ + foreach my $attr ( $entry->attributes ) { + my @vals = $entry->get_value($attr); + foreach my $val (@vals) { +- $val = "**UNPRINTABLE**" if ( $val =~ /[^[:print:]]/ ); ++ $val = "**UNPRINTABLE**" if ( $val =~ /\P{IsPrint}/ ); + } + if ( $attr eq "sambaPwdLastSet" + or $attr eq "sambaPwdCanChange" diff --git a/smbldap-tools.spec b/smbldap-tools.spec index c6b382e..806977a 100644 --- a/smbldap-tools.spec +++ b/smbldap-tools.spec @@ -1,15 +1,11 @@ Summary: User and group administration tools for Samba/OpenLDAP Name: smbldap-tools -Version: 0.9.5 -Release: 7%{?dist} +Version: 0.9.6 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Base URL: https://gna.org/projects/smbldap-tools/ -Source0: http://download.gna.org/smbldap-tools/packages/smbldap-tools-%{version}.tgz -# Need samba-common for /usr/bin/smbpasswd -Requires: samba-common -# Need openldap-servers for /usr/sbin/slappasswd -Requires: openldap-servers +Source0: http://download.gna.org/smbldap-tools/packages/smbldap-tools-%{version}.tar.gz # Need perl(IO::Socket::SSL) for LDAP over SSL (#122066, #207430) Requires: perl(IO::Socket::SSL) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) @@ -18,19 +14,15 @@ BuildArch: noarch BuildRequires: openssl # Fedora integration -Patch0: smbldap-tools-0.9.5-config.patch +Patch0: smbldap-tools-0.9.6-config.patch # Assume UTF-8 locale rather than ISO-8859-1 # http://bugzilla.redhat.com/441833 https://gna.org/bugs/?11717 -Patch1: smbldap-tools-0.9.5-utf-8.patch - -# Avoid race problems with chown on LDAP slaves -# http://bugzilla.redhat.com/447758 https://gna.org/bugs/?11721 -Patch2: smbldap-tools-0.9.5-chown.patch +Patch1: smbldap-tools-0.9.6-utf-8.patch # Don't stop/start nscd, invalidate caches instead # http://bugzilla.redhat.com/476504 https://gna.org/bugs/?13098 -Patch3: smbldap-tools-0.9.5-nscd.patch +Patch3: smbldap-tools-0.9.6-nscd.patch %description In conjunction with OpenLDAP and Samba-LDAP servers, this collection is useful @@ -45,10 +37,9 @@ groups and passwords. smbldap_tools.pm configure.pl %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p0 +%patch3 -p1 -# Don't want these in %{_sbindir}... +# Don't want these in %%{_sbindir}... %{__mv} smbldap-tools.spec original-smbldap-tools.spec # Convert docs to UTF-8 where needed @@ -64,11 +55,14 @@ for i in smbldap-*; do done # Figure out where ssl stuff goes -%define use_pki %(if [ -f %{_sysconfdir}/pki/tls/certs/ca-bundle.crt ]; then echo 1; else echo 0; fi) +%define use_pki %(if [ -f /etc/pki/tls/certs/ca-bundle.crt ]; then echo 1; else echo 0; fi) %if ! %{use_pki} %{__perl} -pi -e 's|/etc/pki/tls/certs/|%{_datadir}/ssl/certs/|g;' smbldap.conf %endif +# Not allowed to have executable docs any more +%{__chmod} -R -c -x+X configure.pl doc/ + %build %install @@ -94,6 +88,7 @@ done %config(noreplace) %{_sysconfdir}/smbldap-tools/smbldap_bind.conf %{_sbindir}/smbldap-groupadd %{_sbindir}/smbldap-groupdel +%{_sbindir}/smbldap-grouplist %{_sbindir}/smbldap-groupmod %{_sbindir}/smbldap-groupshow %{_sbindir}/smbldap-passwd @@ -105,17 +100,63 @@ done %{_sbindir}/smbldap-userinfo %{_sbindir}/smbldap-usershow %{perl_vendorlib}/smbldap_tools.pm -%{_mandir}/man8/* +%{_mandir}/man8/smbldap-groupadd.8* +%{_mandir}/man8/smbldap-groupdel.8* +%{_mandir}/man8/smbldap-grouplist.8* +%{_mandir}/man8/smbldap-groupmod.8* +%{_mandir}/man8/smbldap-groupshow.8* +%{_mandir}/man8/smbldap-passwd.8* +%{_mandir}/man8/smbldap-populate.8* +%{_mandir}/man8/smbldap-useradd.8* +%{_mandir}/man8/smbldap-userdel.8* +%{_mandir}/man8/smbldap-userinfo.8* +%{_mandir}/man8/smbldap-userlist.8* +%{_mandir}/man8/smbldap-usermod.8* +%{_mandir}/man8/smbldap-usershow.8* %changelog -* Wed Jun 02 2010 Marcela Maslanova - 0.9.5-7 -- Mass rebuild with perl-5.12.0 +* Thu Dec 9 2010 Paul Howarth - 0.9.6-1 +- update to 0.9.6 + - 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 + to avoid race conditions (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 + - fix Z option in smbldap-useradd (custom LDAP attribute) (fixes #590429) + - alphabetically reorganize options + - fix several mis-spellings and typos in smbldap-useradd +- update source URL to reflect new upstream file layout +- drop upstreamed chown patch +- update remaining patches to remove fuzz +- drop dependency on openldap-servers (for /usr/sbin/slappasswd) as the + default configuration is to hash passwords directly rather than calling out + to slappasswd (#609056) +- drop dependency on samba-common (for /usr/bin/smbpasswd) as the default + configuration handles the functionality directly rather than calling out to + smbpasswd +- drop execute permissions from configuration/migration scripts in %%doc + +* Wed Jun 2 2010 Marcela Maslanova - 0.9.5-7 +- mass rebuild with perl-5.12.0 * Mon Dec 7 2009 Stepan Kasal - 0.9.5-6 - rebuild against perl 5.10.1 * Sun Jul 26 2009 Fedora Release Engineering - 0.9.5-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild +- rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri Mar 6 2009 Paul Howarth 0.9.5-4 - change dependencies on samba and openldap-clients to samba-common and diff --git a/sources b/sources index 4e9487e..e7b4d63 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2a9a84c657af35b9c9734a5b1bc5fe8f smbldap-tools-0.9.5.tgz +88c371fd16193a03ed0f98fd29f19515 smbldap-tools-0.9.6.tar.gz