]> git.saurik.com Git - apple/xnu.git/blobdiff - tools/lldbmacros/kauth.py
xnu-6153.101.6.tar.gz
[apple/xnu.git] / tools / lldbmacros / kauth.py
index 89ee5845c6d47a02da78a37801acaf1163811e71..5c0bce32922ad8d1750efe0ad1a69274fd15b9a7 100755 (executable)
@@ -19,16 +19,13 @@ def PrintKauthCache(cmd_args=None):
          and print out usage information.
     """
     anchor = unsigned(kern.globals.kauth_cred_table_anchor)
-    alloc_info_struct = anchor - sizeof('struct _mhead')
-    alloc_info = kern.GetValueFromAddress(alloc_info_struct, 'struct _mhead*')
-    alloc_size = unsigned(alloc_info.mlen) - (sizeof('struct _mhead'))
-    table_entries = alloc_size / sizeof('struct kauth_cred_entry_head')
+    table_entries = 128 # KAUTH_CRED_TABLE_SIZE
     anchor = kern.globals.kauth_cred_table_anchor
     print "Cred cache has: " + str(table_entries) + " buckets\n"
     print "Number of items in each bucket ... \n"
     for i in range(0, table_entries):
         numinbucket = 0
-        for kauth_cred in IterateTAILQ_HEAD(anchor[i], "cr_link"):
+        for kauth_cred in IterateListEntry(anchor[i], 'kauth_cred_t', "cr_link"):
             numinbucket += 1
             #print str(kauth_cred.cr_posix)
             #print str(kauth_cred.cr_ref)