diff --git a/sysutils/jail_exporter/files/patch-cargo-crates_jail-0.1.1_src_param.rs b/sysutils/jail_exporter/files/patch-cargo-crates_jail-0.1.1_src_param.rs new file mode 100644 index 000000000000..0c523dbd5bca --- /dev/null +++ b/sysutils/jail_exporter/files/patch-cargo-crates_jail-0.1.1_src_param.rs @@ -0,0 +1,29 @@ +--- cargo-crates/jail-0.1.1/src/param.rs.orig 2021-04-16 09:13:39 UTC ++++ cargo-crates/jail-0.1.1/src/param.rs +@@ -640,7 +640,7 @@ pub fn get(jid: i32, name: &str) -> Result Result Ok(Value::S32(LittleEndian::read_i32(&value))), + Type::U32 => Ok(Value::U32(LittleEndian::read_u32(&value))), + Type::String => Ok(Value::String({ +- unsafe { CStr::from_ptr(value.as_ptr() as *mut i8) } ++ unsafe { CStr::from_ptr(value.as_ptr() as *mut libc::c_char) } + .to_string_lossy() + .into_owned() + })), +@@ -807,7 +807,7 @@ pub fn set(jid: i32, name: &str, value: Value) -> Resu + ) + }; + +- let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) } ++ let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) } + .to_string_lossy() + .to_string(); + diff --git a/sysutils/jail_exporter/files/patch-cargo-crates_jail-0.1.1_src_sys.rs b/sysutils/jail_exporter/files/patch-cargo-crates_jail-0.1.1_src_sys.rs new file mode 100644 index 000000000000..7ca344440c25 --- /dev/null +++ b/sysutils/jail_exporter/files/patch-cargo-crates_jail-0.1.1_src_sys.rs @@ -0,0 +1,38 @@ +--- cargo-crates/jail-0.1.1/src/sys.rs.orig 2021-04-16 09:14:49 UTC ++++ cargo-crates/jail-0.1.1/src/sys.rs +@@ -113,7 +113,7 @@ pub fn jail_create( + ) + }; + +- let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) } ++ let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) } + .to_string_lossy() + .to_string(); + +@@ -171,7 +171,7 @@ pub fn jail_clearpersist(jid: i32) -> Result<(), JailE + ) + }; + +- let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) } ++ let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) } + .to_string_lossy() + .to_string(); + +@@ -213,7 +213,7 @@ pub fn jail_getid(name: &str) -> Result Result>( + + loop { + // Unsafe C call to get the jail resource usage. +- if unsafe { api(inbuf.as_ptr(), inputlen, outbuf.as_mut_ptr(), outbuf.len()) } != 0 { ++ if unsafe { api(inbuf.as_ptr(), inputlen, outbuf.as_mut_ptr() as *mut libc::c_char, outbuf.len()) } != 0 { + let err = io::Error::last_os_error(); + + match err.raw_os_error() { +@@ -1850,7 +1850,7 @@ fn rctl_api_wrapper>( + + // If everything went well, convert the return C string in the outbuf + // back into an easily usable Rust string and return. +- break Ok(unsafe { CStr::from_ptr(outbuf.as_ptr() as *mut i8) } ++ break Ok(unsafe { CStr::from_ptr(outbuf.as_ptr() as *mut libc::c_char) } + .to_string_lossy() + .into()); + }