Examples of JndiPermission

  • org.apache.naming.core.JndiPermission
    Java SecurityManager Permission class for JNDI name based file resources

    The JndiPermission extends the BasicPermission. The permission name is a full or partial jndi resource name. An * can be used at the end of the name to match all named resources that start with name. There are no actions.

    Example that grants permission to read all JNDI file based resources:

  • permission org.apache.naming.JndiPermission "*";
  • @author Glenn Nielsen @version $Revision: 299222 $ $Date: 2004-02-24 04:02:18 -0500 (Tue, 24 Feb 2004) $
  • org.jboss.as.naming.JndiPermission
    This class represents access to a path in the JNDI tree. A JndiPermission consists of a pathname and a set of actions valid for that pathname.

    Pathname is the pathname of the file or directory granted the specified actions. A pathname that ends in "/*" indicates all the files and directories contained in that directory. A pathname that ends with "/-" indicates (recursively) all files and subdirectories contained in that directory. A pathname consisting of the special token "<<ALL BINDINGS>>" matches any file.

    The actions to be granted are passed to the constructor in an array of {@code Action} instances. The possible actions are "bind", "rebind","unbind", "lookup", "list", "listBindings", and "createSubcontext". Their meaning is defined as follows:

    bind
    Context.bind permission
    rebind
    Context.rebind permission
    unbind
    Context.unbind permission.
    lookup
    Context.lookup permission.
    list
    Context.list permission.
    listBindings
    Context.listBindings permission.
    createSubcontext
    Context.createSubcontext permission.

    Be careful when granting JndiPermissions. Think about the implications of granting read and especially write access to various files and directories. The "<<ALL BINDINGS>>" permission with write action is especially dangerous. This grants permission to write to the entire file system. One thing this effectively allows is replacement of the system binary, including the JVM runtime environment.

    Please note: Code can always read a file from the same directory it's in (or a subdirectory of that directory); it does not need explicit permission to do so. @author Marianne Mueller @author Roland Schemers @author Scott.Stark@jboss.org @version $Revision: 81310 $ @serial exclude @see java.security.Permission @see java.security.Permissions @see java.security.PermissionCollection

  • org.jboss.naming.JndiPermission
    This class represents access to a path in the JNDI tree. A JndiPermission consists of a pathname and a set of actions valid for that pathname.

    Pathname is the pathname of the file or directory granted the specified actions. A pathname that ends in "/*" indicates all the files and directories contained in that directory. A pathname that ends with "/-" indicates (recursively) all files and subdirectories contained in that directory. A pathname consisting of the special token "<<ALL BINDINGS>>" matches any file.

    The actions to be granted are passed to the constructor in a string containing a list of one or more comma-separated keywords. The possible keywords are "bind", "rebind", "unbind", "lookup", "list", "listBindings", and "createSubcontext". Their meaning is defined as follows:

    bind
    Context.bind permission
    rebind
    Context.rebind permission
    unbind
    Context.unbind permission.
    lookup
    Context.lookup permission.
    list
    Context.list permission.
    listBindings
    Context.listBindings permission.
    createSubcontext
    Context.createSubcontext permission.

    The actions string is converted to lowercase before processing.

    Be careful when granting JndiPermissions. Think about the implications of granting read and especially write access to various files and directories. The "<<ALL BINDINGS>>" permission with write action is especially dangerous. This grants permission to write to the entire file system. One thing this effectively allows is replacement of the system binary, including the JVM runtime environment.

    Please note: Code can always read a file from the same directory it's in (or a subdirectory of that directory); it does not need explicit permission to do so. @see java.security.Permission @see java.security.Permissions @see java.security.PermissionCollection @author Marianne Mueller @author Roland Schemers @author Scott.Stark@jboss.org @serial exclude @version $Revision: 81310 $


  • Examples of com.google.gwt.thirdparty.org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

         */
        public void addPermission(String path) {
            if (securityManager != null) {
                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    permission = new JndiPermission(path + "*");
                } else {
                    permission = new FilePermission(path + "-","read");
                }
                addPermission(permission);
            }
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

            super(url);
            if (context == null)
                throw new IllegalArgumentException
                    ("Directory context can't be null");
            if (org.apache.naming.Constants.IS_SECURITY_ENABLED) {
                this.permission = new JndiPermission(url.toString());
      }
            this.context = context;
        }
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

         * @param path file directory path
         */
        public void setPermissions(String path) {
            if( securityManager != null ) {
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    permissionList.add(new JndiPermission(path + "*"));
                } else {
                    permissionList.add(new FilePermission(path + "-","read"));
                }
            }
        }
    View Full Code Here

    Examples of org.apache.naming.JndiPermission

                Permission permission = null;
                if( path.startsWith("jndi:") || path.startsWith("jar:jndi:") ) {
                    if (!path.endsWith("/")) {
                        path = path + "/";
                    }
                    permission = new JndiPermission(path + "*");
                    addPermission(permission);
                } else {
                    if (!path.endsWith(File.separator)) {
                        permission = new FilePermission(path, "read");
                        addPermission(permission);
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.