From: SourceForge.net <no...@so...> - 2008-08-31 18:30:33
|
Bugs item #2028321, was opened at 2008-07-25 19:16 Message generated for change (Comment added) made by dodil You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1008544&aid=2028321&group_id=209147 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: parseAcl method has a bug Initial Comment: code for finding colons is incorrect. It gets the same colon twice and then considers it a wrong parse private static ArrayList<ACL> parseACLs(String aclString) { ArrayList<ACL> acl; String acls[] = aclString.split(","); acl = new ArrayList<ACL>(); for (String a : acls) { int firstColon = a.indexOf(':'); int lastColon = a.indexOf(':'); if (firstColon == -1 || lastColon == -1 || firstColon == lastColon) { //HERE**** <- first and last colon indexes are always the same**** System.err .println(a + " does not have the form scheme:id:perm"); continue; } ACL newAcl = new ACL(); newAcl.setId(new Id(a.substring(0, firstColon), a.substring( firstColon + 1, lastColon))); newAcl.setPerms(getPermFromString(a.substring(lastColon + 1))); acl.add(newAcl); } return acl; } ---------------------------------------------------------------------- Comment By: Don Pinto (dodil) Date: 2008-08-31 14:30 Message: Logged In: YES user_id=1289601 Originator: NO I already submitted a patch for this in patches section. ---------------------------------------------------------------------- Comment By: Don Pinto (dodil) Date: 2008-08-30 15:06 Message: Logged In: YES user_id=1289601 Originator: NO Is changing lastColon = a.indexOf(":"); to lastColon = a.lastIndexOf(":"); a proper fix ? If so, I can submit a patch for this. --Don Pinto ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-07-25 19:17 Message: Logged In: NO This is in ZooKeeper class. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1008544&aid=2028321&group_id=209147 |