mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-13 15:15:58 +08:00
libssl's path should not be hard coded (#123)
This commit is contained in:
@@ -315,7 +315,7 @@ int BPF_URETPROBE(probe_SSL_do_handshake_exit) {
|
|||||||
if (env.openssl) {
|
if (env.openssl) {
|
||||||
char *openssl_path = find_library_path("libssl.so");
|
char *openssl_path = find_library_path("libssl.so");
|
||||||
printf("OpenSSL path: %s\n", openssl_path);
|
printf("OpenSSL path: %s\n", openssl_path);
|
||||||
attach_openssl(obj, "/lib/x86_64-linux-gnu/libssl.so.3");
|
attach_openssl(obj, openssl_path);
|
||||||
}
|
}
|
||||||
if (env.gnutls) {
|
if (env.gnutls) {
|
||||||
char *gnutls_path = find_library_path("libgnutls.so");
|
char *gnutls_path = find_library_path("libgnutls.so");
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ To achieve this functionality, the `find_library_path` function is first used to
|
|||||||
if (env.openssl) {
|
if (env.openssl) {
|
||||||
char *openssl_path = find_library_path("libssl.so");
|
char *openssl_path = find_library_path("libssl.so");
|
||||||
printf("OpenSSL path: %s\n", openssl_path);
|
printf("OpenSSL path: %s\n", openssl_path);
|
||||||
attach_openssl(obj, "/lib/x86_64-linux-gnu/libssl.so.3");
|
attach_openssl(obj, openssl_path);
|
||||||
}
|
}
|
||||||
if (env.gnutls) {
|
if (env.gnutls) {
|
||||||
char *gnutls_path = find_library_path("libgnutls.so");
|
char *gnutls_path = find_library_path("libgnutls.so");
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ int main(int argc, char **argv) {
|
|||||||
if (env.openssl) {
|
if (env.openssl) {
|
||||||
char *openssl_path = find_library_path("libssl.so");
|
char *openssl_path = find_library_path("libssl.so");
|
||||||
printf("OpenSSL path: %s\n", openssl_path);
|
printf("OpenSSL path: %s\n", openssl_path);
|
||||||
attach_openssl(obj, "/lib/x86_64-linux-gnu/libssl.so.3");
|
attach_openssl(obj, openssl_path);
|
||||||
}
|
}
|
||||||
if (env.gnutls) {
|
if (env.gnutls) {
|
||||||
char *gnutls_path = find_library_path("libgnutls.so");
|
char *gnutls_path = find_library_path("libgnutls.so");
|
||||||
|
|||||||
Reference in New Issue
Block a user