Index: npl/fileserver/smb-ldap-tool/modified/smbldap-groupdel
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-groupdel	(revision 3187b26af2b4b347eccad2613ce637bcb59900e4)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-groupdel	(revision 250d444cb34f2fb5cdab63bc934cf67a5331688c)
@@ -57,10 +57,9 @@
 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 "nscd -i passwd; nscd -i group";
+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";
+}
 
 #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 3187b26af2b4b347eccad2613ce637bcb59900e4)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-groupmod	(revision 250d444cb34f2fb5cdab63bc934cf67a5331688c)
@@ -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,10 +66,9 @@
 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 "nscd -i passwd; nscd -i group";
+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 $gid = getgrnam($groupName);
@@ -224,10 +223,9 @@
 }
 
-# $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";
+$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
Index: npl/fileserver/smb-ldap-tool/modified/smbldap-useradd
===================================================================
--- npl/fileserver/smb-ldap-tool/modified/smbldap-useradd	(revision 3187b26af2b4b347eccad2613ce637bcb59900e4)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-useradd	(revision 250d444cb34f2fb5cdab63bc934cf67a5331688c)
@@ -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,9 +158,8 @@
   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}
@@ -253,5 +252,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/\$$/) ) {
@@ -271,5 +270,5 @@
     system "stty -echo";
     print "New password : ";
-    chomp($pass=<STDIN>);
+    chomp($pass=<STDIN>); 
     print "\n";
     system "stty echo";
@@ -346,5 +345,5 @@
 	my $OX_TZ = "Europe/Amsterdam";
 	my $WRITE_GLOBAL_ADDR = "TRUE";
-
+	
   my $GROUPWARE_SERVER="none";
   if (defined($Options{'W'}))
@@ -389,9 +388,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) {
@@ -417,7 +416,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"; 
       }
     }
@@ -499,5 +498,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 3187b26af2b4b347eccad2613ce637bcb59900e4)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-userdel	(revision 250d444cb34f2fb5cdab63bc934cf67a5331688c)
@@ -105,5 +105,4 @@
   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 3187b26af2b4b347eccad2613ce637bcb59900e4)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap-usermod	(revision 250d444cb34f2fb5cdab63bc934cf67a5331688c)
@@ -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,5 +152,4 @@
 	system "/etc/init.d/nscd start > /dev/null 2>&1";
       }
-      system "nscd -i passwd; nscd -i group";
 
       print "$0: uid number $tmp exists\n";
@@ -220,5 +219,5 @@
 }
 
-if (defined($tmp = $Options{'N'})) {
+if (defined($tmp = $Options{'N'})) { 
   push(@mods, 'cn' => $tmp);
 }
@@ -228,6 +227,6 @@
   push(@mods, 'givenName' => $tmp);
 }
-
-if (defined($tmp = $Options{'S'})) {
+  
+if (defined($tmp = $Options{'S'})) { 
   push(@mods, 'sn' => $tmp);
 }
@@ -581,5 +580,4 @@
   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 3187b26af2b4b347eccad2613ce637bcb59900e4)
+++ npl/fileserver/smb-ldap-tool/modified/smbldap_tools.pm	(revision 250d444cb34f2fb5cdab63bc934cf67a5331688c)
@@ -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,8 +742,7 @@
 	  }
 	}
-	# if ($nscd_status == 0) {
-	  # system "/etc/init.d/nscd start > /dev/null 2>&1";
-	  system "nscd -i passwd; nscd -i group";
-	# }
+	if ($nscd_status == 0) {
+	  system "/etc/init.d/nscd start > /dev/null 2>&1";
+	}
 	my $modify = $ldap->add ( "cn=$gname,$config{groupsdn}",
 									 attrs => [
@@ -753,5 +752,5 @@
 											  ]
 								   );
-
+	
 	$modify->code && die "failed to add entry: ", $modify->error ;
 	return $gid;
@@ -1079,5 +1078,5 @@
 	}
 	my $entry = $next_uid_mesg->entry(0);
-
+            
 	$nextuid = $entry->get_value($attribute);
 	my $modify=$ldap->modify( "$config{sambaUnixIdPooldn}",
@@ -1104,5 +1103,5 @@
 
 sub utf8Encode {
-  my $arg = shift;
+  my $arg = shift; 
 
   return to_utf8(
@@ -1119,5 +1118,6 @@
                                    -charset => 'ISO-8859-1',
                                   );
-}
+}   
 
 1;
+
