3

I have libnss-mysql installed on a FreeBSD system version 10.1. Everything works except the groups command.

getent group – OK

# 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 – OK

# 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

Now, the command groups www should see: www froxlorlocal test tnetbalt.

But

# groups www
www froxlorlocal      ⟵ here no groups from MySQL

I log MySQL queries and see that they executed the same queries on command gettent group and "roups 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

I think on command groups www should start query gidsbymem from libnss-mysql.cfg??? Or I’m wrong.

My 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

Mantoze
  • 31

0 Answers0