debops / ansible-pki

Bootstrap and manage internal PKI, Certificate Authorities and OpenSSL/GnuTLS certificates
GNU General Public License v3.0
65 stars 29 forks source link

[fix] pki-authority: Broken script when group contains spaces #92

Closed zpfvo closed 7 years ago

zpfvo commented 7 years ago

When $(id -gn) returns a group name with spaces the script fails. Without -n the id is used and there are no problems.

drybjed commented 7 years ago

Can you even add UNIX groups with spaces? Ref: https://unix.stackexchange.com/questions/11477/what-are-the-allowed-group-names-for-groupadd

drybjed commented 7 years ago

Just tried this on a Debian Jessie container:

root@host:~# groupadd 'one two'
groupadd: 'one two' is not a valid group name

So, how did you manage to do it? LDAP/NIS?

zpfvo commented 7 years ago

Apparently. Not that i think its a good idea. But somehow our Admin did :collision: LDAP.

drybjed commented 7 years ago

I suppose that using a numerical value for these should work, I would just like another pair of eyes to look at it. @ypid, any issues that could show up?

zpfvo commented 7 years ago

@ypid yes, with pleasure. after lunch break :-)

drybjed commented 7 years ago

@zpfvo Great. Could you add a Changelog entry as well?

zpfvo commented 7 years ago

@drybjed done. hope i did the formatting right