From patchwork Wed Apr 4 13:03:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 894987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-475822-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="WDR2EuWv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40GR3V1ZxHz9s0n for ; Wed, 4 Apr 2018 23:03:33 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=Bp4142SHh8n4SV3ZUoLhfbaJpRQBLjlpI7hDb5FMCAfC69MtHh DH+JdEF0V36C6tzgibPJRrcO3vGb+11hgYQlv1kGMdg/+QwkJz85+aFbS836T9jv bK/mnyS6a+PR/EZVM66l/V5POKb6kL54VtyZQ5Q0gJjGP0RvzZZfDqnwA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=O8qRgvoStWnnuDjLh8eI9JJSBGw=; b=WDR2EuWvUC+NyhKpebzf A2RN4B1WYqgdyqrNMNNR7FzhbhPKQGFk+rt4ycITOzcyqZjUx2iJLEHI/0KfHldT orAH/HVx+uDhGji4sluDb+rN5RHVPfTWjwiLZ4xPJnCKC23T+fCuQUGjr6fCkw9c FkvqpkVcqyvptVW7oCK5Vh0= Received: (qmail 43362 invoked by alias); 4 Apr 2018 13:03:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 43348 invoked by uid 89); 4 Apr 2018 13:03:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=libgo, Hx-languages-length:1222 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Apr 2018 13:03:19 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 968EEAF73; Wed, 4 Apr 2018 13:03:17 +0000 (UTC) From: Andreas Schwab To: gcc-patches@gcc.gnu.org Cc: Ian Lance Taylor Subject: [PATCH] libgo: Avoid clobbering shell history file in signal_cgo_test.go X-Yow: Where do your SOCKS go when you lose them in th' WASHER? Date: Wed, 04 Apr 2018 15:03:17 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 For some reason signal_cgo_test.go needs to run an interactive shell, but suppresses reading the startup files. This causes the shell history file to be clobbered, by using different history settings than usual. Avoid that by setting HOME to / so that the shell cannot write a history file. * libgo/go/os/signal/signal_cgo_test.go: Set HOME to / before starting shell. --- libgo/go/os/signal/signal_cgo_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/libgo/go/os/signal/signal_cgo_test.go b/libgo/go/os/signal/signal_cgo_test.go index 84a2a08ce9..3c127378d2 100644 --- a/libgo/go/os/signal/signal_cgo_test.go +++ b/libgo/go/os/signal/signal_cgo_test.go @@ -88,6 +88,7 @@ func TestTerminalSignal(t *testing.T) { // Start an interactive shell. ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() + os.Setenv("HOME", "/") cmd := exec.CommandContext(ctx, bash, "--norc", "--noprofile", "-i") cmd.Stdin = slave cmd.Stdout = slave