Skip to content

Commit 2120623

Browse files
authored
fix(ext/node): comment out op_geteuid and op_getegid (#574)
1 parent 0e71c5c commit 2120623

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

ext/node/ops/os/mod.rs

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -214,44 +214,46 @@ where
214214

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

227-
#[cfg(windows)]
228-
let euid = 0;
229-
#[cfg(unix)]
230-
// SAFETY: Call to libc geteuid.
231-
let euid = unsafe { libc::geteuid() };
227+
// #[cfg(windows)]
228+
// let euid = 0;
229+
// #[cfg(unix)]
230+
// // SAFETY: Call to libc geteuid.
231+
// let euid = unsafe { libc::geteuid() };
232232

233-
Ok(euid)
233+
// Ok(euid)
234+
Ok(0)
234235
}
235236

236237
#[op2(fast, stack_trace)]
237238
pub fn op_getegid<P>(
238-
state: &mut OpState,
239+
_state: &mut OpState,
239240
) -> Result<u32, deno_core::error::AnyError>
240241
where
241242
P: NodePermissions + 'static,
242243
{
243-
{
244-
let permissions = state.borrow_mut::<P>();
245-
permissions.check_sys("getegid", "node:os.getegid()")?;
246-
}
244+
// {
245+
// let permissions = state.borrow_mut::<P>();
246+
// permissions.check_sys("getegid", "node:os.getegid()")?;
247+
// }
247248

248-
#[cfg(windows)]
249-
let egid = 0;
250-
#[cfg(unix)]
251-
// SAFETY: Call to libc getegid.
252-
let egid = unsafe { libc::getegid() };
249+
// #[cfg(windows)]
250+
// let egid = 0;
251+
// #[cfg(unix)]
252+
// // SAFETY: Call to libc getegid.
253+
// let egid = unsafe { libc::getegid() };
253254

254-
Ok(egid)
255+
// Ok(egid)
256+
Ok(0)
255257
}
256258

257259
#[op2(stack_trace)]

0 commit comments

Comments
 (0)