Index: npl/fileserver/smb-ldap-tool/modified/smbldap-groupdel
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-groupdel	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-groupdel	(revision 6a847ef97674333e4cbc8a85e2598b0575a1cbd8)
@@ -57,9 +57,10 @@
 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";
-}
+# 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 "nscd -i passwd; nscd -i group";
 
 #if (defined($dn_line = get_group_dn($_groupName))) {
Index: npl/fileserver/smb-ldap-tool/modified/smbldap-groupmod
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-groupmod	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-groupmod	(revision 6a847ef97674333e4cbc8a85e2598b0575a1cbd8)
@@ -48,5 +48,5 @@
   print "  -r   group-rid\n";
   print "  -s   group-sid\n";
-  print "  -t   group-type\n"; 
+  print "  -t   group-type\n";
   print "  -x   delete members (comma delimted)\n";
   print "  -?   show this help message\n";
@@ -66,9 +66,10 @@
 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";
-}
+# 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 "nscd -i passwd; nscd -i group";
 
 my $gid = getgrnam($groupName);
@@ -223,9 +224,10 @@
 }
 
-$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";
-}
+# $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 "nscd -i passwd; nscd -i group";
 
 # take down session
Index: npl/fileserver/smb-ldap-tool/modified/smbldap-useradd
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-useradd	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-useradd	(revision 6a847ef97674333e4cbc8a85e2598b0575a1cbd8)
@@ -149,5 +149,5 @@
 
 my $userUidNumber = $Options{'u'};
-if (!defined($userUidNumber)) { 
+if (!defined($userUidNumber)) {
   $userUidNumber=get_next_id($config{usersdn},"uidNumber");
 } elsif (getpwuid($userUidNumber)) {
@@ -158,8 +158,9 @@
   system "/etc/init.d/nscd start > /dev/null 2>&1";
 }
+system "nscd -i passwd; nscd -i group";
 
 my $createGroup = 0;
 my $userGidNumber = $Options{'g'};
-# gid not specified ? 
+# gid not specified ?
 if (!defined($userGidNumber)) {
   # windows machine => $config{defaultComputerGid}
@@ -252,5 +253,5 @@
 # MACHINE ACCOUNT
 if (defined($Options{'w'}) or defined($Options{'i'})) {
-   
+
   # if Options{'i'} and username does not end with $ caracter => we add it
   if ( $Options{'i'} and !($userName =~ m/\$$/) ) {
@@ -270,5 +271,5 @@
     system "stty -echo";
     print "New password : ";
-    chomp($pass=<STDIN>); 
+    chomp($pass=<STDIN>);
     print "\n";
     system "stty echo";
@@ -345,5 +346,5 @@
 	my $OX_TZ = "Europe/Amsterdam";
 	my $WRITE_GLOBAL_ADDR = "TRUE";
-	
+
   my $GROUPWARE_SERVER="none";
   if (defined($Options{'W'}))
@@ -388,9 +389,9 @@
 $add->code && warn "failed to add entry: ", $add->error ;
 
-my $add2 = $ldap_master->add ("ou=addr,uid=$userName,$config{usersdn}", attr => [   'objectclass' => ['top','organizationalUnit'], 'ou'   => "addr" ] );   
+my $add2 = $ldap_master->add ("ou=addr,uid=$userName,$config{usersdn}", attr => [   'objectclass' => ['top','organizationalUnit'], 'ou'   => "addr" ] );
 
 my $add3 = $ldap_master->modify ("cn=AddressAdmins,o=AddressBook,$config{suffix}",add => { member  => "uid=$userName,$config{usersdn}" });
     $add3->code && warn "failed to add entry: ", $add3->error ;
-																																							    
+
 
 #if ($createGroup) {
@@ -416,7 +417,7 @@
       system "chown -R $userUidNumber:$userGidNumber $userHomeDirectory 2>/dev/null";
       if (defined $config{userHomeDirectoryMode}) {
-	system "chmod $config{userHomeDirectoryMode} $userHomeDirectory 2>/dev/null"; 
+	system "chmod $config{userHomeDirectoryMode} $userHomeDirectory 2>/dev/null";
       } else {
-	system "chmod 700 $userHomeDirectory 2>/dev/null"; 
+	system "chmod 700 $userHomeDirectory 2>/dev/null";
       }
     }
@@ -498,5 +499,5 @@
 						   ]
 				      );
-	
+
     $modify->code && die "failed to add entry: ", $modify->error ;
 
Index: npl/fileserver/smb-ldap-tool/modified/smbldap-userdel
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-userdel	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-userdel	(revision 6a847ef97674333e4cbc8a85e2598b0575a1cbd8)
@@ -105,4 +105,5 @@
   system "/etc/init.d/nscd restart > /dev/null 2>&1";
 }
