How get codesource of caller in SecurityManager, change perms based on it?

I want to have a SecurityManager that does something like:
public void checkPermission(Permission perm)
      //Pseudo code
      if ( allowedList.contains( caller_context ) ) return;
      else
            //Pass to another SecurityManager object
            baseSecurityManager.checkPermission( perm );
}If I know what jar file the allowed code was loaded from how would I find out if the calling code's context is the same (from that jar or other jars I "OK" )?

Thanks for taking the time to help me on this! :)
* SecurityManager isn't designed for delegation to another SecurityManager. The variuos check* method may be overriden to allow extra permissions. If you don't delegate to the method that was originally called, you might miss something.I know that normally this is the case but the specs on this require it. :(
* The model is that every frame in the current AccesControlContext (acc) has the required permission. So you need to iterate through and throw when you find an unprivileged frame. This is what AccessControlContext.checkPermission does.Yeah, I was trying to iterate through the classes from getClassContext() but when i call getProtectionDomain(), it starts an endless loop.
* Use AccessController.getContext in preference to SecurityManag.getClassContext.Unfortunately, that doesn't help. You can't get at any of the classes/codesources/protectiondomain in the context. The only thing you can do is ask it if, according to it's internal algorithm, the permission is implied. I can't get any info about the calling class' codesource.
* (Since 1.4,) ProtectionDomain constructed with the four argument constructor are dynamic, and add permissions from the current Policy. This seems like what you want to do.Hmmm, there might be something here, but the problem is I don't think it will work as there will be an installed 3rd party SecurityManager that may or may not even pay attention to that. (I've been pretty surprised at the number of security manager implementations that don't check that stuff and simply return "OK")
* Source for SecurityManager and other classes is in src.zip of the JDK. SecurityManager.checkPermission, uses java.security.AccessController.Yeah, I checked this but it simply goes to native code which checks for info that's only available to Sun's JVm code.
Thanks again!

Similar Messages

  • How get rid of iTunes credit to change countries

    I have only 1.07 Dollars left in my iTunes account and I want to change countries, but it won't let me because of the 1.07 Dollars. Can anyone tell me what I should do?

    Try this:
    http://support.apple.com/kb/HT1311

  • How do I use tether with droid ultra, keep getting message to call verizon. Do Verizon charge or have to somehow change my account?

    How do I use tether with droid ultra, keep getting message to call verizon. Do Verizon charge or have to somehow change my account?

    Verizon Wireless Customer Support wrote:
    Hi there JByrd,
    Let's take a closer look into this. What plan are you currently on? If you are on the More Everything plan, then you shouldn't have to do anything additional. If you are on the Nationwide plan it is an additional $20 a month for 2 GB of data. Let us know what plan you have. Thanks!
    ErinW_VZW
    Follow us on Twitter @VZWSupport
    Hey Erin how about you confirm to Elector and others that you HAVE to pay for tethering on Nationwide plans and that if you are using a 3rd tethering app to bypass paying you are violating the terms of service. They don't seem to believe me.

  • How get recent call back (because of I change password form other device)

    I use iphone 5 and ipad2
    all devices use same apple id
    I change apple id(password) on ipad
    my recent calls in iphone are lost      but  i cant remember one important number
    How get recent call back ?  i sign in my apple id on my iphone too but it not work.

    If you have previously employed Create and delete iPhone, iPad, and iPod touch backups in iTunes - Apple  Support, then restoring using iTunes should do the trick.
    From the above article (emphasis is mine):
    What iTunes backs up
    SNIP
    Contacts* and Contact Favorites. (You should regularly sync your contacts to a computer or cloud service, such as iCloud.)
    SNIP
    *Your contacts are part of the backup to preserve recent calls and favorites lists. To avoid any potential contact data loss, back up your contacts to a supported personal information manager (PIM) or another cloud-based service (such as Gmail or Microsoft Exchange). You can also make a copy of contacts that are in iCloud. Learn about backups in iCloud.
    ÇÇÇ

  • How to get full screen caller pic in ios 7.1

    How to get full screen caller pic in ios 7.1.Please help me

    Haha .. I have seen one million post on this issue since 7.1 was released. Everybody hates it and it is perhaps Apple's stupidest design decision. I, personally, happen to like it ... or not mind it as much either way, I should say.
    But that's not what you asked ... Apple thought it was best for some odd reason to change the full screen pics to an itty bitty circle. As a previous poster said, it cannot be changed. But be sure to go to Apple's feedback website and let them know you are unhappy about it. I sense an iOS 7.1.1 coming out REAL soon!

  • When I get a phone call or text message it will not make the sound. Just vibrate. But the switch is on normal. When I change it to vibrate the volume thing will not show. Nor will my up volume up key work. Is there any way to fix it?

    When I get a phone call or text message it will not make the sound. Just vibrate. But the switch is on normal. When I change it to vibrate the volume thing will not show. Nor will my up volume up key work. Is there any way to fix it?

    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • I recently purchased an external hard drive to back up my iMovies. When I try to open the movies on the backup I get a message "you may not have permission to modify that folder" How do I change permissions on the backup?

    I recently purchased an external hard drive to back up my iMovies. When I try to open the movies on the backup I get a message "you may not have permission to modify that folder" How do I change permissions on the backup?

    Hi
    One Must NEVER move or alter any folders named
    • iMovie Event's - or -
    • iMovie Projects - or - alike
    on DESKTOP/FINDER - Ever ! - ONLY Within the iMovie Program ! else all connections are broken and hard to impossibly to mend !
    but rather do as described here under
    Moving Event's and Project's
    Connection - Either connect one Mac in Target mode to the other via FireWire. Or use an external hard disk !
    (Target-Mode - Start one Mac e.g. laptop - BUT keep T-key down during full up-start - Now a FW-symbol is jumping around the screen and it will work as an external hard disk when connected to the other Mac)
    A. The External Hard Disk - MUST BE - Mac OS Extended (hfs) formatted to work for Video. UNIX/DOS/FAT32/Mac OS Exchange works for most other things but not for Video whatever program is used (iMovie or FinalCut)
    B. Should be a FireWire one as USB/USB2 performs badly to me and especially when filling up
    C. Do never Move or Alter any folder named
    • iMovie Event's - or -
    • iMovie Project's
    on DeskTop/Finder - as this will result in iMovie losing connections to them and repair can be anything from hard to impossibly
    D. Moving and Copying must be done within iMovie application and Events to Events - and - Project's to Project's.
    E. Moving Project's to Event's - Do not work for me - I have to export project as a QuickTime movie then Import this into Events.
    Event's window can show two faces
    Like this
    or like this
    from one hard disk Event - You can move it to the other hard disk
    You can not (at least not me) move Event to Project or other way around only
    Event to Event and Project to Project
    Yours Bengt W

  • Why do all my devices ring when I get an incoming call? How do I turn this off?

    Since my last iphone update (8.1.2), everytime I get an incoming call of any form (regular call, facetime, even sms and imessages), all my other devices (ipad, ipods) ring too at the same time. Its driving me crazy. How to I get rid of that?

    Settings>FaceTime>Cellular Calls = Off
    Cheers,
    GB

  • I a owner and administrator. I can't change any file permissions. Help tells me to 'get info' on a file, them click on the lock icon to enter password. The lock icon is not present on any files I 'get info' on. How can I change permissions

    I attached an external drive to my macbook pro for backup purposes. I found that the device is 'read only' for me. I read that I could change permissions by selecting 'get info' for a item and clicking the lock icon to submit my password. The lock icon is not displayed on any 'info' window for any file on my macbook, much less the attached drive. I am the only user and administrator as far as I know. What steps can I take to change permissions? Thanks. My 1st post.

    How can I tell? The 'get info' window has no lock and under sharing and permissions, on says 'you can only read'. I did a get info on the Macintosh HD and it had a lock on it but said I could only read, for what that it worth.

  • How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes. And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes.
    And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    Are you just asking because you want to know, or do you have a problem you need to solve? I don't know how to write a program, but I think what your are describing is not an unusual thing for a  program to do. The * tells you that changes have been made since the last save, and the program reserves a portion of memory for undo functions. I suppose a coder could tell you how it works, but I don't think it would help an average user to know, but that's just my opinion.

  • I have imported an mp3 to my Library.  I want to keep it as media kind = podcast but no matter how often I change the tag in get info options media kind, the change will not persist.

    I have imported an mp3 to my Library.  I want to keep it as media kind = podcast but no matter how often I change the tag in get info > options > media kind, the change will not persist, and the file remains in my Music list not my Podcast list.

    Resolved in update.

  • When I get a phone call and them want to save the contact, no keyboard comes up to type the name.  How do I fix that?

    When I get a phone call , then want to save the message, no keyboard comes up to type the name.  How do I fix that? 

    You can open the Phone app then tap Recents then the blue 'i" in a blue circle at the right of the number then "Create New Contact" then tap a field such as "First" name and the keyboard should appear.

  • TS3367 My iPad doesn't ring, when I get a FaceTime call. How do I turn on the ringer,...???

    My iPad doesn't ring, when I get a FaceTime call. How do I turn on the ringer,...???

    This is very easy to resolve in 3 easy steps. goto
    1. settings
    2. general
    3. where it says 'Use Side switch to'  you will see two choices
    a) Lock rotation
    b) Mute
    Mute will be ticked if you are not getting a ringtone when someone calls you on Facetime
    Simply Click on 'Lock Rotation'
    Lock Rotation will now be ticked
    Mute will be unticked.
    Facetime calls will now ring your iPad2

  • When i get a phone call i want to activate the led flash - how?

    i would like to activate the led flash when i get a phone call without having the normal ringing tone. But how can i do that?

    Settings>General>Accessibility?

  • How do i get fb video calling back

    how do i get fb video calling back

    See:  After installing OS X Mavericks...: Apple Support Communities
    Message was edited by: arthur

