我已经在freebsd 10.1上安装了libnss-mysql。
一切工作,除了组命令。
getent group – 好的
# 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
我logging了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
我的命令“组www”应该从libnss-mysql.cfg启动查询“gidsbymem”? 或者我错了。
我的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