From f9591fa6e261620ce064e75af46b4575390809a9 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Fri, 17 Mar 2023 11:06:06 -0700 Subject: [PATCH] eth: fix output file permissions in admin_exportChain (#26912) * api: Use 0700 file permissions for ExportChain * change perm to 0644 * Update api.go --------- Co-authored-by: Felix Lange --- eth/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/api.go b/eth/api.go index cd6510ccf9a2..66df927ac641 100644 --- a/eth/api.go +++ b/eth/api.go @@ -161,7 +161,7 @@ func (api *AdminAPI) ExportChain(file string, first *uint64, last *uint64) (bool return false, errors.New("location would overwrite an existing file") } // Make sure we can create the file to export into - out, err := os.OpenFile(file, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm) + out, err := os.OpenFile(file, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) if err != nil { return false, err }