dictu-lang / Dictu

Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language.
https://dictu-lang.com
MIT License
268 stars 53 forks source link

[FEATURE] FreeBSD Jail Module #697

Closed briandowns closed 9 months ago

briandowns commented 10 months ago

Is there an existing issue for this?

Is your feature request related to a problem?

I'd like to be able to interact with the FreeBSD Jail subsystem without having to use the Process module to run userland binaries. I'd like to have a module that wraps common syscalls for Jail management and exposes them. This module would only be available on Free and Hardened BSD systems.

Not sure if this is something we'd accept as part of the stdlib or not.

Describe the solution you'd like

Example of what this all might look like...

Module

The module would expose a class called Jail.

class Jail {
    private id;                         // Number
    private version;               // Number
    private hostname;          // String
    private name;                  // String
    private ip4Addr;             // String
    private ip6Addr;             // String
    private additionalIp4s; // List<String>
    private additionalIp6s; // List<String>

    init() {}

    // any number of helper methods
}

def New(jail: Jail) -> Number

Usage

import Jail;

const j1Opts = Jail.Jail();

const j1 = Jail.new(j1Opts);

Underlying specifications can be found here: https://man.freebsd.org/cgi/man.cgi?query=jail&sektion=2

Describe alternatives you've considered

No response

Additional context

No response

Jason2605 commented 10 months ago

I would have said probably not for the stdlib but since we don't have any way of dealing with dynamic libraries at runtime (or even a package manager really) either we can probably add it in with the assumption at some point we can remove it. tl;dr we can add it in yeh

briandowns commented 9 months ago

All good points. i'll hold off until we have a package manager. Thanks!