Skip to content

Commit

Permalink
Sanity check sharepath so we don't panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Monsuwe committed Jun 28, 2024
1 parent 2a1f178 commit c8ab934
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/controllers/helper_cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func writeCloudInit(log logr.Logger, scvmmMachine *infrav1.ScvmmMachine, provide
log.V(1).Info("Writing cloud-init", "sharePath", sharePath)
// Parse share path into hostname, sharename, path
shareParts := strings.Split(sharePath, "\\")
if len(shareParts) < 5 || shareParts[0] != "" || shareParts[1] != "" {
return fmt.Errorf("malformed library share path " + sharePath)
}
host := shareParts[2]
share := shareParts[3]
path := strings.Join(shareParts[4:], "/")
Expand Down

0 comments on commit c8ab934

Please sign in to comment.