--- smbldap-tools-0.9.2/smbldap-usermod~ 2006-01-03 12:57:41.000000000 +0200 +++ smbldap-tools-0.9.2/smbldap-usermod 2006-08-03 19:52:16.913071888 +0300 @@ -134,22 +133,12 @@ if ( defined( $tmp = $Options{'u'} ) ) { if ( !defined( $Options{'o'} ) ) { - $nscd_status = system "/etc/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" if -x "/usr/sbin/nscd"; 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 ); @@ -529,11 +516,7 @@ $ldap_master->unbind; } -$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"; -} +system "/usr/sbin/nscd -i passwd" if -x "/usr/sbin/nscd"; if ( defined( $Options{'P'} ) ) { exec "$RealBin/smbldap-passwd $user" --- smbldap-tools-0.9.2/smbldap_tools.pm~ 2006-01-03 12:57:41.000000000 +0200 +++ smbldap-tools-0.9.2/smbldap_tools.pm 2006-08-03 19:53:47.965109611 +0300 @@ -693,10 +693,7 @@ sub group_add { my ( $gname, $gid, $force ) = @_; - my $nscd_status = system "/etc/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 group" if -x "/usr/sbin/nscd"; if ( !defined($gid) ) { #while (defined(getgrgid($config{GID_START}))) { # $config{GID_START}++; @@ -710,9 +707,6 @@ } } } - if ( $nscd_status == 0 ) { - system "/etc/init.d/nscd start > /dev/null 2>&1"; - } my $modify = $ldap->add( "cn=$gname,$config{groupsdn}", attrs => [ --- smbldap-tools-0.9.2/smbldap-useradd~ 2006-01-03 12:57:41.000000000 +0200 +++ smbldap-tools-0.9.2/smbldap-useradd 2006-08-03 19:56:17.748461827 +0300 @@ -75,14 +75,6 @@ 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"; - -if ( $nscd_status == 0 ) { - system "/etc/init.d/nscd stop > /dev/null 2>&1"; -} - # Read only first @ARGV my $userName = $ARGV[0]; @@ -103,6 +93,8 @@ exit(1); } +system "/usr/sbin/nscd -i passwd" if -x "/usr/sbin/nscd"; + # user must not exist in LDAP (should it be nss-wide ?) my ( $rc, $dn ) = get_user_dn2($userName); if ( $rc and defined($dn) ) { @@ -152,10 +144,6 @@ die "Uid already exists.\n"; } -if ( $nscd_status == 0 ) { - system "/etc/init.d/nscd start > /dev/null 2>&1"; -} - my $createGroup = 0; my $userGidNumber = $Options{'g'}; --- smbldap-tools-0.9.2/smbldap-userdel~ 2006-01-03 12:57:41.000000000 +0200 +++ smbldap-tools-0.9.2/smbldap-userdel 2006-08-03 19:56:57.219345223 +0300 @@ -95,12 +95,7 @@ system('rm', @rmargs, $homedir); } -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"; -} - +system "/usr/sbin/nscd -i passwd" if -x "/usr/sbin/nscd"; $ldap_master->unbind; # take down session exit (0); --- smbldap-tools-0.9.2/smbldap-groupmod~ 2006-01-03 12:57:41.000000000 +0200 +++ smbldap-tools-0.9.2/smbldap-groupmod 2006-08-03 19:57:32.490134624 +0300 @@ -65,11 +65,7 @@ my $newname = $Options{'n'}; -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"; -} +system "/usr/sbin/nscd -i group" if -x "/usr/sbin/nscd"; my $gid = getgrnam($groupName); unless (defined ($gid)) { @@ -222,12 +218,6 @@ $modify->code && warn "failed to delete entry: ", $modify->error ; } -$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"; -} - # take down session $ldap_master->unbind; --- smbldap-tools-0.9.2/smbldap-groupdel~ 2006-01-03 12:57:41.000000000 +0200 +++ smbldap-tools-0.9.2/smbldap-groupdel 2006-08-03 19:57:59.760744975 +0300 @@ -56,11 +56,7 @@ group_del($dn); -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"; -} +system "/usr/sbin/nscd -i group" if -x "/usr/sbin/nscd"; #if (defined($dn_line = get_group_dn($_groupName))) { # print "$0: failed to delete group\n";