Commit 3883a32
committed
common: use fallback for group inference on remote systems
When provisioning remote bare metal systems or VMs with different
user configurations, getent group <username> may fail if the user's
primary group has a different name. This is common in:
- Enterprise environments with LDAP/AD integration
- Bare metal systems with pre-existing user configurations
- Systems like NixOS with different group naming conventions
- Cloud/managed hosting with auto-generated group names
Add fallback to extract the primary GID from the passwd entry and
look up the group by GID, which is more reliable across diverse
system configurations.
Signed-off-by: Luis Chamberlain <[email protected]>1 parent 4f11d3f commit 3883a32
1 file changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
63 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments