aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric <[email protected]>2012-12-28 13:00:34 -0500
committerEric <[email protected]>2012-12-28 13:00:34 -0500
commit3e295e146c960252af0008f1f13a7e40bcbdb929 (patch)
treee53dce219844ffb7e5f588d9b7840d650ad0ffb4 /src
parent39ff3c87aa0d6444e5c3d9ae03538d0f212d81e6 (diff)
downloadrelx-3e295e146c960252af0008f1f13a7e40bcbdb929.tar.gz
relx-3e295e146c960252af0008f1f13a7e40bcbdb929.tar.bz2
relx-3e295e146c960252af0008f1f13a7e40bcbdb929.zip
make sure file permissions are set correctly in overlay template/copy
Diffstat (limited to 'src')
-rw-r--r--src/rcl_prv_overlay.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rcl_prv_overlay.erl b/src/rcl_prv_overlay.erl
index 9670138..b854650 100644
--- a/src/rcl_prv_overlay.erl
+++ b/src/rcl_prv_overlay.erl
@@ -300,6 +300,8 @@ copy_to(State, FromFile0, ToFile0) ->
end,
case ec_file:copy(FromFile1, ToFile2) of
ok ->
+ {ok, FileInfo} = file:read_file_info(FromFile1),
+ ok = file:write_file_info(ToFile2, FileInfo),
ok;
{error, Err} ->
?RCL_ERROR({copy_failed,
@@ -340,6 +342,8 @@ write_template(OverlayVars, FromFile, ToFile) ->
ok ->
case file:write_file(ToFile, IoData) of
ok ->
+ {ok, FileInfo} = file:read_file_info(FromFile),
+ ok = file:write_file_info(ToFile, FileInfo),
ok;
{error, Reason} ->
?RCL_ERROR({unable_to_write, ToFile, Reason})