forked from I2P_Developers/i2p.i2p
Set permissions on directories and files when they are created
This commit is contained in:
@@ -38,6 +38,7 @@ import java.util.Properties;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
|
||||
public class AddressbookBean
|
||||
{
|
||||
@@ -330,7 +331,7 @@ public class AddressbookBean
|
||||
{
|
||||
String filename = properties.getProperty( getBook() + "_addressbook" );
|
||||
|
||||
FileOutputStream fos = new FileOutputStream( ConfigBean.addressbookPrefix + filename );
|
||||
FileOutputStream fos = new SecureFileOutputStream( ConfigBean.addressbookPrefix + filename );
|
||||
addressbook.store( fos, null );
|
||||
try {
|
||||
fos.close();
|
||||
|
||||
@@ -27,13 +27,13 @@ package i2p.susi.dns;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
|
||||
public class ConfigBean implements Serializable {
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ConfigBean implements Serializable {
|
||||
{
|
||||
File file = new File( configFileName );
|
||||
try {
|
||||
PrintWriter out = new PrintWriter( new FileOutputStream( file ) );
|
||||
PrintWriter out = new PrintWriter( new SecureFileOutputStream( file ) );
|
||||
out.print( config );
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
@@ -28,12 +28,13 @@ import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Properties;
|
||||
|
||||
import net.i2p.util.SecureFileOutputStream;
|
||||
|
||||
public class SubscriptionsBean
|
||||
{
|
||||
private String action, fileName, content, serial, lastSerial;
|
||||
@@ -113,7 +114,7 @@ public class SubscriptionsBean
|
||||
{
|
||||
File file = new File( getFileName() );
|
||||
try {
|
||||
PrintWriter out = new PrintWriter( new FileOutputStream( file ) );
|
||||
PrintWriter out = new PrintWriter( new SecureFileOutputStream( file ) );
|
||||
out.print( content );
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
Reference in New Issue
Block a user