Sanitize id from either source (#568)

On FreeBSD the uuid has dashes. So moved line 74 outside the if loop to have it sanitize either id source of dashes.
This commit is contained in:
Pͥetͣeͫr Zuidˢeͬmͨaͬ 2021-01-14 13:03:24 +01:00 committed by GitHub
parent b15fc96ef8
commit 1778ee840e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,9 +71,9 @@ func generateID() (string, error) {
return "", errors.Wrap(err, "generating machine id")
}
id = string(bID)
id = strings.ReplaceAll(id, "-", "")[:32]
}
id = fmt.Sprintf("%s%s", id, generatePassword(16))
id = strings.ReplaceAll(id, "-", "")[:32]
return id, nil
}