/hg/icedtea-web: Make log file permissions owner accessible only.
asu at icedtea.classpath.org
asu at icedtea.classpath.org
Fri Jan 21 13:40:28 PST 2011
changeset a9e67985cb7a in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a9e67985cb7a
author: Andrew Su <asu at redhat.com>
date: Fri Jan 21 16:42:18 2011 -0500
Make log file permissions owner accessible only.
diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
ChangeLog | 5 +++++
netx/net/sourceforge/jnlp/AppletLog.java | 7 +++++--
diffs (41 lines):
diff -r c5b209388b54 -r a9e67985cb7a ChangeLog
--- a/ChangeLog Thu Jan 20 14:54:27 2011 -0500
+++ b/ChangeLog Fri Jan 21 16:42:18 2011 -0500
@@ -1,3 +1,8 @@ 2011-01-20 Andrew Su <asu at redhat.com>
+2011-01-20 Andrew Su <asu at redhat.com>
+
+ * netx/net/sourceforge/jnlp/AppletLog.java: Restrict log files to
+ owner accessible only.
+
2011-01-20 Andrew Su <asu at redhat.com>
Removing dead/commented/unused code.
diff -r c5b209388b54 -r a9e67985cb7a netx/net/sourceforge/jnlp/AppletLog.java
--- a/netx/net/sourceforge/jnlp/AppletLog.java Thu Jan 20 14:54:27 2011 -0500
+++ b/netx/net/sourceforge/jnlp/AppletLog.java Fri Jan 21 16:42:18 2011 -0500
@@ -1,11 +1,14 @@ package net.sourceforge.jnlp;
package net.sourceforge.jnlp;
import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.PrintStream;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.XMLFormatter;
+
+import net.sourceforge.jnlp.util.FileUtils;
/**
* This class writes log information to file.
@@ -20,8 +23,8 @@ class AppletLog extends Log {
// If logging is enabled, we create logger.
if (enableLogging) {
String fn = icedteaLogDir + "plugin" + java.lang.System.currentTimeMillis() + ".log";
- boolean append = false;
- FileHandler fh = new FileHandler(fn, append);
+ FileUtils.createRestrictedFile(new File(fn), true);
+ FileHandler fh = new FileHandler(fn, false);
fh.setFormatter(new XMLFormatter());
String logClassName = AppletLog.class.getName();
logger = Logger.getLogger(logClassName);
More information about the distro-pkg-dev
mailing list