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 <fjl@twurst.com>
This commit is contained in:
Darioush Jalali 2023-03-17 11:06:06 -07:00 committed by GitHub
parent 58d0f6440b
commit ee8e83fa5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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") return false, errors.New("location would overwrite an existing file")
} }
// Make sure we can create the file to export into // 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 { if err != nil {
return false, err return false, err
} }