Skip to content

Commit 43e8235

Browse files
authored
Merge pull request #2042 from NVIDIA/hook-scratch-dir-path
fix malformed hookscratch dir names
2 parents e06de62 + d854b3a commit 43e8235

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/nvidia-cdi-hook/disable-device-node-modification/params_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
func createParamsFileInContainer(containerRoot *os.Root, contents []byte) error {
3434

35-
hookScratchDirPath := "/run/nvidia-ctk-hook" + uuid.NewString()
35+
hookScratchDirPath := filepath.Join("/run/nvidia-ctk-hook", uuid.NewString())
3636
if err := containerRoot.MkdirAll(hookScratchDirPath[1:], 0755); err != nil {
3737
return fmt.Errorf("error creating hook scratch folder: %w", err)
3838
}

internal/ldconfig/ldconfig_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func mountLdConfig(hostLdconfigPath string, containerRoot *os.Root) (string, err
191191
return "", fmt.Errorf("error reading host ldconfig: %w", err)
192192
}
193193

194-
hookScratchDirPath := "/run/nvidia-ctk-hook/" + uuid.NewString()
194+
hookScratchDirPath := filepath.Join("/run/nvidia-ctk-hook", uuid.NewString())
195195
ldconfigPath := filepath.Join(hookScratchDirPath, "ldconfig")
196196
if err := containerRoot.MkdirAll(hookScratchDirPath[1:], 0755); err != nil {
197197
return "", fmt.Errorf("error creating hook scratch folder: %w", err)

0 commit comments

Comments
 (0)