]>
git.saurik.com Git - apple/xnu.git/blob - tools/lldbmacros/kauth.py
1 """ Please make sure you read the README file COMPLETELY BEFORE reading anything below.
2 It is very critical that you read coding guidelines in Section E in README file.
8 # Macro: walkkauthcache
9 @lldb_command('walkkauthcache')
10 def WalkKauthCache(cmd_args
=None):
11 """ Walks the bins of the kauth credential hash cache and prints out the
12 number of bins and bin usage information.
15 # EndMacro: walkkauthcache
17 def PrintKauthCache(cmd_args
=None):
18 """ Routine to determine the size of the kauth cache, walk the bins
19 and print out usage information.
21 anchor
= unsigned(kern
.globals.kauth_cred_table_anchor
)
22 table_entries
= 128 # KAUTH_CRED_TABLE_SIZE
23 anchor
= kern
.globals.kauth_cred_table_anchor
24 print "Cred cache has: " + str(table_entries
) + " buckets\n"
25 print "Number of items in each bucket ... \n"
26 for i
in range(0, table_entries
):
28 for kauth_cred
in IterateListEntry(anchor
[i
], 'kauth_cred_t', "cr_link"):
30 #print str(kauth_cred.cr_posix)
31 #print str(kauth_cred.cr_ref)
32 print str(numinbucket
) + "\n"