From 6294c7e8831e828aa22d4dbcdc4f9f3e63e5fce0 Mon Sep 17 00:00:00 2001 From: Martin Kangur Date: Tue, 6 Feb 2018 15:55:20 +0200 Subject: [PATCH] Update application.rb @pgconn is already defined, so lets us it --- lib/pg_ldap_sync/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pg_ldap_sync/application.rb b/lib/pg_ldap_sync/application.rb index c984730..f512e81 100644 --- a/lib/pg_ldap_sync/application.rb +++ b/lib/pg_ldap_sync/application.rb @@ -149,7 +149,7 @@ class Application groups = [] res = pg_exec "SELECT rolname, oid FROM pg_roles WHERE #{pg_groups_conf[:filter]}" res.each do |tuple| - res2 = pg_exec "SELECT pr.rolname FROM pg_auth_members pam JOIN pg_roles pr ON pr.oid=pam.member WHERE pam.roleid=#{PG.escape(tuple[1])}" + res2 = pg_exec "SELECT pr.rolname FROM pg_auth_members pam JOIN pg_roles pr ON pr.oid=pam.member WHERE pam.roleid=#{@pgconn.escape_string(tuple[1])}" member_names = res2.map{|row| row[0] } group = PgRole.new tuple[0], member_names log.info{ "found pg-group: #{group.name.inspect} with members: #{member_names.inspect}"}