]> eyrie.org Git - kerberos/kadmin-remctl.git/commitdiff
Use get instead of list when checking for a principal on Heimdal
authorRuss Allbery <rra@stanford.edu>
Tue, 13 Aug 2013 22:20:10 +0000 (15:20 -0700)
committerRuss Allbery <rra@stanford.edu>
Tue, 13 Aug 2013 22:20:10 +0000 (15:20 -0700)
In the Heimdal backend, use get instead of list to check whether a
given principal already exists.  list requires a complete database
traversal and is much more resource-intensive.

NEWS
kadmin-backend-heim

diff --git a/NEWS b/NEWS
index aa8845131da39b7e19fe9f0f4440dcfdb237eaf9..37b4caeb1f248f3b7655d5a31a6df668c525995c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,10 @@ kadmin-remctl 3.5 (unreleased)
     was occasionally too short in production.  Also fix a Perl warning if
     the initial authentication times out.
 
+    In the Heimdal backend, use get instead of list to check whether a
+    given principal already exists.  list requires a complete database
+    traversal and is much more resource-intensive.
+
 kadmin-remctl 3.4 (2013-07-09)
 
     Set the disallow-svr flag on all newly-created principals.  This
index 9de5b2a29dde0dc34b4052d766c62302e38d8677..7ca0fb1ee48eef6040cc13de0f2f26bfeec101b6 100755 (executable)
@@ -265,8 +265,8 @@ sub kadmin_check {
     kadmin_config ($instance) or return;
     $principal = "$principal/$instance" if $instance;
     my $kadmin = kadmin_handle ($instance);
-    my @names = $kadmin->getPrincipals ($principal);
-    return 1 if @names;
+    my $data = $kadmin->getPrincipal ($principal);
+    return 1 if $data;
     return 0;
 }