# `Sys.Linux.Subid`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/sys/linux/subid.ex#L1)

Subuid and Subgid utilities

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, Sys.Linux.Subid.Spec.t()} | {:error, :invalid_format}
```

Parse one `/etc/subuid`/`/etc/subgid` line (`name:start:count`) into a `Spec`,
where `min_id` is `start` and `max_id` is `start + count`. A line that is not
exactly three colon-separated fields, or whose start/count are not integers,
yields `{:error, :invalid_format}`.

# `ranges`

```elixir
@spec ranges(Path.t()) ::
  {:ok, [Sys.Linux.Subid.Spec.t()]}
  | {:error,
     File.posix() | :badarg | :terminated | :system_limit | :invalid_format}
```

Parse the subid file at `path`. Any malformed line refuses the whole file
with `{:error, :invalid_format}` — these files gate privilege delegation, so
a partial read must never masquerade as the complete ruleset.

# `subgid_ranges`

```elixir
@spec subgid_ranges() ::
  {:ok, [Sys.Linux.Subid.Spec.t()]}
  | {:error,
     File.posix() | :badarg | :terminated | :system_limit | :invalid_format}
```

Return the list of all subgid ranges

# `subuid_ranges`

```elixir
@spec subuid_ranges() ::
  {:ok, [Sys.Linux.Subid.Spec.t()]}
  | {:error,
     File.posix() | :badarg | :terminated | :system_limit | :invalid_format}
```

Return the list of all subuid ranges

---

*Consult [api-reference.md](api-reference.md) for complete listing*
