Changeset 11644 for trunk

Show
Ignore:
Timestamp:
11/12/08 16:38:16 (8 weeks ago)
Author:
javier.amor.garcia@…
Message:

Make and restore backup more robust: removed slapd.conf parameters in both slapadd and slapcat invokations, so we can use the module with sldap with configuration in the directory itself

Location:
trunk/client/usersandgroups
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/client/usersandgroups/ChangeLog

    r11512 r11644  
    110.12.100 
    2         + Restore backup is more robust: inexistent users in a group are ignored 
     2        + Restore backup is more robust: inexistent users in a group are 
     3        ignored 
     4        + Make and restore backup more robust: removed slapd.conf 
     5        parameters in both slapadd and slapcat invokations, so we can use 
     6        the module with sldap with configuration in the directory itself 
    370.12.99 
    48        + New release 
  • trunk/client/usersandgroups/src/EBox/Ldap.pm

    r11274 r11644  
    558558   
    559559  my $ldapDir       = EBox::Ldap::dataDir(); 
    560   my $slapdConfFile = EBox::Ldap::slapdConfFile(); 
    561560  my $user  = EBox::Config::user(); 
    562561  my $group = EBox::Config::group(); 
    563562  my $ldifFile = $self->ldifFile($dir); 
    564563 
    565   my $slapcatCommand = $self->_slapcatCmd($ldifFile, $slapdConfFile); 
     564  my $slapcatCommand = $self->_slapcatCmd($ldifFile); 
    566565  my $chownCommand = "/bin/chown $user.$group $ldifFile"; 
    567566 
     
    581580   
    582581  my $ldapDir   = EBox::Ldap::dataDir(); 
    583   my $slapdConfFile = EBox::Ldap::slapdConfFile(); 
    584582  my $ldifFile = $self->ldifFile($dir); 
    585583 
    586584  my $backupCommand = $self->_backupSystemDirectory(); 
    587585  my $rmCommand = $self->_rmLdapDirCmd($ldapDir); 
    588   my $slapaddCommand = $self->_slapaddCmd($ldifFile, $slapdConfFile); 
     586  my $slapaddCommand = $self->_slapaddCmd($ldifFile); 
    589587  my $chownDataCommand = $self->_chownDatadir; 
    590588   
     
    619617sub _slapcatCmd 
    620618{ 
    621   my ($self, $ldifFile, $slapdConfFile) = @_; 
    622   return  "/usr/sbin/slapcat  -f $slapdConfFile > $ldifFile"; 
     619  my ($self, $ldifFile) = @_; 
     620  return  "/usr/sbin/slapcat  > $ldifFile"; 
    623621} 
    624622 
    625623sub _slapaddCmd 
    626624{ 
    627   my ($self, $ldifFile, $slapdConfFile) = @_; 
    628   return  "/usr/sbin/slapadd  -c -f $slapdConfFile < $ldifFile" ; 
     625  my ($self, $ldifFile) = @_; 
     626  return  "/usr/sbin/slapadd  -c < $ldifFile" ; 
    629627} 
    630628