freebsd 10.1 上的 libnss-mysql

freebsd 10.1 上的 libnss-mysql

我在 freebsd 10.1 上安装了 libnss-mysql。
除 groups 命令外,一切正常。

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

现在命令“groups 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”应该从 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  

相关内容