Skip to content

Commit

Permalink
incus-user: Fix bad path
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Oct 9, 2023
1 parent cd9b76c commit 0ff2943
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/incus-user/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/base64"
"fmt"
"os"
"path/filepath"
"strings"

"github.com/lxc/incus/client"
Expand Down Expand Up @@ -168,7 +169,7 @@ func serverSetupUser(uid uint32) error {
revert.Add(func() { _ = os.RemoveAll(userPath) })

// Generate certificate.
err = localtls.FindOrGenCert(internalUtil.VarPath("users", userPath, "client.crt"), internalUtil.VarPath("users", userPath, "client.key"), true, false)
err = localtls.FindOrGenCert(filepath.Join(userPath, "client.crt"), filepath.Join(userPath, "client.key"), true, false)
if err != nil {
return fmt.Errorf("Failed to generate user certificate: %w", err)
}
Expand Down Expand Up @@ -219,7 +220,7 @@ func serverSetupUser(uid uint32) error {
}

// Parse the certificate.
x509Cert, err := localtls.ReadCert(internalUtil.VarPath("users", userPath, "client.crt"))
x509Cert, err := localtls.ReadCert(filepath.Join(userPath, "client.crt"))
if err != nil {
return fmt.Errorf("Unable to read user certificate: %w", err)
}
Expand Down

0 comments on commit 0ff2943

Please sign in to comment.