svn rev #24944: trunk/src/clients/klist/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed May 25 17:45:40 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24944
Commit By: ghudson
Log Message:
ticket: 6915

Don't assume principal components are C strings in klist -s.


Changed Files:
U   trunk/src/clients/klist/klist.c
Modified: trunk/src/clients/klist/klist.c
===================================================================
--- trunk/src/clients/klist/klist.c	2011-05-24 00:27:18 UTC (rev 24943)
+++ trunk/src/clients/klist/klist.c	2011-05-25 21:45:40 UTC (rev 24944)
@@ -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 @@
             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 {




More information about the cvs-krb5 mailing list