pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
getTablePrivileges empty if table owned by group role
4+ messages / 2 participants
[nested] [flat]

* getTablePrivileges empty if table owned by group role
@ 2011-08-18 09:15 Jonas Sundman <jonas.sundman@thl.fi>
  2011-08-23 12:30 ` Re: getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
  0 siblings, 1 reply; 4+ messages in thread

From: Jonas Sundman @ 2011-08-18 09:15 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

I came across a situation which revealed that getTablePrivileges is not 
returning any grants if a table is owned by a group role, i.e. a role wihout 
login attribute. The connection is opened with superuser priviliges.

This code runs with the latest 8.4 driver (702) agains a 8.4.8 database.

	public static void listprivs() throws SQLException{
		ResultSet rs = con.getMetaData().getTablePrivileges(null, "public", "test");
		int i = 0;
		while (rs.next())
		{
		   System.out.print("grantee: " + rs.getString("GRANTEE"));
		   System.out.println(", privilege: " + rs.getString("PRIVILEGE"));
		   i++;
		}
		System.out.println("Total: " + i);
	}
	
	public static void main(String[] args) throws ClassNotFoundException, 
SQLException {

		Class.forName("org.postgresql.Driver");
		con = DriverManager.getConnection("jdbc:postgresql://localhost/test",
		"user", "****");
		con.setAutoCommit(true);
		Statement stmt = con.createStatement();

		stmt.executeUpdate("create table test (a int)");
		stmt.executeUpdate("create role test_group");
		stmt.executeUpdate("alter table test owner to test_group");
		System.out.println("Initial case");
		listprivs();
		stmt.executeUpdate("alter role test_group login");
		System.out.println("login attribute set");
		listprivs();
		stmt.executeUpdate("drop table test");
		stmt.executeUpdate("drop role test_group");		
	}
}

Output:

Initial case
Total: 0
Group with login
grantee: test_group, privilege: DELETE
grantee: test_group, privilege: INSERT
grantee: test_group, privilege: REFERENCES
grantee: test_group, privilege: RULE
grantee: test_group, privilege: SELECT
grantee: test_group, privilege: TRIGGER
grantee: test_group, privilege: UPDATE
Total: 7

To my understanding, the result should be the same in both cases. The result is 
the same even if there are explicit grants on the table to some other role.

Regards,

Jonas Sundman




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: getTablePrivileges empty if table owned by group role
  2011-08-18 09:15 getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
@ 2011-08-23 12:30 ` Jonas Sundman <jonas.sundman@thl.fi>
  2011-08-23 17:19   ` Re: getTablePrivileges empty if table owned by group role Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Jonas Sundman @ 2011-08-23 12:30 UTC (permalink / raw)
  To: pgsql-jdbc

Hi all,

after some digging and further reading in the todo list I learned that acl 
parsing is known to be uncompatible with versions after 7.3.

I decided to have a look into the code and turned up with a working version of 
the acl parsing, which I would like to share.

To summarize whats in there
	- use rolename instead of username (which corrects the problem which my 
original message refers to)
	- handle the grantor part of the acl
	- handle the grantable attribute
	- use attacl for column permissions.

The patch is against the development version (build 900). I have tested this 
against 8.4.4.

Best regards,

Jonas Sundman

Attachments:

AbstractJdbc2DatabaseMetaData.java.patch (text/x-patch, 6.2K) download 2638,2639c2638,2639 < sql = "SELECT n.nspname,c.relname,r.rolname,a.attacl,a.attname " + < " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r, pg_catalog.pg_attribute a " + --- > sql = "SELECT n.nspname,c.relname,u.usename,c.relacl,a.attname " + > " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_attribute a " + 2641c2641 < " AND c.relowner = r.oid " + --- > " AND u.usesysid = c.relowner " + 2673,2674c2673,2674 < String owner = rs.getString("rolname"); < String acl = rs.getString("attacl"); --- > String owner = rs.getString("usename"); > String acl = rs.getString("relacl"); 2687,2693c2687 < Hashtable grantees = (Hashtable)permissions.get(permNames[i]); < String granteeUsers[] = new String[grantees.size()]; < Enumeration g = grantees.keys(); < int k = 0; < while (g.hasMoreElements()){ < granteeUsers[k++] = (String)g.nextElement(); < } --- > Vector grantees = (Vector)permissions.get(permNames[i]); 2696,2700c2690,2691 < Vector grantor = (Vector)grantees.get(granteeUsers[j]); < String grantee = (String)granteeUsers[j]; < for (int l = 0; l < grantor.size(); l++) { < String[] grants = (String[])grantor.elementAt(l); < String grantable = owner.equals(grantee) ? "YES" : grants[1]; --- > String grantee = (String)grantees.elementAt(j); > String grantable = owner.equals(grantee) ? "YES" : "NO"; 2706c2697 < tuple[4] = connection.encodeString(grants[0]); --- > tuple[4] = connection.encodeString(owner); 2714d2704 < } 2766,2767c2756,2757 < sql = "SELECT n.nspname,c.relname,r.rolname,c.relacl " + < " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r " + --- > sql = "SELECT n.nspname,c.relname,u.usename,c.relacl " + > " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_user u " + 2769c2759 < " AND c.relowner = r.oid " + --- > " AND u.usesysid = c.relowner " + 2795c2785 < String owner = rs.getString("rolname"); --- > String owner = rs.getString("usename"); 2809,2822c2799,2803 < Hashtable grantees = (Hashtable)permissions.get(permNames[i]); < String granteeUsers[] = new String[grantees.size()]; < Enumeration g = grantees.keys(); < int k = 0; < while (g.hasMoreElements()){ < granteeUsers[k++] = (String)g.nextElement(); < } < for (int j = 0; j < granteeUsers.length; j++) < { < Vector grantor = (Vector)grantees.get(granteeUsers[j]); < String grantee = (String)granteeUsers[j]; < for (int l = 0; l < grantor.size(); l++) { < String[] grants = (String[])grantor.elementAt(l); < String grantable = owner.equals(grantee) ? "YES" : grants[1]; --- > Vector grantees = (Vector)permissions.get(permNames[i]); > for (int j = 0; j < grantees.size(); j++) > { > String grantee = (String)grantees.elementAt(j); > String grantable = owner.equals(grantee) ? "YES" : "NO"; 2827c2808 < tuple[3] = connection.encodeString(grants[0]); --- > tuple[3] = connection.encodeString(owner); 2832,2833d2812 < < } 2907d2885 < int slashIndex = acl.lastIndexOf("/"); 2911,2913c2889,2890 < String user = acl.substring(0, equalIndex); < String grantor = null; < if (user.length() == 0) --- > String name = acl.substring(0, equalIndex); > if (name.length() == 0) 2915,2921c2892 < user = "PUBLIC"; < } < if (slashIndex != -1) { < grantor = acl.substring(slashIndex + 1, acl.length()); < } < if (grantor == null) { < grantor = "Default"; --- > name = "PUBLIC"; 2923,2924c2894 < < String privs = acl.substring(equalIndex + 1, slashIndex); --- > String privs = acl.substring(equalIndex + 1); 2928d2897 < if (c != '*') { 2930,2935d2898 < String grantable; < if ( i < privs.length()-1 && privs.charAt(i + 1) == '*') { < grantable = "YES"; < } else { < grantable = "NO"; < } 2979,2987c2942,2945 < < Hashtable usersWithPermission = (Hashtable)privileges.get(sqlpriv); < String[] grant = {grantor, grantable}; < < if (usersWithPermission == null) { < usersWithPermission = new Hashtable(); < Vector permissionByGrantor = new Vector(); < permissionByGrantor.addElement(grant); < usersWithPermission.put(user, permissionByGrantor); --- > Vector usersWithPermission = (Vector)privileges.get(sqlpriv); > if (usersWithPermission == null) > { > usersWithPermission = new Vector(); 2989,2996d2946 < } else { < Vector permissionByGrantor = (Vector)usersWithPermission.get(user); < if (permissionByGrantor == null) { < permissionByGrantor = new Vector(); < permissionByGrantor.addElement(grant); < usersWithPermission.put(user,permissionByGrantor); < } else { < permissionByGrantor.addElement(grant); 2998,3002c2948 < < } < < } < --- > usersWithPermission.addElement(name); 3023c2969 < aclArray = "{" + owner + "=" + perms + "/" + owner + "}"; --- > aclArray = "{" + owner + "=" + perms + "}";
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: getTablePrivileges empty if table owned by group role
  2011-08-18 09:15 getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
  2011-08-23 12:30 ` Re: getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
