From 63ecc04cdc530d40ef8f84bf8938d93edffff797 Mon Sep 17 00:00:00 2001 From: RebeccaMahany Date: Tue, 3 Dec 2024 10:53:05 -0500 Subject: [PATCH] Make socket path length shorter for launcher interactive --- pkg/osquery/interactive/interactive.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/osquery/interactive/interactive.go b/pkg/osquery/interactive/interactive.go index cef69dd71..660eabad8 100644 --- a/pkg/osquery/interactive/interactive.go +++ b/pkg/osquery/interactive/interactive.go @@ -31,7 +31,10 @@ func StartProcess(knapsack types.Knapsack, interactiveRootDir string) (*os.Proce return nil, nil, fmt.Errorf("creating root dir for interactive mode: %w", err) } - socketPath := osqueryRuntime.SocketPath(interactiveRootDir, ulid.New()) + // We need a shorter ulid to avoid running into socket path length issues. + socketId := ulid.New() + truncatedSocketId := socketId[len(socketId)-4:] + socketPath := osqueryRuntime.SocketPath(interactiveRootDir, truncatedSocketId) augeasLensesPath := filepath.Join(interactiveRootDir, "augeas-lenses") // only install augeas lenses on non-windows platforms