]> eyrie.org Git - kerberos/wallet.git/commitdiff
Correction to AD handling of long service keytab IDs
authorBill MacAllister <whm@dropbox.com>
Fri, 6 May 2016 19:40:17 +0000 (19:40 +0000)
committerRuss Allbery <eagle@eyrie.org>
Mon, 28 May 2018 00:33:31 +0000 (17:33 -0700)
The account name for a service keytab cannot exceed 20 characters.
The routine that was generating a unique id incorrectly attempted to
perform an LDAP query.  This change fixes that problem.

perl/lib/Wallet/Kadmin/AD.pm

index 83912dd458643f85b84e53654ecfc19f1da18f14..2d93b32cb13c0efe59c749838b146b58ffd4cff2 100644 (file)
@@ -280,8 +280,8 @@ sub get_service_id {
             my $this_prefix = substr($this_cn, 0, 20-$suffix_size);
             my $this_format = "%0${suffix_size}i";
             while ($cnt<$loop_limit) {
-                my $this_cn = $this_prefix . sprintf($this_format, $cnt);
-                $this_dn = ldap_get_dn($this_base, "cn=$this_cn");
+                $this_cn = $this_prefix . sprintf($this_format, $cnt);
+                $this_dn = $self->ldap_get_dn($this_base, "cn=$this_cn");
                 if (!$this_dn) {
                     $this_id = $this_cn;
                     last;