db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r658943 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java
Date Thu, 22 May 2008 00:06:54 GMT
Author: dag
Date: Wed May 21 17:06:54 2008
New Revision: 658943

URL: http://svn.apache.org/viewvc?rev=658943&view=rev
Log:
DERBY-3673 Add checks that a new role isn't already a user authorization id

Patch derby-3673-3.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java?rev=658943&r1=658942&r2=658943&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/IdUtil.java Wed May 21 17:06:54
2008
@@ -269,7 +269,11 @@
 			StringBuffer b = new StringBuffer();
 			b.append("\"");
 			for (int i=0; i < authid.length(); i++) {
-				b.append(authid.charAt(i));
+				char c = authid.charAt(i);
+				if (c == '"') {
+					b.append('"'); // " must be escaped as two quotes ("")
+				}
+				b.append(c);
 			}
 			b.append("\"");
 			result = b.toString();



Mime
View raw message