[Bug 406480] [NEW] Example nss-pgsql.conf is incorrect

Juuso Alasuutari juuso.alasuutari at gmail.com
Wed Jul 29 16:29:59 UTC 2009


Public bug reported:

The libnss-pgsql2 package shipped with Ubuntu 9.04 contains an example
config which is flawed. The patch below fixes this.


--- nss-pgsql.conf.old	2009-07-29 18:12:40.000000000 +0300
+++ nss-pgsql.conf	2009-07-29 18:12:54.000000000 +0300
@@ -11,9 +11,9 @@
 # All users
 allusers        = SELECT username, passwd, gecos, homedir, shell, uid, gid FROM passwd_table
 # Must return group_name, group_passwd, group_gid
-getgrnam        = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM usergroups WHERE usergroups.gid = group_table.gid) AS members FROM group_table WHERE groupname = $1
+getgrnam        = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM passwd_table WHERE passwd_table.uid IN (SELECT uid FROM usergroups WHERE usergroups.gid = group_table.gid)) AS members FROM group_table WHERE groupname = $1
 # Must return group_name, group_passwd, group_gid
-getgrgid        = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM usergroups WHERE usergroups.gid = group_table.gid) AS members FROM group_table WHERE gid = $1
+getgrgid        = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM passwd_table WHERE passwd_table.uid IN (SELECT uid FROM usergroups WHERE usergroups.gid = group_table.gid)) AS members FROM group_table WHERE gid = $1
 # Must return gid.  %s MUST appear first for username match in where clause
-groups_dyn      = SELECT ug.gid FROM passwd_table JOIN usergroups USING (uid) where username = $1 and ug.gid <> $2
-allgroups       = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM usergroups WHERE usergroups.gid = group_table.gid) AS members FROM group_table
+groups_dyn      = SELECT usergroups.gid FROM passwd_table JOIN usergroups USING (uid) WHERE username = $1 AND usergroups.gid <> $2
+allgroups       = SELECT groupname, passwd, gid, ARRAY(SELECT username FROM passwd_table WHERE passwd_table.uid IN (SELECT uid FROM usergroups WHERE usergroups.gid = group_table.gid)) AS members FROM group_table

** Affects: libnss-pgsql (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Example nss-pgsql.conf is incorrect
https://bugs.launchpad.net/bugs/406480
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list