Maybe you are looking for

  • Cannot scroll with 2 fingers

    Having selected all the relevant boxes in system preferences /trackpad /scroll & zoom I still cannot scroll in safari or any other pages... The only way is to click and drag the scrolling bar on the side .... any ideas?

  • Can I connect a (scsi) Syquest EZ Drive(zip discs)?

    I have searched and read the threads available here but am still not sure about what I can do and can't do. I have a new Mac Pro and I have a Syquest EZ Drive (uses 100MG Zip Discs). Is there a way to connect this to the MacPro? It appears to be the

  • Problem with minisap 4.6 installation..Please help..URGENT!!

    Hi, Can somebody help me with this problem? when i start to install the minisap into my windows XP, i encounter this problem. may i know what shoud i put into the field? <img src="http://i35.photobucket.com/albums/d194/keyepvc/minisap1.jpg"> This is

  • {BDB57FF2-798B9-4205-9447-F5FE85F37312} - flash update problem!

    After upgrading to Install Adobe Flash Player Adobe Flash Player version 10.0.32.18 Windows | Internet Explorer 1.87 MB The following pup-up keep on jumping each time I enter to certain certified web pages (newspapers etc.). I OK it (continue) and it

  • My new ipad keeps dropping the wi-fi connection.

    My iPad will stay connected to my home wi-fi for aboout 1/2 hour (or less) and then drop out a few miniutes later it may (or may not) reconnect. It is maddening. I have an Airport extreme and I and I have an airport express literally 4 feet from wher