From 82958cd8c28f5861b5301248b5cd4a8e57f6d2bb Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Wed, 19 May 2010 05:54:13 +0000 Subject: [PATCH] - check for disabled accounts in libnss-configurations, fixes #237 --- .../misc/configfiles/debian_etch/libnss/etc_nss-mysql.conf | 2 +- .../misc/configfiles/debian_lenny/libnss/etc_nss-mysql.conf | 2 +- .../freebsd/libnss/usr_local_etc_libnss-mysql.cfg | 6 +++--- .../misc/configfiles/gentoo/libnss/etc_libnss-mysql.cfg | 3 +++ .../misc/configfiles/ubuntu_hardy/libnss/etc_nss-mysql.conf | 2 +- .../misc/configfiles/ubuntu_lucid/libnss/etc_nss-mysql.conf | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/templates/misc/configfiles/debian_etch/libnss/etc_nss-mysql.conf b/templates/misc/configfiles/debian_etch/libnss/etc_nss-mysql.conf index 54461bb8..fd427e40 100644 --- a/templates/misc/configfiles/debian_etch/libnss/etc_nss-mysql.conf +++ b/templates/misc/configfiles/debian_etch/libnss/etc_nss-mysql.conf @@ -4,7 +4,7 @@ users.database = ; users.db_user = ; users.db_password = ; users.table = ftp_users u; -users.where_clause =; +users.where_clause = u.login_enabled = 'Y'; users.user_column = u.username; users.password_column = u.password; users.userid_column = u.id; diff --git a/templates/misc/configfiles/debian_lenny/libnss/etc_nss-mysql.conf b/templates/misc/configfiles/debian_lenny/libnss/etc_nss-mysql.conf index 54461bb8..fd427e40 100644 --- a/templates/misc/configfiles/debian_lenny/libnss/etc_nss-mysql.conf +++ b/templates/misc/configfiles/debian_lenny/libnss/etc_nss-mysql.conf @@ -4,7 +4,7 @@ users.database = ; users.db_user = ; users.db_password = ; users.table = ftp_users u; -users.where_clause =; +users.where_clause = u.login_enabled = 'Y'; users.user_column = u.username; users.password_column = u.password; users.userid_column = u.id; diff --git a/templates/misc/configfiles/freebsd/libnss/usr_local_etc_libnss-mysql.cfg b/templates/misc/configfiles/freebsd/libnss/usr_local_etc_libnss-mysql.cfg index 193fa9b1..d6e26292 100644 --- a/templates/misc/configfiles/freebsd/libnss/usr_local_etc_libnss-mysql.cfg +++ b/templates/misc/configfiles/freebsd/libnss/usr_local_etc_libnss-mysql.cfg @@ -1,6 +1,6 @@ -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 +getpwnam SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE username='%1$s' AND login_enabled = 'Y' LIMIT 1 +getpwuid SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE uid='%1$u' AND login_enabled = 'Y' 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 diff --git a/templates/misc/configfiles/gentoo/libnss/etc_libnss-mysql.cfg b/templates/misc/configfiles/gentoo/libnss/etc_libnss-mysql.cfg index d284192c..1cb105b1 100644 --- a/templates/misc/configfiles/gentoo/libnss/etc_libnss-mysql.cfg +++ b/templates/misc/configfiles/gentoo/libnss/etc_libnss-mysql.cfg @@ -1,14 +1,17 @@ getpwnam SELECT username,'x',uid,gid,'MySQL User',homedir,shell \ FROM ftp_users \ WHERE username='%1$s' \ + AND login_enabled = 'Y' \ LIMIT 1 getpwuid SELECT username,'x',uid,gid,'MySQL User',homedir,shell \ FROM ftp_users \ WHERE uid='%1$u' \ + AND login_enabled = 'Y' \ LIMIT 1 getspnam SELECT username,password,UNIX_TIMESTAMP()-10,'1','2','7','-1','-1','0' \ FROM ftp_users \ WHERE username='%1$s' \ + AND login_enabled = 'Y' \ LIMIT 1 getpwent SELECT username,'x',uid,gid,'MySQL User',homedir,shell \ FROM ftp_users diff --git a/templates/misc/configfiles/ubuntu_hardy/libnss/etc_nss-mysql.conf b/templates/misc/configfiles/ubuntu_hardy/libnss/etc_nss-mysql.conf index 54461bb8..fd427e40 100644 --- a/templates/misc/configfiles/ubuntu_hardy/libnss/etc_nss-mysql.conf +++ b/templates/misc/configfiles/ubuntu_hardy/libnss/etc_nss-mysql.conf @@ -4,7 +4,7 @@ users.database = ; users.db_user = ; users.db_password = ; users.table = ftp_users u; -users.where_clause =; +users.where_clause = u.login_enabled = 'Y'; users.user_column = u.username; users.password_column = u.password; users.userid_column = u.id; diff --git a/templates/misc/configfiles/ubuntu_lucid/libnss/etc_nss-mysql.conf b/templates/misc/configfiles/ubuntu_lucid/libnss/etc_nss-mysql.conf index 54461bb8..fd427e40 100644 --- a/templates/misc/configfiles/ubuntu_lucid/libnss/etc_nss-mysql.conf +++ b/templates/misc/configfiles/ubuntu_lucid/libnss/etc_nss-mysql.conf @@ -4,7 +4,7 @@ users.database = ; users.db_user = ; users.db_password = ; users.table = ftp_users u; -users.where_clause =; +users.where_clause = u.login_enabled = 'Y'; users.user_column = u.username; users.password_column = u.password; users.userid_column = u.id;