У меня установлен libnss-mysql на freebsd 10.1.
Работает все, кроме команды групп.
группа getent - ок
# getent group
.......
froxlorlocal:*:1003:www <-- data from passwd
vmail:*:2000 <-- data from passwd
test::10000:test,www,froxlorlocal <-- data from mysql
tnetbalt::10001:tnetbalt,www,froxlorlocal <-- data from mysql
getent passwd - хорошо
# getent passwd
...
froxlorlocal:*:9999:9999:User &:/dev/null:/sbin/nologin
vmail:*:2000:2000:User for virtual:/nonexistent:/usr/sbin/nologin
test:x:10000:10000:MySQL User:/usr/home/customers/webs/test/:/bin/false
tnetbalt:x:10001:10001:MySQL User:/usr/home/customers/webs/tnetbalt/:/bin/false
Теперь команда "группы www" должна увидеть: www froxlorlocal test tnetbalt.
Но
# groups www
www froxlorlocal <- here no groups from mysql
Я регистрирую запросы mysql и вижу, что выполняются те же запросы по командам «gettent group» и «groups www»:
150706 17:34:06 29 Connect froxlor@localhost as anonymous on froxlor
29 Query SELECT groupname, '*', gid FROM ftp_groups
29 Query SELECT members FROM ftp_groups WHERE gid='10000'
29 Query SELECT members FROM ftp_groups WHERE gid='10001'
29 Quit
150706 17:34:29 30 Connect froxlor@localhost as anonymous on froxlor
30 Query SELECT groupname, '*', gid FROM ftp_groups
30 Query SELECT members FROM ftp_groups WHERE gid='10000'
30 Query SELECT members FROM ftp_groups WHERE gid='10001'
30 Quit
Я считаю, что по команде "groups www" должен запускаться запрос "gidsbymem" из libnss-mysql.cfg ??? Или я ошибаюсь.
мой libnss-mysql.cfg:
getpwnam SELECT username, '*', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE username='%1$s' AND login_enabled = 'Y' LIMIT 1
getpwuid SELECT username, '*', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE uid='%1$u' AND login_enabled = 'Y' LIMIT 1
getpwent SELECT username, '*', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users
getspnam SELECT username, password, '12345', '0', '99999', '7', '', '-1', '' FROM ftp_users WHERE username='%1$s' LIMIT 1
getspent SELECT username, password, '12345', '0', '99999', '7', '', '-1', '' FROM ftp_users
getgrnam SELECT groupname, '*', gid FROM ftp_groups WHERE groupname='%1$s' LIMIT 1
getgrgid SELECT groupname, '*', gid FROM ftp_groups WHERE gid='%1$u' LIMIT 1
getgrent SELECT groupname, '*', gid FROM ftp_groups
memsbygid SELECT members FROM ftp_groups WHERE gid='%1$u'
gidsbymem SELECT CONCAT_WS(',', gid) as gid FROM ftp_groups WHERE FIND_IN_SET('%1$s', members)
host 127.0.0.1
database froxlor
username froxlor
password xxxxx
port 3306
timeout 10
compress 0