From 1778ee840e5bf3478907d8afd0414f3e5ef614dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=CD=A5et=CD=A3e=CD=ABr=20Zuid=CB=A2e=CD=ACm=CD=A8a=CD=AC?= Date: Thu, 14 Jan 2021 13:03:24 +0100 Subject: [PATCH] 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. --- cmd/crowdsec-cli/machines.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crowdsec-cli/machines.go b/cmd/crowdsec-cli/machines.go index e5df01356..81a9754ad 100644 --- a/cmd/crowdsec-cli/machines.go +++ b/cmd/crowdsec-cli/machines.go @@ -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 }