From 6761581db7a4ba48ddcad9bc1dc16dafc60eb8cd Mon Sep 17 00:00:00 2001 From: Pawel Zmarzly Date: Thu, 21 Nov 2024 12:46:11 -0800 Subject: [PATCH] [antlir] Add standard uidmaps Summary: Adding lists of known UIDs and GIDs. Each file represents a logical namespace (e.g. instagram, wsl, metalos). All UIDs/GIDs should be unique within a namespace. Code is extracted from D66000745, see that diff for more context. Test Plan: used in next diffs Reviewed By: epilatow Differential Revision: D66301414 fbshipit-source-id: c68fcfb67acb91de091b72c58dea4e4d0cb42baf --- antlir/uidmaps/BUCK | 24 ++++++++++++++++++++++++ antlir/uidmaps/antlir.json | 24 ++++++++++++++++++++++++ antlir/uidmaps/centos.json | 10 ++++++++++ 3 files changed, 58 insertions(+) create mode 100644 antlir/uidmaps/BUCK create mode 100644 antlir/uidmaps/antlir.json create mode 100644 antlir/uidmaps/centos.json diff --git a/antlir/uidmaps/BUCK b/antlir/uidmaps/BUCK new file mode 100644 index 00000000000..d524c5482ed --- /dev/null +++ b/antlir/uidmaps/BUCK @@ -0,0 +1,24 @@ +load("@prelude//:paths.bzl", "paths") +load("//antlir/bzl:build_defs.bzl", "alias", "export_file", "internal_external") +# @oss-disable + +oncall("antlir") + +alias( + name = "default", + actual = internal_external( + fb = ":metalos", + oss = ":antlir", + ), + visibility = ["PUBLIC"], +) + +[ + export_file( + name = paths.basename(f).removesuffix(".json"), + src = f, + ) + for f in glob(["**/*.json"]) +] + +# @oss-disable diff --git a/antlir/uidmaps/antlir.json b/antlir/uidmaps/antlir.json new file mode 100644 index 00000000000..66c7bbfa165 --- /dev/null +++ b/antlir/uidmaps/antlir.json @@ -0,0 +1,24 @@ +{ + "users": { + "antlir": { + "uid": 1000 + }, + "foouser": { + "uid": 1001 + }, + "demoservice": { + "uid": 1002 + } + }, + "groups": { + "antlir": { + "gid": 1000 + }, + "foogroup": { + "gid": 1001 + }, + "demoservice": { + "gid": 1002 + } + } +} diff --git a/antlir/uidmaps/centos.json b/antlir/uidmaps/centos.json new file mode 100644 index 00000000000..e334c8dfb02 --- /dev/null +++ b/antlir/uidmaps/centos.json @@ -0,0 +1,10 @@ +{ + "users": { + "systemd-network": {"uid": 192}, + "systemd-resolve": {"uid": 193} + }, + "groups": { + "systemd-network": {"gid": 192}, + "systemd-resolve": {"gid": 193} + } +}