diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 05:31:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 05:31:45 +0000 |
commit | 74aa0bc6779af38018a03fd2cf4419fe85917904 (patch) | |
tree | 9cb0681aac9a94a49c153d5823e7a55d1513d91f /src/systemtap | |
parent | Initial commit. (diff) | |
download | sssd-74aa0bc6779af38018a03fd2cf4419fe85917904.tar.xz sssd-74aa0bc6779af38018a03fd2cf4419fe85917904.zip |
Adding upstream version 2.9.4.upstream/2.9.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/systemtap')
-rw-r--r-- | src/systemtap/sssd.stp.in | 294 | ||||
-rw-r--r-- | src/systemtap/sssd_functions.stp | 142 | ||||
-rw-r--r-- | src/systemtap/sssd_probes.d | 77 |
3 files changed, 513 insertions, 0 deletions
diff --git a/src/systemtap/sssd.stp.in b/src/systemtap/sssd.stp.in new file mode 100644 index 0000000..77988b5 --- /dev/null +++ b/src/systemtap/sssd.stp.in @@ -0,0 +1,294 @@ +# Database transaction probes +probe sssd_transaction_start = process("@libdir@/sssd/libsss_util.so").mark("sysdb_transaction_start") +{ + nesting = $arg1; + probestr = sprintf("-> %s(nesting=%d)", + $$name, + nesting); +} + +probe sssd_transaction_commit_before = process("@libdir@/sssd/libsss_util.so").mark("sysdb_transaction_commit_before") +{ + nesting = $arg1; + probestr = sprintf("<- %s(pre)(nesting=%d)", + $$name, + nesting); +} + +probe sssd_transaction_commit_after = process("@libdir@/sssd/libsss_util.so").mark("sysdb_transaction_commit_after") +{ + nesting = $arg1; + probestr = sprintf("<- %s(post)(nesting=%d)", + $$name, + nesting); +} + +probe sssd_transaction_cancel = process("@libdir@/sssd/libsss_util.so").mark("sysdb_transaction_cancel") +{ + nesting = $arg1; + probestr = sprintf("<- %s(nesting=%d)", + $$name, + nesting); +} + +# LDAP search probes +probe sdap_search_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_get_generic_ext_send") +{ + base = user_string($arg1); + scope = $arg2; + if ($arg3 == 0) { + filter = "<no filter>"; + } else { + filter = user_string($arg3); + } + attrs = __get_argv($arg4, 0); + + probestr = sprintf("-> search base [%s] scope [%d] filter [%s]", + base, scope, filter); +} + +probe sdap_search_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_get_generic_ext_recv") +{ + base = user_string($arg1); + scope = $arg2; + if ($arg3 == 0) { + filter = "<no filter>"; + } else { + filter = user_string($arg3); + } + + probestr = sprintf("<- search base [%s] scope [%d] filter [%s]", + base, scope, filter); +} + +probe sdap_parse_entry = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_parse_entry") +{ + attr = user_string($arg1); + value = user_string_n($arg2, $arg3); +} + +probe sdap_parse_entry_done = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_parse_entry_done") +{ + # No arguments +} + +probe sdap_deref_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_deref_search_send") +{ + base_dn = user_string($arg1); + deref_attr = user_string($arg2); + + probestr = sprintf("-> (%s)(base_dn=[%s],deref_attr=[%s])", + $$name, base_dn, deref_attr); +} + +probe sdap_deref_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_deref_search_recv") +{ + base_dn = user_string($arg1); + deref_attr = user_string($arg2); + + probestr = sprintf("-> (%s)(base_dn=[%s],deref_attr=[%s])", + $$name, base_dn, deref_attr); +} + +# LDAP account request probes +probe sdap_acct_req_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_acct_req_send") +{ + entry_type = $arg1; + filter_type = $arg2; + filter_value = user_string($arg3); + extra_value = user_string($arg4); +} + +probe sdap_acct_req_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_acct_req_recv") +{ + entry_type = $arg1; + filter_type = $arg2; + filter_value = user_string($arg3); + extra_value = user_string($arg4); +} + +# LDAP user search probes +probe sdap_search_user_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_search_user_send") +{ + filter = user_string($arg1); +} + +probe sdap_search_user_save_begin = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_search_user_save_begin") +{ + filter = user_string($arg1); +} + +probe sdap_search_user_save_end = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_search_user_save_end") +{ + filter = user_string($arg1); +} + +probe sdap_search_user_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_search_user_recv") +{ + filter = user_string($arg1); +} + +# LDAP group search probes +probe sdap_nested_group_populate_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_populate_pre") +{ + # No arguments +} + +probe sdap_nested_group_populate_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_populate_post") +{ + # No arguments +} + +probe sdap_nested_group_save_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_save_pre") +{ + # No arguments +} + +probe sdap_nested_group_save_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_save_post") +{ + # No arguments +} + +probe sdap_nested_group_lookup_user_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_lookup_user_send") +{ + # No arguments +} + +probe sdap_nested_group_lookup_user_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_lookup_user_recv") +{ + # No arguments +} + +probe sdap_nested_group_lookup_group_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_lookup_group_send") +{ + # No arguments +} + +probe sdap_nested_group_lookup_group_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_lookup_group_recv") +{ + # No arguments +} + +probe sdap_nested_group_lookup_unknown_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_lookup_unknown_send") +{ + # No arguments +} + +probe sdap_nested_group_lookup_unknown_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_lookup_unknown_recv") +{ + # No arguments +} + +probe sdap_nested_group_deref_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_deref_send") +{ + # No arguments +} + +probe sdap_nested_group_deref_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_deref_recv") +{ + # No arguments +} + +probe sdap_nested_group_deref_process_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_deref_process_pre") +{ + # No arguments +} + +probe sdap_nested_group_deref_process_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_deref_process_post") +{ + # No arguments +} + +probe sdap_nested_group_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_send") +{ + # No arguments +} + +probe sdap_nested_group_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_recv") +{ + # No arguments +} + +probe sdap_nested_group_process_send = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_process_send") +{ + orig_dn = user_string($arg1); + + probestr = sprintf("-> %s(orig_dn=[%s])", + $$name, orig_dn); +} + +probe sdap_nested_group_process_split_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_process_split_pre") +{ + # No arguments +} + +probe sdap_nested_group_process_split_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_process_split_post") +{ + # No arguments +} + +probe sdap_nested_group_check_cache_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_check_cache_pre") +{ + # No arguments +} + +probe sdap_nested_group_check_cache_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_check_cache_post") +{ + # No arguments +} + +probe sdap_nested_group_sysdb_search_users_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_sysdb_search_users_pre") +{ + # No arguments +} + +probe sdap_nested_group_sysdb_search_users_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_sysdb_search_users_post") +{ + # No arguments +} + +probe sdap_nested_group_sysdb_search_groups_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_sysdb_search_groups_pre") +{ + # No arguments +} + +probe sdap_nested_group_sysdb_search_groups_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_sysdb_search_groups_post") +{ + # No arguments +} + +probe sdap_nested_group_populate_search_users_pre = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_populate_search_users_pre") +{ + # No arguments +} + +probe sdap_nested_group_populate_search_users_post = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_populate_search_users_post") +{ + # No arguments +} + +probe sdap_nested_group_process_recv = process("@libdir@/sssd/libsss_ldap_common.so").mark("sdap_nested_group_process_recv") +{ + orig_dn = user_string($arg1); + + probestr = sprintf("-> %s(orig_dn=[%s])", + $$name, orig_dn); +} + +## Data Provider Request Probes +probe dp_req_send = process("@libexecdir@/sssd/sssd_be").mark("dp_req_send") +{ + dp_req_domain = user_string($arg1, "NULL"); + dp_req_name = user_string($arg2, "NULL"); + dp_req_target = $arg3; + dp_req_method = $arg4; +} + +probe dp_req_done = process("@libexecdir@/sssd/sssd_be").mark("dp_req_done") +{ + dp_req_name = user_string($arg1, "NULL"); + dp_req_target = $arg2; + dp_req_method = $arg3; + dp_ret = $arg4; + dp_errorstr = user_string($arg5, "NULL"); +} diff --git a/src/systemtap/sssd_functions.stp b/src/systemtap/sssd_functions.stp new file mode 100644 index 0000000..5130290 --- /dev/null +++ b/src/systemtap/sssd_functions.stp @@ -0,0 +1,142 @@ +// constants +global TARGET_ID=0, TARGET_AUTH=1, TARGET_ACCESS=2, TARGET_CHPASS=3, + TARGET_SUDO=4, TARGET_AUTOFS=5, TARGET_SELINUX=6, TARGET_HOSTID=7, + TARGET_SUBDOMAINS=8, TARGET_SESSION=9, TARGET_RESOLVER=10, + TARGET_SENTINEL=11 + +global METHOD_CHECK_ONLINE=0, METHOD_ACCOUNT_HANDLER=1, METHOD_AUTH_HANDLER=2, + METHOD_ACCESS_HANDLER=3, METHOD_SELINUX_HANDLER=4, METHOD_SUDO_HANDLER=5, + METHOD_AUTOFS_HANDLER=6, METHOD_HOSTID_HANDLER=7, METHOD_DOMAINS_HANDLER=8, + METHOD_RESOLVER_HANDLER=9, METHOD_SENTINEL=10 + +function acct_req_desc(entry_type) +{ + if (entry_type == 0x0001) { + str_entry_type = "user" + } else if (entry_type == 0x0002) { + str_entry_type = "group" + } else if (entry_type == 0x0003) { + str_entry_type = "initgroups" + } else if (entry_type == 0x0004) { + str_entry_type = "netgroups" + } else if (entry_type == 0x0005) { + str_entry_type = "services" + } else if (entry_type == 0x0006) { + str_entry_type = "sudo_full" + } else if (entry_type == 0x0007) { + str_entry_type = "sudo_rules" + } else if (entry_type == 0x0008) { + str_entry_type = "host" + } else if (entry_type == 0x0009) { + str_entry_type = "ip_network" + } else if (entry_type == 0x0010) { + str_entry_type = "subid_ranges" + } else if (entry_type == 0x0011) { + str_entry_type = "by_secid" + } else if (entry_type == 0x0012) { + str_entry_type = "user_and_group" + } else if (entry_type == 0x0013) { + str_entry_type = "by_uuid" + } else if (entry_type == 0x0014) { + str_entry_type = "by_cert" + } else { + str_entry_type = sprintf("%X", entry_type) + } + + return str_entry_type +} + +function sssd_acct_req_probestr(fc_name, entry_type, filter_type, + filter_value, extra_value) +{ + str_entry_type = acct_req_desc(entry_type) + + # Maybe we could use guru mode here and include the constants + # directly.. + if (filter_type == 1) { + str_filter_type = "name" + } else if (filter_type == 2) { + str_filter_type = "idnum" + } else if (filter_type == 3) { + str_filter_type = "enum" + } else if (filter_type == 4) { + str_filter_type = "secid" + } else if (filter_type == 5) { + str_filter_type = "uuid" + } else if (filter_type == 6) { + str_filter_type = "cert" + } else if (filter_type == 7) { + str_filter_type = "wildcard" + } else { + str_filter_type = sprintf("%d", filter_type) + } + + probestr = sprintf("%s(entry_type=%s, filter_type=%s, filter_value=%s, extra_value=%s)", + fc_name, str_entry_type, str_filter_type, + filter_value, extra_value) + return probestr +} + +function dp_target_str(target) +{ + if (target == TARGET_ID) { + str_target = "ID" + } else if (target == TARGET_AUTH) { + str_target = "AUTH" + } else if (target == TARGET_ACCESS) { + str_target = "ACCESS" + } else if (target == TARGET_CHPASS) { + str_target = "CHPASS" + } else if (target == TARGET_SUDO) { + str_target = "SUDO" + } else if (target == TARGET_AUTOFS) { + str_target = "AUTOFS" + } else if (target == TARGET_SELINUX) { + str_target = "SELINUX" + } else if (target == TARGET_HOSTID) { + str_target = "HOSTID" + } else if (target == TARGET_SUBDOMAINS) { + str_target = "SUBDOMAINS" + } else if (target == TARGET_SESSION) { + str_target = "SESSION" + } else if (target == TARGET_RESOLVER) { + str_target = "RESOLVER" + } else if (target == TARGET_SENTINEL) { + str_target = "TARGET_SENTINEL" + } else { + str_target = "UNKNOWN" + } + + return str_target +} + +function dp_method_str(method) +{ + if (method == METHOD_CHECK_ONLINE) { + str_method = "Check Online" + } else if (method == METHOD_ACCOUNT_HANDLER) { + str_method = "Account Handler" + } else if (method == METHOD_AUTH_HANDLER) { + str_method = "Auth Handler" + } else if (method == METHOD_ACCESS_HANDLER) { + str_method = "Access Handler" + } else if (method == METHOD_SELINUX_HANDLER) { + str_method = "SELinux Handler" + } else if (method == METHOD_SUDO_HANDLER) { + str_method = "Sudo Handler" + } else if (method == METHOD_AUTOFS_HANDLER) { + str_method = "Autofs Handler" + } else if (method == METHOD_HOSTID_HANDLER) { + str_method = "HostID Handler" + } else if (method == METHOD_DOMAINS_HANDLER) { + str_method = "Domains Handler" + } else if (method == METHOD_RESOLVER_HANDLER) { + str_method = "Resolver Handler" + } else if (method == METHOD_SENTINEL) { + str_method = "Method Sentinel" + } else { + str_method = "UNKNOWN" + } + + return str_method +} diff --git a/src/systemtap/sssd_probes.d b/src/systemtap/sssd_probes.d new file mode 100644 index 0000000..91abd01 --- /dev/null +++ b/src/systemtap/sssd_probes.d @@ -0,0 +1,77 @@ +provider sssd { + probe sysdb_transaction_start(int nesting); + probe sysdb_transaction_commit_before(int nesting); + probe sysdb_transaction_commit_after(int nesting); + probe sysdb_transaction_cancel(int nesting); + + probe sdap_acct_req_send(int entry_type, + int filter_type, + char *filter_value, + char *extra_value); + probe sdap_acct_req_recv(int entry_type, + int filter_type, + char *filter_value, + char *extra_value); + + probe sdap_search_user_send(const char *filter); + probe sdap_search_user_save_begin(const char *filter); + probe sdap_search_user_save_end(const char *filter); + probe sdap_search_user_recv(const char *filter); + + probe sdap_get_generic_ext_send(const char *base, int scope, + const char *filter, const char **attrs); + probe sdap_get_generic_ext_recv(const char *base, int scope, const char *filter); + + probe sdap_parse_entry(const char *attrname, const char *value, int length); + probe sdap_parse_entry_done(); + + probe sdap_deref_search_send(const char *base_dn, const char *deref_attr); + probe sdap_deref_search_recv(const char *base_dn, const char *deref_attr); + + probe sdap_nested_group_populate_pre(); + probe sdap_nested_group_populate_post(); + + probe sdap_nested_group_save_pre(); + probe sdap_nested_group_save_post(); + + probe sdap_nested_group_lookup_user_send(); + probe sdap_nested_group_lookup_user_recv(); + + probe sdap_nested_group_lookup_group_send(); + probe sdap_nested_group_lookup_group_recv(); + + probe sdap_nested_group_lookup_unknown_send(); + probe sdap_nested_group_lookup_unknown_recv(); + + probe sdap_nested_group_deref_send(); + probe sdap_nested_group_deref_process_pre(); + probe sdap_nested_group_deref_process_post(); + probe sdap_nested_group_deref_recv(); + + probe sdap_save_group_pre(); + probe sdap_save_group_post(); + + probe sdap_save_grpmem_pre(); + probe sdap_save_grpmem_post(); + + probe sdap_nested_group_send(); + probe sdap_nested_group_recv(); + + probe sdap_nested_group_process_send(const char *orig_dn); + probe sdap_nested_group_process_split_pre(); + probe sdap_nested_group_process_split_post(); + probe sdap_nested_group_process_recv(const char *orig_dn); + probe sdap_nested_group_check_cache_pre(); + probe sdap_nested_group_check_cache_post(); + probe sdap_nested_group_sysdb_search_users_pre(); + probe sdap_nested_group_sysdb_search_users_post(); + probe sdap_nested_group_sysdb_search_groups_pre(); + probe sdap_nested_group_sysdb_search_groups_post(); + probe sdap_nested_group_populate_search_users_pre(); + probe sdap_nested_group_populate_search_users_post(); + + probe dp_req_send(const char *domain, const char *dp_req_name, + int target, int method); + probe dp_req_done(const char *dp_req_name, int target, int method, + int ret, const char *errorstr); +} |