Skip to content

Commit f510f25

Browse files
feat: update Go to 1.25.6 and fix Claude Code installer execution on noexec /tmp filesystems
- Update GO_VERSION from 1.25.5 to 1.25.6 - Update SHA256 checksums for Go downloads (linux_amd64 and linux_arm64) - Change downloadInstaller() to use /var/tmp instead of /tmp to avoid noexec mount restrictions - Add fallback to os.TempDir() if /var/tmp doesn't exist - Fix installer permissions when running as root for another user (chmod 0755 before su execution) - Add comments explaining noexec workaround an
1 parent e324289 commit f510f25

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ trap 'echo " Installation failed on line $LINENO"; exit 1' ERR
55
log() { echo "[$1] $2"; }
66

77
declare -A GO_CHECKSUMS=(
8-
["linux_amd64"]="9e9b755d63b36acf30c12a9a3fc379243714c1c6d3dd72861da637f336ebb35b"
9-
["linux_arm64"]="b00b694903d126c588c378e72d3545549935d3982635ba3f7a964c9fa23fe3b9"
8+
["linux_amd64"]="f022b6aad78e362bcba9b0b94d09ad58c5a70c6ba3b7582905fababf5fe0181a"
9+
["linux_arm64"]="738ef87d79c34272424ccdf83302b7b0300b8b096ed443896089306117943dd5"
1010
)
1111

1212
GITHUB_CLI_KEY_SHA256="20e0125d6f6e077a9ad46f03371bc26d90b04939fb95170f5a1905099cc6bcc0"
@@ -63,7 +63,7 @@ Eos_BUILD_PATH="$Eos_SRC_DIR/$Eos_BINARY_NAME"
6363
INSTALL_PATH="/usr/local/bin/$Eos_BINARY_NAME"
6464

6565
# Go installation settings
66-
GO_VERSION="1.25.5"
66+
GO_VERSION="1.25.6"
6767
GO_INSTALL_DIR="/usr/local"
6868

6969
# --- Directories ---

pkg/remotecode/install.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,15 @@ func installClaudeCode(rc *eos_io.RuntimeContext, config *Config, result *Instal
541541
}
542542
defer os.Remove(installerPath)
543543

544+
// If running as root but installing for another user, we need to make the
545+
// installer readable by that user. The file is created with 0700 by default.
546+
if config.User != "" && config.User != "root" && os.Geteuid() == 0 {
547+
// Make the installer readable and executable by everyone (it's a temp file)
548+
if err := os.Chmod(installerPath, 0755); err != nil {
549+
logger.Warn("Failed to chmod installer for user access", zap.Error(err))
550+
}
551+
}
552+
544553
installCmd := exec.Command("bash", installerPath)
545554
if config.User != "" && config.User != "root" && os.Geteuid() == 0 {
546555
installCmd = exec.Command("su", "-", config.User, "-c", fmt.Sprintf("bash %s", installerPath))
@@ -714,6 +723,9 @@ func installWindsurf(rc *eos_io.RuntimeContext, config *Config, result *InstallR
714723
// downloadInstaller downloads an installer script to a temp file
715724
// NOTE: This trusts the source URL (Anthropic's infrastructure for Claude Code)
716725
// similar to how users would manually run: curl -fsSL https://claude.ai/install.sh | bash
726+
//
727+
// We use /var/tmp instead of /tmp because /tmp is often mounted with noexec
728+
// for security reasons, which prevents running scripts from there.
717729
func downloadInstaller(url string) (string, error) {
718730
resp, err := http.Get(url)
719731
if err != nil {
@@ -723,7 +735,15 @@ func downloadInstaller(url string) (string, error) {
723735
if resp.StatusCode != http.StatusOK {
724736
return "", fmt.Errorf("failed to download installer: HTTP %d from %s", resp.StatusCode, url)
725737
}
726-
file, err := os.CreateTemp("", "claude-installer-*.sh")
738+
739+
// Use /var/tmp instead of /tmp - /tmp often has noexec mount option
740+
// which prevents script execution. /var/tmp typically allows execution.
741+
tempDir := "/var/tmp"
742+
if _, err := os.Stat(tempDir); os.IsNotExist(err) {
743+
tempDir = os.TempDir() // Fall back to default if /var/tmp doesn't exist
744+
}
745+
746+
file, err := os.CreateTemp(tempDir, "claude-installer-*.sh")
727747
if err != nil {
728748
return "", fmt.Errorf("failed to create temporary installer file: %w", err)
729749
}

0 commit comments

Comments
 (0)