Changeset 11460 for trunk

Show
Ignore:
Timestamp:
09/30/08 13:54:54 (3 months ago)
Author:
juruen@…
Message:

+ Do not delete some domain attributes that are used to store password

attributes such us password length, expiration...

Location:
trunk/client/samba
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/client/samba/ChangeLog

    r11457 r11460  
    33        It's possible to run into that scenarion depending when the user/group is 
    44        created 
     5        + Do not delete some domain attributes that are used to store password 
     6        attributes such us password length, expiration... 
    570.12.3 
    68        + Add configuration variable to enable/disable quota support 
  • trunk/client/samba/conf/80samba.conf

    r11443 r11460  
    2020 
    2121# enable quota support 
    22 enable_quota = no 
     22enable_quota = yes 
  • trunk/client/samba/src/EBox/SambaLdapUser.pm

    r11457 r11460  
    984984        my $sid  = getSID(); 
    985985 
     986        my %domainAttrs = %{$self->_fetchDomainAttrs($domain)}; 
    986987        $self->deleteSambaDomainNameAttrs(); 
    987988        $self->deleteSambaDomains(); 
     
    995996                        'gidNumber'             => $users->lastGid, 
    996997                        'objectClass'           => ['sambaDomain',  
    997                                                     'sambaUnixidPool'] 
     998                                                    'sambaUnixidPool'], 
     999                        %domainAttrs 
    9981000                        ] 
    999                    ); 
     1001                ); 
    10001002 
    10011003        my $dn = "sambaDomainName=$domain,dc=ebox"; 
     
    10031005} 
    10041006 
     1007sub _fetchDomainAttrs 
     1008{ 
     1009        my ($self, $domain) = @_; 
     1010 
     1011        my $ldap = EBox::Ldap->instance(); 
     1012 
     1013        my @attrs = qw/sambaPwdHistoryLength sambaMaxPwdAge sambaLockoutThreshold/; 
     1014        my $result = $ldap->search(  
     1015                        { 
     1016                        base => $ldap->dn(), 
     1017                        filter => "sambaDomainName=$domain", 
     1018                        scope => 'sub', 
     1019                        attrs => [@attrs], 
     1020                        } 
     1021                        ); 
     1022 
     1023        my $entry = $result->pop_entry(); 
     1024        return {} unless defined($entry); 
     1025        my %attributes; 
     1026        for my $attr (@attrs) { 
     1027                $attributes{$attr} = $entry->get_value($attr); 
     1028                return {} unless defined($attributes{$attr}); 
     1029        } 
     1030        return \%attributes; 
     1031} 
    10051032 
    10061033sub deleteSambaDomainNameAttrs 
     
    12051232                        base   => $groupDN, 
    12061233                        filter => "(&(objectclass=sambaGroupMapping)(!(sambaSID=$sid*)))", 
    1207                         attrs  => ['sambaSID'], 
     1234                        attrs  => ['sambaSID', 'cn'], 
    12081235                        scope  => 'sub' 
    12091236                        ); 
    12101237 
    12111238        $result = $ldap->search(\%attrs); 
     1239        my %groupsToSkip = ('Administrators' => 1, 'Account Operators' => 1, 
     1240                            'Print Operators' => 1, 'Backup Operators' => 1, 'Replicators' => 1); 
    12121241 
    12131242        for my $entry ($result->entries()) { 
     1243                next if $groupsToSkip{$entry->get_value('cn')}; 
    12141244                my $oldSID = $entry->get_value('sambaSID'); 
    12151245                my ($lastNumbers) = $oldSID =~ /.*-(\d+)$/;