mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Do not allow corrupted syslog-address
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
aef15ffc5d
commit
b7a6d14bdc
1 changed files with 27 additions and 25 deletions
|
@ -107,7 +107,12 @@ func (s *syslogger) Name() string {
|
|||
}
|
||||
|
||||
func parseAddress(address string) (string, string, error) {
|
||||
if urlutil.IsTransportURL(address) {
|
||||
if address == "" {
|
||||
return "", "", nil
|
||||
}
|
||||
if !urlutil.IsTransportURL(address) {
|
||||
return "", "", fmt.Errorf("syslog-address should be in form proto://address, got %v", address)
|
||||
}
|
||||
url, err := url.Parse(address)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
|
@ -133,9 +138,6 @@ func parseAddress(address string) (string, string, error) {
|
|||
return url.Scheme, host, nil
|
||||
}
|
||||
|
||||
return "", "", nil
|
||||
}
|
||||
|
||||
// ValidateLogOpt looks for syslog specific log options
|
||||
// syslog-address, syslog-facility, & syslog-tag.
|
||||
func ValidateLogOpt(cfg map[string]string) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue