class Process
- Process
- Reference
- Object
Defined in:
lib/user_group/src/process.crrestrict.cr
Constructors
-
.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.
Class Method Summary
-
.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.
Constructor Detail
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
}
Class Method Detail
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")