@ 2011-08-23 17:19   ` Kris Jurka <books@ejurka.com>
  2011-08-25 05:57     ` Re: getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
  0 siblings, 1 reply; 4+ messages in thread

From: Kris Jurka @ 2011-08-23 17:19 UTC (permalink / raw)
  To: Jonas Sundman <jonas.sundman@thl.fi>; +Cc: pgsql-jdbc



On Tue, 23 Aug 2011, Jonas Sundman wrote:

> after some digging and further reading in the todo list I learned that acl
> parsing is known to be uncompatible with versions after 7.3.
> 
> I decided to have a look into the code and turned up with a working 
> version of the acl parsing, which I would like to share.

Great.  Can you resend as a context diff (diff -c), the default format 
isn't really usable.  Also we need to able to support the older ACL 
formats as well.  I haven't read your patch, but my ancient notes say 7.3, 
7.4, and 8.0 all have different formats.  I know you aren't likely to have 
these old versions handy, but can you test with the attached ACL entries 
and ensure they get parsed correctly?

Kris Jurka

Attachments:

ACLs (text/plain, 507B) download 80 {jurka=arwdRxt/jurka,permuser=rw*/jurka} 74 {jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka} 73 {=,jurka=arwdRxt,permuser=rw} with grant option: 80 {jurka=arwdRxt/jurka,permuser=rw*/jurka,grantuser=w/permuser} 74 {jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka,grantuser=w/permuser} groups: 80 {jurka=arwdRxt/jurka,permuser=rw*/jurka,grantuser=w/permuser,"group permgroup=a/jurka"} 74 {jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka,grantuser=w/permuser,"group permgroup=a/jurka"}
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: getTablePrivileges empty if table owned by group role
  2011-08-18 09:15 getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
  2011-08-23 12:30 ` Re: getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
  2011-08-23 17:19   ` Re: getTablePrivileges empty if table owned by group role Kris Jurka <books@ejurka.com>
