-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sciond socket file mode. #3099
sciond socket file mode. #3099
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @juagargi)
go/sciond/internal/config/sample.go, line 28 at r1 (raw file):
Unix = "/run/shm/sciond/default-unix.sock" # File permissions of both the Reliable and Unix socket files, in octal.
Add (default 0770)
at the end.
go/sciond/internal/config/sample.go, line 29 at r1 (raw file):
# File permissions of both the Reliable and Unix socket files, in octal. SocketFileMode = "0755"
This should contain the default value, so that the test checks that the default and the sample match.
go/sciond/internal/servers/server.go, line 106 at r1 (raw file):
func (srv *Server) listen() (net.Listener, error) { var listener net.Listener var error error
errors are always named err
please also name it like that.
go/sciond/internal/servers/server.go, line 119 at r1 (raw file):
return nil, common.NewBasicError("unknown network", nil, "net", srv.network) } if error == nil {
usually we check the other way around:
if err != nil {
return nil, err
}
if err := os.Chmod(....); err != nil {
....
}
return listener, nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @lukedirtwalker)
go/sciond/internal/config/sample.go, line 28 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
Add
(default 0770)
at the end.
Done.
go/sciond/internal/config/sample.go, line 29 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
This should contain the default value, so that the test checks that the default and the sample match.
Done.
go/sciond/internal/servers/server.go, line 106 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
errors are always named
err
please also name it like that.
Done.
go/sciond/internal/servers/server.go, line 119 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
usually we check the other way around:
if err != nil { return nil, err } if err := os.Chmod(....); err != nil { .... } return listener, nil
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
sciond sets the file mode for both its Reliable and Unix socket files. The file mode comes from the configuration value SocketFileMode, specified in octal as a string.
Use default value in config test. Refactor and comments.
1dcee65
to
96d2697
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
Move the FileMode type to util. Refactor. Use FileMode also in the dispatcher. Relates to scionproto#3099.
Makes the file mode of the socket file configurable. (default 0770) Abstracts the sciond FileMode type into util package and uses it in both configs. Relates to #3099
sciond sets the file mode for both its Reliable and Unix socket files. The file mode comes from the configuration value SocketFileMode, specified in octal as a string. The default is 0770
Makes the file mode of the socket file configurable. (default 0770) Abstracts the sciond FileMode type into util package and uses it in both configs. Relates to scionproto#3099
sciond sets the file mode for both its Reliable and Unix socket files.
The file mode comes from the configuration value SocketFileMode,
specified in octal as a string.
This change is