Skip to content

Commit

Permalink
Handle excluded processes launched using relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon authored and mojganii committed Aug 20, 2024
1 parent 92b3a2c commit 9284166
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions talpid-core/src/split_tunnel/macos/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,15 @@ impl InnerProcessStates {
log::error!("exec received for unknown pid {pid}");
return;
};
if msg.target.executable.path_truncated {
log::error!(
"Ignoring process {pid} with truncated path: {}",
msg.target.executable.path
);
return;
}

info.exec_path = PathBuf::from(msg.dyld_exec_path);
info.exec_path = PathBuf::from(msg.target.executable.path);

// If the path is already excluded, no need to add it again
if info.excluded_by_paths.contains(&info.exec_path) {
Expand Down Expand Up @@ -430,7 +437,22 @@ struct ESForkEvent {
/// `exec` event returned by `eslogger`
#[derive(Debug, Deserialize)]
struct ESExecEvent {
dyld_exec_path: String,
target: EsExecTarget,
}

/// `target` field of the `exec` event returned by `eslogger`
/// See `eslogger exec` output.
#[derive(Debug, Deserialize)]
struct EsExecTarget {
executable: EsExecTargetExecutable,
}

/// `executable` field of the `exec` `target` information
/// See `eslogger exec` output.
#[derive(Debug, Deserialize)]
struct EsExecTargetExecutable {
path: String,
path_truncated: bool,
}

/// Event that triggered the message returned by `eslogger`.
Expand Down

0 comments on commit 9284166

Please sign in to comment.