public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
* [isar-cip-core][RFC] Handling UIDs/GIDs on Updates
@ 2025-04-22  8:51 Heinisch, Alexander
  2025-04-22  9:09 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Heinisch, Alexander @ 2025-04-22  8:51 UTC (permalink / raw)
  To: cip-dev@lists.cip-project.org
  Cc: quirin.gylstorff@siemens.com, MOESSBAUER, Felix, Kiszka, Jan

Hi cip-dev community,

Following RFC is not specific to isar-cip-core, but to the upgrade method we are using. So, maybe some of you are facing similar issues...

The default update strategy updates the immutable partitions in an A/B scheme. Typically, the persistent data is kept as is (at least in the majority of use cases).
Some exceptions exist where minor changes (of small parts of /var) are supported by packages linking data from /var to the immutable partitions using tempfile.d aso.

That leads to the following problem:

Once we added users to the image with data on the persistent partition /var the UIDs/GIDs must remain consistent forever.
In case package order changes, or new user accounts get created in between, this could potentially results in a shift of those ids.
Since we only upgrade the immutable parts of the system data on /var remains with privileges for owners and groups as they were before the update.
Thus, resulting in a privilege mixup on /var after upgrades.

To (partially) fix that problem multiple options exist:

1. Define fixed UID/GID sets for our users.
While this helps with our own packages, it keeps the problem when using unmodified upstream packages not using static ids for uid and gid (e.g. wfx)

2. Use tmpfile.d to modify ownerships on /var accordingly.
While this also fixes issues with upstream packages, it requires additional tooling / automation to keep it consistent with the ongoing image development. 
e.g. ROOTFS_POSTPROCESS_COMMAND or similar.

3. Use a static predefined /etc/passwd file like in base-passwd.
Unfortunately, this does not scale very well, so we need to know all possible user accounts in advance.
And further, we have to ensure, that we never change UIDs GIDs (unintentionally) in that file as well.

Any recommendations how to mitigate that issue?

BR Alexander


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-22 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-22  8:51 [isar-cip-core][RFC] Handling UIDs/GIDs on Updates Heinisch, Alexander
2025-04-22  9:09 ` Jan Kiszka
2025-04-22 14:49   ` Quirin Gylstorff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox