This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi all,
Here's a second draft of my rewritten File.toCanonicalPath(). If you
missed my previous email, a working File.toCanonicalPath() is required
in order for FilePermission checks to work properly. GCJ's present
implementation of this has a number of drawbacks, which this patch
fixes.
This patch improves upon my previous one in two ways:
1. Following comments on the Classpath mailing list, storage for
paths is now allocated dynamically.
2. Following comments on this list, the "no-rewind-past-root" check
has been removed.
As before the diff of the method itself is not very legible so I've
attached a copy of it as well as the patch.
One question I forgot to ask last time, concerning the very first line
of the method. Do I need to free path somehow, or will it be GCd?
Cheers,
Gary
2006-04-07 Gary Benson <gbenson@redhat.com>
Partial fix for PR classpath/24895
java/io/natFilePosix.cc (getCanonicalPath): Rewrite.
java/io/File.java (getCanonicalPath): Javadoc fix.
configure.ac: Replace check for realpath with checks for
lstat and readlink.
configure: Rebuilt.
include/config.h.in: Likewise.
Attachment:
patch
Description: Text document
Attachment:
canon.cc
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |