Re: [systemd-devel] nss-systemd

2022-04-05 Thread Lennart Poettering
On Di, 05.04.22 11:24, Gildas Bayard (gildas.bay...@hds.utc.fr) wrote:

> Indeed my systemd is version 245.4-4ubuntu3.15...
>
> How could I know that the minimal required version was 249 (so I don't
> bother you again!)?

Two options:

1. Check https://github.com/systemd/systemd/blob/main/NEWS

2. Check git logs

Lennart

--
Lennart Poettering, Berlin


Re: [systemd-devel] nss-systemd

2022-04-05 Thread Gildas Bayard

Indeed my systemd is version 245.4-4ubuntu3.15...

How could I know that the minimal required version was 249 (so I don't 
bother you again!)?


Le 05/04/2022 à 11:21, Lennart Poettering a écrit :

On Di, 05.04.22 10:30, Gildas Bayard (gildas.bay...@hds.utc.fr) wrote:


Hello,

I'd like to dynamically provide group data when group data is queried by the
system (as in "getent group").

Since nsswitch can use systemd, I've looked at nss-systemd.

As a first step I tried to define a Static Drop-In JSON User Record (because
user definition is documented with more details than group definition).

So I added a toto.user in /etc/userdb/ with this

{
   "userName" : "toto",
   "uid" : 
}
and a .user file pointing to toto.user

But when I run "getent passwd", there's no toto user.

I tried to see a bit what's going on with strace and I see that getent opens
libnss_systemd.so.2 and looks for files in /run/systemd/userdb.

But it's not even trying to read in the directories |etc/userdb/|,
|/run/userdb/|, |/run/host/userdb/| and |/usr/lib/userdb/|

||

Any suggestion?

Maybe your systemd version is simply too old? You need v249 at the
least for the above.

Lennart

--
Lennart Poettering, Berlin

--
*Gildas Bayard*
Ingénieur de Recherche
Responsable Sécurité des Systèmes d'Informations
Coordonnateur pour la Protection du Potentiel Scientifique et Technique
/Télétravail le mercredi/
Laboratoire HEUDIASYC - UMR CNRS 7253 - GI028
UTC Centre de Recherches de Royallieu
BP 20529 - 60205 Compiègne Cedex
Tél. 03 44 23 46 71

Re: [systemd-devel] nss-systemd

2022-04-05 Thread Lennart Poettering
On Di, 05.04.22 10:30, Gildas Bayard (gildas.bay...@hds.utc.fr) wrote:

> Hello,
>
> I'd like to dynamically provide group data when group data is queried by the
> system (as in "getent group").
>
> Since nsswitch can use systemd, I've looked at nss-systemd.
>
> As a first step I tried to define a Static Drop-In JSON User Record (because
> user definition is documented with more details than group definition).
>
> So I added a toto.user in /etc/userdb/ with this
>
> {
>   "userName" : "toto",
>   "uid" : 
> }
> and a .user file pointing to toto.user
>
> But when I run "getent passwd", there's no toto user.
>
> I tried to see a bit what's going on with strace and I see that getent opens
> libnss_systemd.so.2 and looks for files in /run/systemd/userdb.
>
> But it's not even trying to read in the directories |etc/userdb/|,
> |/run/userdb/|, |/run/host/userdb/| and |/usr/lib/userdb/|
>
> ||
>
> Any suggestion?

Maybe your systemd version is simply too old? You need v249 at the
least for the above.

Lennart

--
Lennart Poettering, Berlin