class Process

Defined in:

lib/user_group/src/process.cr
restrict.cr

Constructors

Class Method Summary

Constructor Detail

def self.restrict(path : String? = nil, user : UserTypes? = -1, group : GroupTypes? = -1, wait : Bool = true, &) : Process? #

Forks the current process then changes the root directory and the current working directory and sets the real, effective, and saved user and group to the ones specified before yielding to the given block.

Process.restrict("/var/empty", "nobody", "nobody", wait: true) {
  # New restricted process
}

[View source]

Class Method Detail

def self.restrict(path : String? = nil, user : UserTypes? = nil, group : GroupTypes? = nil) : Nil #

Changes the root directory and the current working directory for the current process and sets the real, effective, and saved user and group for the current process to the ones specified.

Process.restrict("/var/empty", "nobody", "nobody")

[View source]