@@ -55,7 +55,19 @@ lazy_static! {
5555 static ref APPSEC_CONFIG : Mutex <Option <AppSecConfig >> = Mutex :: new( None ) ;
5656}
5757
58+ // Records the appsec helper configuration to be handed to the sidecar.
59+ //
5860// must be called prior to ddog_sidecar_connect
61+ //
62+ // Note: `shared_lib_path`, `socket_file_path` and `lock_file_path` are currently
63+ // ignored. libdatadog dropped them from `AppSecConfig` when the sidecar stopped
64+ // launching the helper itself (injecting the helper shared object into the
65+ // daemon and calling `appsec_helper_main` through `dlsym`). The helper is now
66+ // expected to be linked into whoever embeds the sidecar and to register itself
67+ // with `datadog_sidecar::appsec::register_backend_factory`, with the extension
68+ // talking to it over the sidecar transport instead of its own unix socket. The
69+ // C parameters are kept because that migration needs them; see
70+ // `tmp/REPORT.md`.
5971#[ no_mangle]
6072pub extern "C" fn ddog_sidecar_enable_appsec (
6173 shared_lib_path : CharSlice ,
@@ -65,31 +77,27 @@ pub extern "C" fn ddog_sidecar_enable_appsec(
6577 log_level : CharSlice ,
6678) -> ( ) {
6779 let mut appsec_config_guard = APPSEC_CONFIG . lock ( ) . unwrap ( ) ;
68- let shared_lib_path_os: std:: ffi:: OsString ;
69- let socket_file_path_os: std:: ffi:: OsString ;
70- let lock_file_path_os: std:: ffi:: OsString ;
7180 let log_file_path_os: std:: ffi:: OsString ;
7281
7382 #[ cfg( unix) ]
7483 {
75- shared_lib_path_os = OsStr :: from_bytes ( shared_lib_path. as_bytes ( ) ) . to_owned ( ) ;
76- socket_file_path_os = OsStr :: from_bytes ( socket_file_path. as_bytes ( ) ) . to_owned ( ) ;
77- lock_file_path_os = OsStr :: from_bytes ( lock_file_path. as_bytes ( ) ) . to_owned ( ) ;
7884 log_file_path_os = OsStr :: from_bytes ( log_file_path. as_bytes ( ) ) . to_owned ( ) ;
7985 }
8086
8187 #[ cfg( windows) ]
8288 {
83- shared_lib_path_os = OsStr :: new ( & * shared_lib_path. to_utf8_lossy ( ) ) . to_owned ( ) ;
84- socket_file_path_os = OsStr :: new ( & * socket_file_path. to_utf8_lossy ( ) ) . to_owned ( ) ;
85- lock_file_path_os = OsStr :: new ( & * lock_file_path. to_utf8_lossy ( ) ) . to_owned ( ) ;
8689 log_file_path_os = OsStr :: new ( & * log_file_path. to_utf8_lossy ( ) ) . to_owned ( ) ;
8790 }
8891
92+ warn ! (
93+ "The sidecar no longer starts the appsec helper: helper {} will not be loaded and no one \
94+ will be listening on {}",
95+ shared_lib_path. to_utf8_lossy( ) ,
96+ socket_file_path. to_utf8_lossy( ) ,
97+ ) ;
98+ let _ = lock_file_path;
99+
89100 appsec_config_guard. deref_mut ( ) . replace ( AppSecConfig {
90- shared_lib_path : shared_lib_path_os,
91- socket_file_path : socket_file_path_os,
92- lock_file_path : lock_file_path_os,
93101 log_file_path : log_file_path_os,
94102 log_level : log_level. to_utf8_lossy ( ) . to_string ( ) ,
95103 } ) ;
0 commit comments