Vhffs_Nss

[ Serveurs - Vhffs - Nss - Debian - Lenny ]

Vhffs et NSS sous Lenny

Le fichier de configuration de NSS a changé de version sous lenny (de libnss1 à libnss2), j'ai dut le réécrire, je ne sais pas si c'est très juste mais bon ça a l'air de marcher :

connectionstring        = hostaddr=127.0.0.1 dbname=vhffs user=vhffs password=monpass_vhffs connect_timeout=1

# Must return "usernames", 1 column, list
#getgroupmembersbygid    = SELECT username FROM vhffs_shadow WHERE gid = $1
getgroupmembersbygid    = SELECT username FROM vhffs_shadow WHERE uid IN (SELECT uid FROM vhffs_user_group WHERE gid = $1)
#getgroupmembersbygid    = SELECT uid FROM vhffs_user_group WHERE gid = $1
# Must return passwd_name, passwd_passwd, passwd_gecos, passwd_dir, passwd_shell, passwd_uid, passwd_gid
getpwnam        = SELECT username, passwd, username, homedir, shell, uid, gid FROM vhffs_shadow WHERE username = $1
# Must return passwd_name, passwd_passwd, passwd_gecos, passwd_dir, passwd_shell, passwd_uid, passwd_gid
getpwuid        = SELECT username, passwd, username, homedir, shell, uid, gid FROM vhffs_shadow WHERE uid = $1
# All users
allusers        = SELECT username, passwd, username, homedir, shell, uid, gid FROM vhffs_shadow
# Must return group_name, group_passwd, group_gid
getgrnam        = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM vhffs_shadow WHERE uid IN (SELECT uid FROM vhffs_user_group WHERE vhffs_user_group.gid = vhffs_groups.gid)) AS members FROM vhffs_groups WHERE groupname = $1
#getgrnam        = SELECT groupname, passwd, gid, ARRAY(SELECT uid FROM vhffs_user_group WHERE vhffs_user_group.gid = vhffs_groups.gid) AS members FROM vhffs_groups WHERE groupname = $1
# Must return group_name, group_passwd, group_gid
getgrgid        = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM vhffs_shadow WHERE uid IN (SELECT uid FROM vhffs_user_group WHERE vhffs_user_group.gid = vhffs_groups.gid)) AS members FROM vhffs_groups WHERE gid = $1
#getgrgid        = SELECT groupname, passwd, gid, ARRAY(SELECT uid FROM vhffs_user_group WHERE vhffs_user_group.gid = vhffs_groups.gid) AS members FROM vhffs_groups WHERE gid = $1
# Must return gid.  %s MUST appear first for username match in where clause
groups_dyn      = SELECT vhffs_user_group.gid FROM vhffs_shadow JOIN vhffs_user_group USING (uid) where vhffs_shadow.username = $1 and vhffs_user_group.gid <> $2
#groups_dyn       = SELECT ug.gid FROM vhffs_passwd p INNER JOIN vhffs_user_group ug ON ug.uid = p.uid WHERE p.username = '%s' AND ug.gid != %d
allgroups       = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM vhffs_shadow WHERE uid IN (SELECT uid FROM vhffs_user_group WHERE vhffs_user_group.gid = vhffs_groups.gid)) AS members FROM vhffs_groups
#allgroups       = SELECT groupname, passwd, gid, ARRAY(SELECT uid FROM vhffs_user_group WHERE vhffs_user_group.gid = vhffs_groups.gid) AS members FROM vhffs_groups
#allgroups       = SELECT groupname, passwd, gid FROM vhffs_groups

On peut utiliser nscd pour accélérer l'accès à ces bases (l'accès ne se fait plus systèmatiquement).

Ne pas oublier dans ce cas de vider le cache en supprimant les données dans /var/cache/nscd.

Creative Commons License