Skip to content

fix: use group id instead of names for compaudit#20

Open
mikegeeves wants to merge 1 commit into
romkatv:masterfrom
mikegeeves:fix/group-id-instead-of-name
Open

fix: use group id instead of names for compaudit#20
mikegeeves wants to merge 1 commit into
romkatv:masterfrom
mikegeeves:fix/group-id-instead-of-name

Conversation

@mikegeeves

Copy link
Copy Markdown

We use "cattle" GCP VMs as remote development environments, so persist e.g. $HOME but not the root OS -> trying zsh-bin

In this case, the user's group is not present in /etc/group. getent is able to look it up via nss (there's a GCP oslogin module), but zsh-bin is not.

When running compaudit it fails:

❯ compaudit 
compaudit:142: unknown group

Setting ZSH_DISABLE_COMPFIX=true didn't seem to help.

This patches compaudit to use the numeric group id (which has been retrieved already anyway) instead of the name. I think in the context of "being portable" this makes sense.

I would think it's unlikely to be possible for getent to be able to retrieve the name but not the id, so I don't think there would be a downside, or it be worth additional validation to ensure the id is non-empty etc. Tested with a build and install on the target environment which has solved the issue for me (some issues encountered initially with the busybox patch silently failing at IDE-removed-trailing-whitespace).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant