Project

General

Profile

Actions

Feature #11597

open

Add Linux-specific setfsuid(2)/setfsgid(2)

Added by vihai (Daniele Orlandi) over 8 years ago. Updated over 8 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:71093]

Description

I would be helpful if you add a binding to the Linux-specific syscalls

setfsuid(2)
setfsgid(2)

Their purpose is to change the uid/gid with which filesystem access control is performed. Their main usage is simulating fs access on behalf of other users.

Differently from setuid/setreuid/etc... thess calls have thread-local effect, thus they may be useful in solving some problems when needing to temporarily drop privileges in multi-threaded applications.

Updated by normalperson (Eric Wong) over 8 years ago

Given Ruby already supports Kernel#syscall, I wonder if we should
support something a generated syscall.rb file in the stdlib with
all the available syscall numbers exported as constants:

SYS_setfsuid = 138
SYS_setfsgid = 139
...

This could kill off a lot of C extensions :)

I've been happily using Danga::Socket + Sys::Syscall in Perl the past
few years. Sure there have been occasional problems, but I still prefer
aalways having the source file with me without worrying about
mis-installed objects (a frequent source of bug reports on redmine),
compile times, etc...

Actions

Also available in: Atom PDF

Like0
Like0