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
7bb95a9a
Unverified
Commit
7bb95a9a
authored
Sep 14, 2018
by
Martin Holst Swende
Committed by
GitHub
Sep 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17652 from YaoZengzeng/file-permission
cmd/clef: fix incorrect file permissions for secrets.dat
parents
72c820c4
b040b750
Changes
1
Hide 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 @
7bb95a9a
...
...
@@ -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