Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
b040b750
Commit
b040b750
authored
Sep 12, 2018
by
YaoZengzeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/clef: fix incorrect file permissions for secrets.dat
Signed-off-by:
YaoZengzeng
<
yaozengzeng@zju.edu.cn
>
parent
2d98099c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
main.go
cmd/clef/main.go
+3
-3
No files found.
cmd/clef/main.go
View file @
b040b750
...
...
@@ -225,7 +225,7 @@ func initializeSecrets(c *cli.Context) error {
if
_
,
err
:=
os
.
Stat
(
location
);
err
==
nil
{
return
fmt
.
Errorf
(
"file %v already exists, will not overwrite"
,
location
)
}
err
=
ioutil
.
WriteFile
(
location
,
masterSeed
,
0
7
00
)
err
=
ioutil
.
WriteFile
(
location
,
masterSeed
,
0
4
00
)
if
err
!=
nil
{
return
err
}
...
...
@@ -540,14 +540,14 @@ func readMasterKey(ctx *cli.Context) ([]byte, error) {
// checkFile is a convenience function to check if a file
// * exists
// * is mode 0
6
00
// * is mode 0
4
00
func
checkFile
(
filename
string
)
error
{
info
,
err
:=
os
.
Stat
(
filename
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed stat on %s: %v"
,
filename
,
err
)
}
// Check the unix permission bits
if
info
.
Mode
()
.
Perm
()
&
077
!=
0
{
if
info
.
Mode
()
.
Perm
()
&
0
3
77
!=
0
{
return
fmt
.
Errorf
(
"file (%v) has insecure file permissions (%v)"
,
filename
,
info
.
Mode
()
.
String
())
}
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment