You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Karl Pauls (JIRA)" <ji...@apache.org> on 2008/03/07 00:46:58 UTC

[jira] Closed: (FELIX-150) Bundle.getResource does not check for AdminPermission, like getResources does.

     [ https://issues.apache.org/jira/browse/FELIX-150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls closed FELIX-150.
----------------------------

    Resolution: Fixed

I did commit this to trunk. Its in as of revision 634459.

> Bundle.getResource does not check for AdminPermission, like getResources does.
> ------------------------------------------------------------------------------
>
>                 Key: FELIX-150
>                 URL: https://issues.apache.org/jira/browse/FELIX-150
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>            Reporter: Olivier Gruber
>            Assignee: Karl Pauls
>            Priority: Minor
>
> Both getResource and getResources on Bundle should return null if the caller does not have the appropriate AdminPermission[this,RESOURCE]
> This is tested in getResources, which is not implemented otherwise, but left unchecked in getResource().
> Missing code (copied from BundleImpl.getResources()):
>         Object sm = System.getSecurityManager();
>         if (sm != null)
>         {
>             try
>             {
>                 ((SecurityManager) sm).checkPermission(new AdminPermission(this,
>                     AdminPermission.RESOURCE));
>             }
>             catch (Exception e)
>             {
>                 return null; // No permission
>             }
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.