Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions ext/node/ops/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,44 +214,46 @@ where

#[op2(fast, stack_trace)]
pub fn op_geteuid<P>(
state: &mut OpState,
_state: &mut OpState,
) -> Result<u32, deno_core::error::AnyError>
where
P: NodePermissions + 'static,
{
{
let permissions = state.borrow_mut::<P>();
permissions.check_sys("uid", "node:os.geteuid()")?;
}
// {
// let permissions = state.borrow_mut::<P>();
// permissions.check_sys("uid", "node:os.geteuid()")?;
// }

#[cfg(windows)]
let euid = 0;
#[cfg(unix)]
// SAFETY: Call to libc geteuid.
let euid = unsafe { libc::geteuid() };
// #[cfg(windows)]
// let euid = 0;
// #[cfg(unix)]
// // SAFETY: Call to libc geteuid.
// let euid = unsafe { libc::geteuid() };

Ok(euid)
// Ok(euid)
Ok(0)
}

#[op2(fast, stack_trace)]
pub fn op_getegid<P>(
state: &mut OpState,
_state: &mut OpState,
) -> Result<u32, deno_core::error::AnyError>
where
P: NodePermissions + 'static,
{
{
let permissions = state.borrow_mut::<P>();
permissions.check_sys("getegid", "node:os.getegid()")?;
}
// {
// let permissions = state.borrow_mut::<P>();
// permissions.check_sys("getegid", "node:os.getegid()")?;
// }

#[cfg(windows)]
let egid = 0;
#[cfg(unix)]
// SAFETY: Call to libc getegid.
let egid = unsafe { libc::getegid() };
// #[cfg(windows)]
// let egid = 0;
// #[cfg(unix)]
// // SAFETY: Call to libc getegid.
// let egid = unsafe { libc::getegid() };

Ok(egid)
// Ok(egid)
Ok(0)
}

#[op2(stack_trace)]
Expand Down