Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 14736 invoked from network); 26 Mar 2007 19:19:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Mar 2007 19:19:54 -0000 Received: (qmail 40979 invoked by uid 500); 26 Mar 2007 19:20:01 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 40955 invoked by uid 500); 26 Mar 2007 19:20:01 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 40946 invoked by uid 99); 26 Mar 2007 19:20:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2007 12:20:01 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2007 12:19:52 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B16C7714068 for ; Mon, 26 Mar 2007 12:19:32 -0700 (PDT) Message-ID: <20122278.1174936772724.JavaMail.jira@brutus> Date: Mon, 26 Mar 2007 12:19:32 -0700 (PDT) From: "Alexei Zakharov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-3479) [classlib][swing][netbeans] TransferHandler.getPasteAction().actionPerformed() doesn't check if accessClipboard is allowed In-Reply-To: <3829170.1174598132301.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexei Zakharov resolved HARMONY-3479. -------------------------------------- Resolution: Fixed Applied at r522601. Thanks Vasya and Andrey! Please verify. > [classlib][swing][netbeans] TransferHandler.getPasteAction().actionPerformed() doesn't check if accessClipboard is allowed > -------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-3479 > URL: https://issues.apache.org/jira/browse/HARMONY-3479 > Project: Harmony > Issue Type: Bug > Components: App-Oriented Bug Reports, Classlib > Reporter: Vasily Zakharov > Assigned To: Alexei Zakharov > Attachments: Harmony-3479-fix.patch, Harmony-3479-make.patch, Harmony-3479-test.patch > > > Consider the following test: > import java.awt.AWTPermission; > import java.awt.event.ActionEvent; > import java.security.Permission; > import javax.swing.Action; > import javax.swing.JPanel; > import javax.swing.TransferHandler; > public class Test { > private static boolean flag = false; > public static void main(String args[]) throws Exception { > System.setSecurityManager(new TestSecurityManager()); > Action action = TransferHandler.getPasteAction(); > ActionEvent event = new ActionEvent(new JPanel(), 0, ""); > System.out.println("Before"); > action.actionPerformed(event); > System.out.println("After"); > System.out.println(flag ? "SUCCESS" : "FAIL"); > } > private static class TestSecurityManager extends SecurityManager { > public void checkPermission(Permission perm) { > if ((perm instanceof AWTPermission) > && "accessClipboard".equals(perm.getName())) { > flag = true; > new Throwable().printStackTrace(); > } > } > } > } > I inserted stack printing to see the stack of calls that leads to security check on RI. > Output on RI: > Before > java.lang.Throwable > at Test$TestSecurityManager.checkPermission(Test.java:27) > at java.lang.SecurityManager.checkSystemClipboardAccess(Unknown Source) > at com.sun.java.swing.SwingUtilities2.canAccessSystemClipboard(Unknown Source) > at javax.swing.TransferHandler$TransferAction.getClipboard(Unknown Source) > at javax.swing.TransferHandler$TransferAction.actionPerformed(Unknown Source) > at Test.main(Test.java:17) > java.lang.Throwable > at Test$TestSecurityManager.checkPermission(Test.java:27) > at java.lang.SecurityManager.checkSystemClipboardAccess(Unknown Source) > at sun.awt.windows.WToolkit.getSystemClipboard(Unknown Source) > at javax.swing.TransferHandler$TransferAction.getClipboard(Unknown Source) > at javax.swing.TransferHandler$TransferAction.actionPerformed(Unknown Source) > at Test.main(Test.java:17) > After > SUCCESS > Output on Harmony: > Before > After > FAIL > The same problem also occurs for getCopyAction() and getCutAction(), probably this is the same problem. > At first look it seems to be a Swing problem, but my guess is the actual problem really lays in the AWT layer. > This issue was discovered while trying to run Netbeans on Harmony. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.