Closed Bug 644658 Opened 13 years ago Closed 11 years ago

FileUtils.openSafeFileOutputStream() should accept optional permissions parameter

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: philikon, Unassigned)

Details

Session restore and other components that write sensitive data to the profile directory generally want to create files with 0600 rather than the 0644 that FileUtils defaults to right now. Would be good if openSafeFileOutputStream() would take an optional parameter to set the permissions.
(In reply to comment #0)
> Session restore and other components that write sensitive data to the profile
> directory generally want to create files with 0600 rather than the 0644 that
> FileUtils defaults to right now. Would be good if openSafeFileOutputStream()
> would take an optional parameter to set the permissions.
We should probably split PERMS_FILE into two new constants.
(In reply to comment #1)
> We should probably split PERMS_FILE into two new constants.

Can you elaborate? Also, that seems independent of adding an additional optional parameter to openSafeFileOutputStream, no?
(In reply to comment #2)
> Can you elaborate? Also, that seems independent of adding an additional
> optional parameter to openSafeFileOutputStream, no?
PERMS_FILE is currently read for user, group, and all, write for user and group.  Maybe we don't want to get rid of that one, but the new one would likely be PERMS_USER_FILE which would be rw------- (or 0600).

Might also be handy to just make a function that takes a permission string like that and generates the octal bits.

I think we do want to add the extra optional arg.
We'd like to kill this module (bug 861443), so I don't think we want to extend its feature set.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.