+system "nscd -i passwd; nscd -i group";
 
 $ldap_master->unbind;		# take down session
Index: npl/fileserver/smb-ldap-tool/modified/smbldap-usermod
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-usermod	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-usermod	(revision 6a847ef97674333e4cbc8a85e2598b0575a1cbd8)
@@ -113,5 +113,5 @@
   my $valpwdcanchange = 0;
   my $valpwdmustchange = $winmagic;
-  my $valpwdlastset = 0; 
+  my $valpwdlastset = 0;
   my $valacctflags = "[UX]";
   my $user_entry=read_user_entry($user);
@@ -143,5 +143,5 @@
   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";
@@ -152,4 +152,5 @@
 	system "/etc/init.d/nscd start > /dev/null 2>&1";
       }
+      system "nscd -i passwd; nscd -i group";
 
       print "$0: uid number $tmp exists\n";
@@ -219,5 +220,5 @@
 }
 
-if (defined($tmp = $Options{'N'})) { 
+if (defined($tmp = $Options{'N'})) {
   push(@mods, 'cn' => $tmp);
 }
@@ -227,6 +228,6 @@
   push(@mods, 'givenName' => $tmp);
 }
-  
-if (defined($tmp = $Options{'S'})) { 
+
+if (defined($tmp = $Options{'S'})) {
   push(@mods, 'sn' => $tmp);
 }
@@ -580,4 +581,5 @@
   system "/etc/init.d/nscd restart > /dev/null 2>&1";
 }
+system "nscd -i passwd; nscd -i group";
 
 if (defined($Options{'P'})) {
Index: npl/fileserver/smb-ldap-tool/modified/smbldap_tools.pm
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap_tools.pm	(revision c5c522c7ca74a4c1725ca5e3fe0bdcadff80e49a)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap_tools.pm	(revision 6a847ef97674333e4cbc8a85e2598b0575a1cbd8)
@@ -241,5 +241,5 @@
 	undef $smbconf{$parameter_smb};
   }
-  
+
 }
 
@@ -287,5 +287,5 @@
 									 # debug => 0xffff,
 									);
-									
+
 	if ($ldap_master)
 	{
@@ -542,5 +542,5 @@
 										  ]
 								);
-	
+
 	$add->code && warn "failed to add entry: ", $add->error ;
 	sleep($wait);
@@ -564,5 +564,5 @@
 	$name =~ s/.$//s;
 
-	my ($lmpassword,$ntpassword) = ntlmgen $name;	
+	my ($lmpassword,$ntpassword) = ntlmgen $name;
 	my $modify = $ldap->modify ( "uid=$user,$config{computersdn}",
 										changes => [
@@ -581,5 +581,5 @@
 												   ]
 									  );
-	
+
 	$modify->code && die "failed to add entry: ", $modify->error ;
 
@@ -594,5 +594,5 @@
 	if (!defined(get_group_dn($group))) {
 	  print "$0: group \"$group\" doesn't exist\n";
-	  exit (6); 
+	  exit (6);
 	}
 	if (!defined($dn_line)) {
@@ -666,5 +666,5 @@
   }
 
-  
+
 sub add_grouplist_user
 {
@@ -683,5 +683,5 @@
 	my $dn_line;
 	my $dn = get_dn_from_line($dn_line);
-	
+
 	if (!defined($dn_line = get_user_dn($user))) {
 	  print "$0: user $user doesn't exist\n";
@@ -725,8 +725,8 @@
   {
 	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";
-	}
+	# 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";
+	# }
 	if (!defined($gid)) {
 	  #while (defined(getgrgid($config{GID_START}))) {
@@ -742,7 +742,8 @@
 	  }
 	}
-	if ($nscd_status == 0) {
-	  system "/etc/init.d/nscd start > /dev/null 2>&1";
-	}
+	# if ($nscd_status == 0) {
+	  # system "/etc/init.d/nscd start > /dev/null 2>&1";
+	  system "nscd -i passwd; nscd -i group";
+	# }
 	my $modify = $ldap->add ( "cn=$gname,$config{groupsdn}",
 									 attrs => [
@@ -752,5 +753,5 @@
 											  ]
 								   );
-	
+
 	$modify->code && die "failed to add entry: ", $modify->error ;
 	return $gid;
@@ -1078,5 +1079,5 @@
 	}
 	my $entry = $next_uid_mesg->entry(0);
-            
+
 	$nextuid = $entry->get_value($attribute);
 	my $modify=$ldap->modify( "$config{sambaUnixIdPooldn}",
@@ -1103,5 +1104,5 @@
 
 sub utf8Encode {
-  my $arg = shift; 
+  my $arg = shift;
 
   return to_utf8(
@@ -1118,6 +1119,5 @@
                                    -charset => 'ISO-8859-1',
                                   );
-}   
+}
 
 1;
-
