Skip to main content

Module id_names

Module id_names 

Source
Expand description

Resolve numeric uid/gid to names by reading the image’s own /etc/passwd and /etc/group.

A Linux disk image contains the mapping it was built with, so we don’t have to guess: /etc/passwd maps uid → user name, /etc/group maps gid → group name. Showing root / www-data instead of 0 / 33 in the browse view and File Info is a small thing that makes a Linux rootfs far more legible.

This is best-effort and advisory. Plenty of images have no /etc (a data partition, a non-Linux filesystem, a bare application squashfs), and an id with no entry simply falls back to the number. Nothing here is load- bearing — it never blocks an operation, and a wrong or missing name changes only what’s displayed, never what’s written.

Structs§

IdNameMap
uid → user name and gid → group name, parsed from an image’s account files.