Don't assume principal components are C strings in klist -s
authorGreg Hudson <ghudson@mit.edu>
Wed, 25 May 2011 21:45:40 +0000 (21:45 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 25 May 2011 21:45:40 +0000 (21:45 +0000)
ticket: 6915

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24944 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/klist/klist.c

index 6f378255c0c1b47bf226c50913ebb4bc6c203d67..3d34aedd8a56d56d002dbb41bd8662a62e3d5cc1 100644 (file)
@@ -24,7 +24,7 @@
  * or implied warranty.
  */
 
-#include "autoconf.h"
+#include "k5-int.h"
 #include <krb5.h>
 #include <com_err.h>
 #include <stdlib.h>
@@ -386,10 +386,9 @@ void do_ccache(name)
             continue;
         if (status_only) {
             if (exit_status && creds.server->length == 2 &&
-                strcmp(creds.server->realm.data, princ->realm.data) == 0 &&
-                strcmp((char *)creds.server->data[0].data, "krbtgt") == 0 &&
-                strcmp((char *)creds.server->data[1].data,
-                       princ->realm.data) == 0 &&
+                data_eq(creds.server->realm, princ->realm) &&
+                data_eq_string(creds.server->data[0], "krbtgt") &&
+                data_eq(creds.server->data[1], princ->realm) &&
                 creds.times.endtime > now)
                 exit_status = 0;
         } else {