--- a/jdk/test/java/io/File/SetAccess.java Wed Aug 15 14:35:36 2012 +0100
+++ b/jdk/test/java/io/File/SetAccess.java Wed Aug 15 22:46:35 2012 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
/* @test
@bug 4167472 5097703 6216563 6284003 6728842 6464744
@summary Basic test for setWritable/Readable/Executable methods
+ @build SetAccess Util
+ @run main SetAccess
*/
import java.io.*;
@@ -32,6 +34,11 @@
public class SetAccess {
public static void main(String[] args) throws Exception {
+ if (Util.isPrivileged()) {
+ System.out.println("Unable to test file permissions when running with privileges");
+ return;
+ }
+
File d = new File(System.getProperty("test.dir", "."));
File f = new File(d, "x.SetAccessPermission");