@ 2011-08-25 05:57     ` Jonas Sundman <jonas.sundman@thl.fi>
  0 siblings, 0 replies; 4+ messages in thread

From: Jonas Sundman @ 2011-08-25 05:57 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

On 2011-08-23 20:19, Kris Jurka wrote:
>
>
> On Tue, 23 Aug 2011, Jonas Sundman wrote:
>
>> after some digging and further reading in the todo list I learned that acl
>> parsing is known to be uncompatible with versions after 7.3.
>>
>> I decided to have a look into the code and turned up with a working
>> version of the acl parsing, which I would like to share.
>
> Great.  Can you resend as a context diff (diff -c), the default format
> isn't really usable.  Also we need to able to support the older ACL
> formats as well.  I haven't read your patch, but my ancient notes say 7.3,
> 7.4, and 8.0 all have different formats.  I know you aren't likely to have
> these old versions handy, but can you test with the attached ACL entries
> and ensure they get parsed correctly?

Thank you for your response, I checked the acl:s, and they all parse correctly. 
The interetation of the acl which consists of just one equals sign is a bit 
unclear to me, for the moment it gives no grants at all.

I tried to follow the style of the original code but it can certainly be much 
more enchanced.

Please find a context diff attached (with some debugging calls in main).

Jonas Sundman

Attachments:

AbstractJdbc2DatabaseMetaData.java.diff (text/x-patch, 14.8K) download *** /home/jsum/devel/postgres/postgresql-jdbc-9.1dev-900.src/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java.orig 2011-08-23 13:04:35.000000000 +0300 --- /home/jsum/devel/postgres/postgresql-jdbc-9.1dev-900.src/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java 2011-08-25 08:56:16.000000000 +0300 *************** *** 11,16 **** --- 11,17 ---- import java.sql.*; import java.util.*; + import org.postgresql.core.*; import org.postgresql.util.PSQLException; import org.postgresql.util.PSQLState; *************** *** 2635,2644 **** String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,c.relname,u.usename,c.relacl,a.attname " + ! " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_attribute a " + " WHERE c.relnamespace = n.oid " + ! " AND u.usesysid = c.relowner " + " AND c.oid = a.attrelid " + " AND c.relkind = 'r' " + " AND a.attnum > 0 AND NOT a.attisdropped "; --- 2636,2645 ---- String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,c.relname,r.rolname,a.attacl,a.attname " + ! " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r, pg_catalog.pg_attribute a " + " WHERE c.relnamespace = n.oid " + ! " AND c.relowner = r.oid " + " AND c.oid = a.attrelid " + " AND c.relkind = 'r' " + " AND a.attnum > 0 AND NOT a.attisdropped "; *************** *** 2670,2677 **** byte schemaName[] = rs.getBytes("nspname"); byte tableName[] = rs.getBytes("relname"); byte column[] = rs.getBytes("attname"); ! String owner = rs.getString("usename"); ! String acl = rs.getString("relacl"); Hashtable permissions = parseACL(acl, owner); String permNames[] = new String[permissions.size()]; Enumeration e = permissions.keys(); --- 2671,2678 ---- byte schemaName[] = rs.getBytes("nspname"); byte tableName[] = rs.getBytes("relname"); byte column[] = rs.getBytes("attname"); ! String owner = rs.getString("rolname"); ! String acl = rs.getString("attacl"); Hashtable permissions = parseACL(acl, owner); String permNames[] = new String[permissions.size()]; Enumeration e = permissions.keys(); *************** *** 2684,2700 **** for (i = 0; i < permNames.length; i++) { byte[] privilege = connection.encodeString(permNames[i]); ! Vector grantees = (Vector)permissions.get(permNames[i]); for (int j = 0; j < grantees.size(); j++) { ! String grantee = (String)grantees.elementAt(j); ! String grantable = owner.equals(grantee) ? "YES" : "NO"; byte[][] tuple = new byte[8][]; tuple[0] = null; tuple[1] = schemaName; tuple[2] = tableName; tuple[3] = column; ! tuple[4] = connection.encodeString(owner); tuple[5] = connection.encodeString(grantee); tuple[6] = privilege; tuple[7] = connection.encodeString(grantable); --- 2685,2710 ---- for (i = 0; i < permNames.length; i++) { byte[] privilege = connection.encodeString(permNames[i]); ! Hashtable grantees = (Hashtable)permissions.get(permNames[i]); ! String granteeUsers[] = new String[grantees.size()]; ! Enumeration g = grantees.keys(); ! int k = 0; ! while (g.hasMoreElements()){ ! granteeUsers[k++] = (String)g.nextElement(); ! } for (int j = 0; j < grantees.size(); j++) { ! Vector grantor = (Vector)grantees.get(granteeUsers[j]); ! String grantee = (String)granteeUsers[j]; ! for (int l = 0; l < grantor.size(); l++) { ! String[] grants = (String[])grantor.elementAt(l); ! String grantable = owner.equals(grantee) ? "YES" : grants[1]; byte[][] tuple = new byte[8][]; tuple[0] = null; tuple[1] = schemaName; tuple[2] = tableName; tuple[3] = column; ! tuple[4] = connection.encodeString(grants[0]); tuple[5] = connection.encodeString(grantee); tuple[6] = privilege; tuple[7] = connection.encodeString(grantable); *************** *** 2702,2707 **** --- 2712,2718 ---- } } } + } rs.close(); return (ResultSet) ((BaseStatement)createMetaDataStatement()).createDriverResultSet(f, v); *************** *** 2753,2762 **** String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,c.relname,u.usename,c.relacl " + ! " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_user u " + " WHERE c.relnamespace = n.oid " + ! " AND u.usesysid = c.relowner " + " AND c.relkind = 'r' "; if (schemaPattern != null && !"".equals(schemaPattern)) { --- 2764,2773 ---- String sql; if (connection.haveMinimumServerVersion("7.3")) { ! sql = "SELECT n.nspname,c.relname,r.rolname,c.relacl " + ! " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class c, pg_catalog.pg_roles r " + " WHERE c.relnamespace = n.oid " + ! " AND c.relowner = r.oid " + " AND c.relkind = 'r' "; if (schemaPattern != null && !"".equals(schemaPattern)) { *************** *** 2782,2788 **** { byte schema[] = rs.getBytes("nspname"); byte table[] = rs.getBytes("relname"); ! String owner = rs.getString("usename"); String acl = rs.getString("relacl"); Hashtable permissions = parseACL(acl, owner); String permNames[] = new String[permissions.size()]; --- 2793,2799 ---- { byte schema[] = rs.getBytes("nspname"); byte table[] = rs.getBytes("relname"); ! String owner = rs.getString("rolname"); String acl = rs.getString("relacl"); Hashtable permissions = parseACL(acl, owner); String permNames[] = new String[permissions.size()]; *************** *** 2796,2815 **** for (i = 0; i < permNames.length; i++) { byte[] privilege = connection.encodeString(permNames[i]); ! Vector grantees = (Vector)permissions.get(permNames[i]); ! for (int j = 0; j < grantees.size(); j++) ! { ! String grantee = (String)grantees.elementAt(j); ! String grantable = owner.equals(grantee) ? "YES" : "NO"; byte[][] tuple = new byte[7][]; tuple[0] = null; tuple[1] = schema; tuple[2] = table; ! tuple[3] = connection.encodeString(owner); tuple[4] = connection.encodeString(grantee); tuple[5] = privilege; tuple[6] = connection.encodeString(grantable); v.addElement(tuple); } } } --- 2807,2840 ---- for (i = 0; i < permNames.length; i++) { byte[] privilege = connection.encodeString(permNames[i]); ! Hashtable grantees = (Hashtable)permissions.get(permNames[i]); ! String granteeUsers[] = new String[grantees.size()]; ! Enumeration g = grantees.keys(); ! int k = 0; ! while (g.hasMoreElements()){ ! granteeUsers[k++] = (String)g.nextElement(); ! } ! for (int j = 0; j < granteeUsers.length; j++) ! { ! Vector grants = (Vector)grantees.get(granteeUsers[j]); ! String grantee = (String)granteeUsers[j]; ! for (int l = 0; l < grants.size(); l++) { ! String[] grantTuple = (String[])grants.elementAt(l); ! // report the owner as grantor if it's missing ! String grantor = grantTuple[0].equals(null) ? owner : grantTuple[0]; ! // owner always has grant privileges ! String grantable = owner.equals(grantee) ? "YES" : grantTuple[1]; byte[][] tuple = new byte[7][]; tuple[0] = null; tuple[1] = schema; tuple[2] = table; ! tuple[3] = connection.encodeString(grantor); tuple[4] = connection.encodeString(grantee); tuple[5] = privilege; tuple[6] = connection.encodeString(grantable); v.addElement(tuple); + + } } } } *************** *** 2883,2901 **** */ private void addACLPrivileges(String acl, Hashtable privileges) { int equalIndex = acl.lastIndexOf("="); if (equalIndex == -1) return; ! String name = acl.substring(0, equalIndex); ! if (name.length() == 0) ! { ! name = "PUBLIC"; } ! String privs = acl.substring(equalIndex + 1); for (int i = 0; i < privs.length(); i++) { char c = privs.charAt(i); String sqlpriv; switch (c) { case 'a': --- 2908,2942 ---- */ private void addACLPrivileges(String acl, Hashtable privileges) { int equalIndex = acl.lastIndexOf("="); + int slashIndex = acl.lastIndexOf("/"); if (equalIndex == -1) return; ! String user = acl.substring(0, equalIndex); ! String grantor = null; ! if (user.length() == 0) ! { ! user = "PUBLIC"; ! } ! String privs; ! if (slashIndex != -1) { ! privs = acl.substring(equalIndex + 1, slashIndex); ! grantor = acl.substring(slashIndex + 1, acl.length()); ! } else { ! privs = acl.substring(equalIndex + 1, acl.length()); } ! for (int i = 0; i < privs.length(); i++) { char c = privs.charAt(i); + if (c != '*') { String sqlpriv; + String grantable; + if ( i < privs.length()-1 && privs.charAt(i + 1) == '*') { + grantable = "YES"; + } else { + grantable = "NO"; + } switch (c) { case 'a': *************** *** 2939,2951 **** default: sqlpriv = "UNKNOWN"; } ! Vector usersWithPermission = (Vector)privileges.get(sqlpriv); ! if (usersWithPermission == null) ! { ! usersWithPermission = new Vector(); privileges.put(sqlpriv, usersWithPermission); } - usersWithPermission.addElement(name); } } --- 2980,3006 ---- default: sqlpriv = "UNKNOWN"; } ! ! Hashtable usersWithPermission = (Hashtable)privileges.get(sqlpriv); ! String[] grant = {grantor, grantable}; ! ! if (usersWithPermission == null) { ! usersWithPermission = new Hashtable(); ! Vector permissionByGrantor = new Vector(); ! permissionByGrantor.addElement(grant); ! usersWithPermission.put(user, permissionByGrantor); privileges.put(sqlpriv, usersWithPermission); + } else { + Vector permissionByGrantor = (Vector)usersWithPermission.get(user); + if (permissionByGrantor == null) { + permissionByGrantor = new Vector(); + permissionByGrantor.addElement(grant); + usersWithPermission.put(user,permissionByGrantor); + } else { + permissionByGrantor.addElement(grant); + } + } } } } *************** *** 2966,2972 **** // 8.4 Added a separate TRUNCATE permission perms = "arwdDxt"; } ! aclArray = "{" + owner + "=" + perms + "}"; } Vector acls = parseACLArray(aclArray); --- 3021,3027 ---- // 8.4 Added a separate TRUNCATE permission perms = "arwdDxt"; } ! aclArray = "{" + owner + "=" + perms + "/" + owner + "}"; } Vector acls = parseACLArray(aclArray); *************** *** 4365,4368 **** --- 4420,4449 ---- return ((AbstractJdbc2Connection)connection).createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_READ_ONLY); } + public void testacl(){ + + } + + public void testacl (String acl) { + System.out.println(acl); + Hashtable permissions = parseACL(acl,"jurka"); + + } + + public static void main (String[] args ){ + AbstractJdbc2Connection _a = null; + AbstractJdbc2DatabaseMetaData a = new AbstractJdbc2DatabaseMetaData(_a) { + }; + Hashtable permissions = null; + String acl = null; + a.testacl("{jurka=arwdRxt/jurka,permuser=rw*/jurka}"); + a.testacl("{jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka}"); + a.testacl("{=,jurka=arwdRxt,permuser=rw}"); + a.testacl("{jurka=arwdRxt/jurka,permuser=rw*/jurka,grantuser=w/permuser}"); + a.testacl("{jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka,grantuser=w/permuser}"); + a.testacl("{jurka=arwdRxt/jurka,permuser=rw*/jurka,grantuser=w/permuser,\"group permgroup=a/jurka\"}"); + a.testacl("{jurka=a*r*w*d*R*x*t*/jurka,permuser=rw*/jurka,grantuser=w/permuser,\"group permgroup=a/jurka\"}"); + + + } }
^ permalink raw reply [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-08-25 05:57 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 09:15 getTablePrivileges empty if table owned by group role Jonas Sundman <jonas.sundman@thl.fi>
2011-08-23 12:30 ` Jonas Sundman <jonas.sundman@thl.fi>
2011-08-23 17:19   ` Kris Jurka <books@ejurka.com>
2011-08-25 05:57     ` Jonas Sundman <jonas.sundman@thl.fi>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox