[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8185) Clarification/enhancement request: purging stale pwdFailureTime attributes



This is a multi-part message in MIME format.
--------------070603090603020704050207
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

FYI for anyone else who is encountering this problem -- here is a script 
that I wrote as a workaround. It sweeps through all of the 
pwdFailureTime entries in the directory and deletes stale values greater 
than $maxvalues. Also set $basedn accordingly.

It can be run with '--ldif' to preview the changes, and '--ldap' to 
actually make the changes.

The script binds with SASL EXTERNAL on the ldapi:/// interface, so make 
sure that the Unix user has the 'manage' privilege for the 
pwdFailureTime attribute. For example, to enable this for root:

access to attrs=pwdFailureTime by 
dn.base="gidnumber=0+uidnumber=0,cn=peercred,cn=external,cn=auth" manage

Regards,

     -Kartik

--------------070603090603020704050207
Content-Type: text/plain; charset=UTF-8;
 name="pwdfailuretime.pl.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="pwdfailuretime.pl.txt"

IyEgL3Vzci9iaW4vcGVybAoKIyBQdXJnZSBzdGFsZSBwd2RGYWlsdXJlVGltZSB2YWx1ZXMK
CnVzZSBOZXQ6OkxEQVA7CnVzZSBOZXQ6OkxEQVA6OkNvbnRyb2w7CnVzZSBOZXQ6OkxEQVA6
OkxESUY7CnVzZSBBdXRoZW46OlNBU0w7CnVzZSBGY250bCBxdyhMT0NLX0VYIExPQ0tfTkIp
Owp1c2UgR2V0b3B0OjpMb25nOwoKdXNlIHN0cmljdDsKCm15ICRiYXNlZG4gPSAiZGM9ZXhh
bXBsZSxkYz1jb20iOwpteSAkbWF4dmFsdWVzID0gMTA7CgojIFByZXZlbnQgbXVsdGlwbGUg
aW5zdGFuY2VzIGZyb20gcnVubmluZyBhdCB0aGUgc2FtZSB0aW1lCm9wZW4oTE9DS0ZILCAk
MCk7IGZsb2NrKExPQ0tGSCwgTE9DS19FWHxMT0NLX05CKSBvciBleGl0IDE7CgpteSAoJGdl
bmVyYXRlX2xkaWYsICR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