Skip to content

Commit

Permalink
Merge pull request #57 from orhun/chore/bump_linux_personality
Browse files Browse the repository at this point in the history
chore(deps): bump linux_personality crate to 2
  • Loading branch information
JakWai01 authored Oct 7, 2024
2 parents 013def6 + 7281a39 commit 4a9c7f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
12 changes: 3 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ clap = { version = "4", features = ["derive"] }
comfy-table = "7"
console = "0.15.8"
libc = "0.2"
linux-personality = "1"
linux-personality = "2"
nix = { version = "0.29", features = ["ptrace", "signal"] }
regex = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use comfy_table::presets::UTF8_BORDERS_ONLY;
use comfy_table::CellAlignment::Right;
use comfy_table::{Cell, ContentArrangement, Row, Table};
use libc::user_regs_struct;
use linux_personality::{personality, ADDR_NO_RANDOMIZE};
use linux_personality::{personality, Personality};
use nix::sys::ptrace::{self, Event};
use nix::sys::signal::Signal;
use nix::sys::wait::{wait, WaitStatus};
Expand Down Expand Up @@ -470,7 +470,8 @@ impl<W: Write> Tracer<W> {

pub fn run_tracee(command: &[String], envs: &[String], username: &Option<String>) -> Result<()> {
ptrace::traceme()?;
personality(ADDR_NO_RANDOMIZE).map_err(|_| anyhow!("Unable to set ADDR_NO_RANDOMIZE"))?;
personality(Personality::ADDR_NO_RANDOMIZE)
.map_err(|_| anyhow!("Unable to set ADDR_NO_RANDOMIZE"))?;
let mut binary = command
.get(0)
.ok_or_else(|| anyhow!("No command"))?
Expand Down

0 comments on commit 4a9c7f5

Please sign in to comment.