From: Michael Koch Date: Wed, 20 Apr 2005 09:02:29 +0000 (+0000) Subject: 2005-04-20 Michael Koch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=65d5bde825927276a7e2b26aaf91f2a97b5855d9;p=gcc.git 2005-04-20 Michael Koch * java/io/FilePermission.java (serialVersionUID): Made private. (ALL_FILES): New constant. (implies): Handle '<>' case. From-SVN: r98447 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 0fb344c9e78..c05188ba810 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2005-04-20 Michael Koch + + * java/io/FilePermission.java + (serialVersionUID): Made private. + (ALL_FILES): New constant. + (implies): Handle '<>' case. + 2005-04-20 Sven de Marothy * gnu/java/awt/peer/gtk/GdkGraphics.java: diff --git a/libjava/java/io/FilePermission.java b/libjava/java/io/FilePermission.java index 9151bf66964..6534cd85ce1 100644 --- a/libjava/java/io/FilePermission.java +++ b/libjava/java/io/FilePermission.java @@ -1,5 +1,5 @@ -/* java.lang.FilePermission - Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc. +/* FilePermission.java -- + Copyright (C) 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -42,11 +42,13 @@ import java.security.Permission; public final class FilePermission extends Permission implements Serializable { - static final long serialVersionUID = 7930732926638008763L; + private static final long serialVersionUID = 7930732926638008763L; private static final String CURRENT_DIRECTORY = System.getProperty("user.dir"); + private static final String ALL_FILES = "<>"; + private boolean readPerm = false; private boolean writePerm = false; private boolean executePerm = false; @@ -200,14 +202,15 @@ public final class FilePermission extends Permission implements Serializable */ public boolean implies(Permission p) { - FilePermission fp; - if (! (p instanceof FilePermission)) return false; - fp = (FilePermission) p; - String f1 = getName(); + + if (f1.equals(ALL_FILES)) + return true; + + FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar)