kanidm icon indicating copy to clipboard operation
kanidm copied to clipboard

error: Invalid group content on FreeBSD

Open yonas opened this issue 7 months ago • 6 comments

I did this

service kanidm_unixd enable service kanidm_unixd start

I expected the following

Run without errors.

This happened instead

Jun  5 16:42:34 server1 kanidm_unixd[95447]: 00000000-0000-0000-0000-000000000000 INFO     M-    [info]: Started system provider
Jun  5 16:42:34 server1 kanidm_unixd[95447]: 00000000-0000-0000-0000-000000000000 INFO     M-    [info]: Started kanidm provider
Jun  5 16:42:34 server1 kanidm_unixd[95447]: 00000000-0000-0000-0000-000000000000 WARN     M-^_M-^Z [warn]: Unable to read /etc/shadow, some features will be disabled. | err: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Jun  5 16:42:34 server1 kanidm_unixd[95447]: 00000000-0000-0000-0000-000000000000 ERROR    M-^_M-^Z [error]: Failed to process system id providers | err: "Invalid group content"

Kanidm version details

  • Output of kanidm(d) version: 1.5.0
  • Are you running it in a container? If so, which image/tag?: No
  • If not a container, how'd you install it: pkg install kanidm-server
  • Operating System / Version (On Unix please post the output of uname -a): FreeBSD server1.lan 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64

Any other comments

config: https://github.com/kanidm/kanidm/blob/master/examples/config unixd: https://github.com/kanidm/kanidm/blob/master/examples/unixd

yonas avatar Jun 05 '25 20:06 yonas

We should add support for reading /etc/shadow on FreeBSD:

Jun 5 16:42:34 server1 kanidm_unixd[95447]: 00000000-0000-0000-0000-000000000000 WARN M-^_M-^Z [warn]: Unable to read /etc/shadow, some features will be disabled. | err: Os { code: 2, kind: NotFound, message: "No such file or directory" }

yonas avatar Jun 05 '25 20:06 yonas

It's trying to read /etc/shadow but can't access the file, so that'a a permissions error.

yaleman avatar Jun 06 '25 01:06 yaleman

"Invalid group content" comes from being unable to read /etc/group

yaleman avatar Jun 06 '25 01:06 yaleman

The main difference between /etc/group on FreeBSD and Linux seems to be FreeBSD uses * where Linux uses x:

FreeBSD

# $FreeBSD$                                                                                                                                                                                                   
#                                                                                                                                                                                                             
wheel:*:0:root,yonas,kanidm
daemon:*:1:
kmem:*:2:
sys:*:3:
tty:*:4:
operator:*:5:root

Linux

root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
tty:x:5:
disk:x:6:

yonas avatar Jun 06 '25 13:06 yonas

The issue is actually the comments lines 😄 Raised a PR to handle it.

yaleman avatar Jun 08 '25 06:06 yaleman

@yaleman Thanks!

yonas avatar Jun 08 '25 08:06 yonas

Fixed in 1.7

Firstyear avatar Aug 23 '25 01:08 Firstyear