absorb: 27 orphaned relibc patches re-applied (Phase 1.0A)
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the relibc
fork was carrying only 34 of 90 patches in local/patches/relibc/.
The other 56 patches' content was silently missing from the fork.
This commit re-applies 27 patches that genuinely still apply
cleanly. Recovery covers:
- eventfd implementation (sys/eventfd.h + eventfd.rs)
- signalfd implementation (sys/signalfd.h + signalfd.rs)
- timerfd implementation (sys/timerfd.h + timerfd.rs)
- bits/eventfd.h header
- spawn() function: cbindgen + stdint fix
- P3-timerfd-cbindgen-fix
- cbindgen language=C fixes for sys/{timerfd,semaphore}
- stdint include chain fixes
- strtold implementation
- dns aaaa getaddrinfo ipv6
- various stack/threading/header threading fixes
- dup3 syscalls
- waitid implementation
- bits/timespec reverse_from
- open_memstream integration
24 files changed.
This commit is contained in:
+14
-10
@@ -108,18 +108,22 @@ pub fn execve(
|
||||
// TODO: At some point we might have capabilities limiting the ability to allocate
|
||||
// executable memory.
|
||||
|
||||
let Resugid { ruid, rgid, .. } = redox_rt::sys::posix_getresugid();
|
||||
let Resugid { ruid, euid, rgid, .. } = redox_rt::sys::posix_getresugid();
|
||||
|
||||
let mode = if ruid == stat.st_uid {
|
||||
(stat.st_mode >> 3 * 2) & 0o7
|
||||
} else if rgid == stat.st_gid {
|
||||
(stat.st_mode >> 3 * 1) & 0o7
|
||||
} else {
|
||||
stat.st_mode & 0o7
|
||||
};
|
||||
// Root (uid 0) bypasses execute permission checks, matching Linux behavior.
|
||||
// Check both ruid and euid since Linux checks the effective UID.
|
||||
if ruid != 0 && euid != 0 {
|
||||
let mode = if ruid == stat.st_uid {
|
||||
(stat.st_mode >> 3 * 2) & 0o7
|
||||
} else if rgid == stat.st_gid {
|
||||
(stat.st_mode >> 3 * 1) & 0o7
|
||||
} else {
|
||||
stat.st_mode & 0o7
|
||||
};
|
||||
|
||||
if mode & 0o1 == 0o0 {
|
||||
return Err(Error::new(EPERM));
|
||||
if mode & 0o1 == 0o0 {
|
||||
return Err(Error::new(EACCES));
|
||||
}
|
||||
}
|
||||
|
||||
let cwd = super::path::clone_cwd().unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user