Jump to content
Froxlor Forum
  • 0

libnss-mysql


hedo

Question

Can you tell me where e is an error of this configuration ?

 

FreeBSD 8.0 i386

 

libnss-mysql-root.cfg

 

username       syscp
password       ****************

 

libnss-mysql.cfg

 


getpwnam SELECT username,'x',uid,gid,username,homedir,shell FROM ftp_users WHERE username='%1$s' LIMIT 1
getpwuid SELECT username,'x',uid,gid,username,homedir,shell FROM ftp_users WHERE uid='%1$u' LIMIT 1
getpwent SELECT username,'x',uid,gid,username,homedir,shell FROM ftp_users
getspnam SELECT username,password,'12345','0','99999','7','','','' FROM ftp_users WHERE username='%1$s' LIMIT 1
getspent SELECT username,password,'12345','0','99999','7','','','' 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 username FROM ftp_users WHERE gid='%1$u'
gidsbymem SELECT gid FROM ftp_users WHERE username='%1$s'

host        127.0.0.1
database    syscp
username    syscp
password    ***************
timeout     10
compress    0

 

nsswitch.conf

 

passwd: files mysql
group: files mysql
#shadow: files mysql

 

Errors to report

 

May 12 10:21:28 eden finger: libnss-mysql: mysql_fetch_row() found 7 rows (expecting 10).
May 12 10:21:31 eden finger: libnss-mysql: mysql_fetch_row() found 7 rows (expecting 10).

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

FreeBSD needs a bit different queries. Freebsd sample configs were found on the official website but adapted to fit Froxlor (hopefully):

 

freebsd/libnss-mysql.cfg

getpwnam    SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' \
           FROM ftp_users \
           WHERE username='%1$s' \
           LIMIT 1
getpwuid    SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' \
           FROM ftp_users \
           WHERE uid='%1$u' \
           LIMIT 1
getpwent    SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' \
           FROM ftp_users

[...rest looks ok...]

 

It would be nice if you'd test these settings and tell us if it worked so we can provide these settings for FreeBSD's libnss-mysql within the upcoming Froxlor version.

 

d00p

Link to comment
Share on other sites

It works thank you :rolleyes:

 

libnss-mysql.cfg

 

getpwnam SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE username='%1$s' LIMIT 1
getpwuid SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE uid='%1$u' LIMIT 1
getpwent SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users
getspnam SELECT username, password, '12345', '0', '99999', '7', '', '', '' FROM ftp_users WHERE username='%1$s' LIMIT 1
getspent SELECT username, password, '12345', '0', '99999', '7', '', '', '' 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 username FROM ftp_users WHERE gid='%1$u'
gidsbymem SELECT gid FROM ftp_users WHERE username='%1$s'

host 127.0.0.1
database froxlor
username froxlor
password **************
port 3306
timeout 10
compress 0

Link to comment
Share on other sites

I'm sorry, I'm not really into FreeBSD, how do we install libnss-mysql there? (so i can add complete config-templates, commands for Froxlor)

Would be nice if you'd answer in the ticket (see link above)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...