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
f25b437b
Unverified
Commit
f25b437b
authored
Jan 29, 2021
by
Martin Holst Swende
Committed by
GitHub
Jan 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/clef: don't check file permissions on windows (#22251)
Fixes #20123
parent
7a800f98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
main.go
cmd/clef/main.go
+4
-2
No files found.
cmd/clef/main.go
View file @
f25b437b
...
...
@@ -805,14 +805,16 @@ func readMasterKey(ctx *cli.Context, ui core.UIClientAPI) ([]byte, error) {
// checkFile is a convenience function to check if a file
// * exists
// * is mode 0400
// * is mode 0400
(unix only)
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
()
&
0377
!=
0
{
// However, on windows, we cannot use the unix perm-bits, see
// https://github.com/ethereum/go-ethereum/issues/20123
if
runtime
.
GOOS
!=
"windows"
&&
info
.
Mode
()
.
Perm
()
&
0377
!=
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