Ignore:
Timestamp:
03/12/18 14:22:15 (7 years ago)
Author:
Edwin Eefting <edwin@datux.nl>
Branches:
master, perl-5.22
Children:
fdfd619
Parents:
1051986
Message:

flush nscd cache when modifying users

File:
1 edited

Legend:

Unmodified
Added
Removed
  • npl/fileserver/smb-ldap-tool/modified/smbldap-usermod

    r1051986 r3187b26  
    113113  my $valpwdcanchange = 0;
    114114  my $valpwdmustchange = $winmagic;
    115   my $valpwdlastset = 0; 
     115  my $valpwdlastset = 0;
    116116  my $valacctflags = "[UX]";
    117117  my $user_entry=read_user_entry($user);
     
    143143  if (defined($Options{'o'})) {
    144144    $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1";
    145        
     145
    146146    if ($nscd_status == 0) {
    147147      system "/etc/init.d/nscd stop > /dev/null 2>&1";
     
    152152        system "/etc/init.d/nscd start > /dev/null 2>&1";
    153153      }
     154      system "nscd -i passwd; nscd -i group";
    154155
    155156      print "$0: uid number $tmp exists\n";
     
    219220}
    220221
    221 if (defined($tmp = $Options{'N'})) { 
     222if (defined($tmp = $Options{'N'})) {
    222223  push(@mods, 'cn' => $tmp);
    223224}
     
    227228  push(@mods, 'givenName' => $tmp);
    228229}
    229  
    230 if (defined($tmp = $Options{'S'})) { 
     230
     231if (defined($tmp = $Options{'S'})) {
    231232  push(@mods, 'sn' => $tmp);
    232233}
     
    580581  system "/etc/init.d/nscd restart > /dev/null 2>&1";
    581582}
     583system "nscd -i passwd; nscd -i group";
    582584
    583585if (defined($Options{'P'})) {
Note: See TracChangeset for help on using the changeset viewer.