From 22faf6b6156cefd6c09b6b64d6648075ba5bc700 Mon Sep 17 00:00:00 2001 From: Connor-GH Date: Wed, 29 Apr 2026 15:23:56 -0500 Subject: [PATCH] fchownat: fix behavior for uid == -1 && gid == -1 Previously, this would error with EINVAL since the conversion to unsigned int would fail on -1. Now, we do a bitwise conversion via an `as` cast. --- src/platform/redox/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 752339a711..910817f048 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -333,11 +333,7 @@ impl Pal for Sys { } let path = path.to_str().map_err(|_| Errno(EINVAL))?; let file = openat2(fildes, path, flags, 0)?; - libredox::fchown( - *file as usize, - owner.try_into().map_err(|_| Errno(EINVAL))?, - group.try_into().map_err(|_| Errno(EINVAL))?, - )?; + libredox::fchown(*file as usize, owner as _, group as _)?; Ok(()) }