Compare commits
2 Commits
ebb738445b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b60e04513 | |||
| b72ea11712 |
3
Cargo.lock
generated
3
Cargo.lock
generated
@@ -1,6 +1,6 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "agent_lib"
|
name = "agent_lib"
|
||||||
@@ -26,6 +26,7 @@ checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "shared_memory_heap"
|
name = "shared_memory_heap"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
source = "git+https://gitea.rixxc.de/rixxc/shared_memory_heap.git#ef9bcc94fb04d7191514a249c78d608d2f7cb9a6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.82"
|
anyhow = "1.0.82"
|
||||||
libc = "0.2.153"
|
libc = "0.2.153"
|
||||||
shared_memory_heap = { path = "../shared_memory_heap" }
|
shared_memory_heap = { git = "https://gitea.rixxc.de/rixxc/shared_memory_heap.git" }
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ unsafe impl Send for Agent {}
|
|||||||
impl Agent {
|
impl Agent {
|
||||||
pub(crate) unsafe fn new(agent_path: &Path, keyfile_path: &Path) -> Result<Self> {
|
pub(crate) unsafe fn new(agent_path: &Path, keyfile_path: &Path) -> Result<Self> {
|
||||||
let data_fd = get_shared_mem_fd();
|
let data_fd = get_shared_mem_fd();
|
||||||
let sync_fd = memfd_create("sync\x00".as_ptr() as *const c_char, MFD_ALLOW_SEALING);
|
let sync_fd = memfd_create("sync\x00".as_ptr() as *const c_char, 0);
|
||||||
|
|
||||||
if sync_fd <= 0 {
|
if sync_fd <= 0 {
|
||||||
bail!("creating memfd failed");
|
bail!("creating memfd failed");
|
||||||
@@ -36,8 +36,6 @@ impl Agent {
|
|||||||
0,
|
0,
|
||||||
) as *mut usize;
|
) as *mut usize;
|
||||||
|
|
||||||
fcntl(sync_fd, F_ADD_SEALS, F_SEAL_FUTURE_WRITE);
|
|
||||||
|
|
||||||
if sync_mem == MAP_FAILED as *mut usize {
|
if sync_mem == MAP_FAILED as *mut usize {
|
||||||
bail!("mmap failed");
|
bail!("mmap failed");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user