[systemd-devel] nss-systemd

Gildas Bayard gildas.bayard at hds.utc.fr
Tue Apr 5 08:30:50 UTC 2022


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" : 7777
}
and a 7777.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?

Sincerely

-- 
*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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20220405/03533575/attachment.htm>


More information about the systemd-devel mailing list