From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 3iy5KRVrkGWrqC4AWB0awg (envelope-from ) for ; Sat, 30 Dec 2023 14:10:13 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=HkBSvzxl; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ZaCYcQwt; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=HkBSvzxl; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ZaCYcQwt; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8A4B51E0C3; Sat, 30 Dec 2023 14:10:13 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BEF261E092 for ; Sat, 30 Dec 2023 14:10:10 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 09C863858C29 for ; Sat, 30 Dec 2023 19:10:10 +0000 (GMT) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 4ACEB3858CDB for ; Sat, 30 Dec 2023 19:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4ACEB3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4ACEB3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703963387; cv=none; b=wZrwKh8maq9N6E/H1YOQV4jw+1OHDisJMK/kHfVWXHTm4X+0yAX4gD7GqgWulpWc7H5pRpsXSexNut4w7cun0uOVEu3flKjBluwgbalB3OKSOeWI3dpAhcV1mwPSSMPPkiEaba5mOwm83q1+Xs/CDr2XzDgrdf6u1T69vWUca3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703963387; c=relaxed/simple; bh=3qySyEIeNfRJ9pDJEjiHI9jV1NkCHE5y+tlCa0c+nfQ=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=n429Tum/KR83XdW+xb1AvBYzVkq/otk18SNhLn7jWkIxYh3NKJHVvvmQVjDHHg0XB4XQpJiX0Rh2+NhUUnRUEtvWJfoGnwCVzZtLYCoxKM7u5GbRfs88QhN/+F5sQpijhZA2elmy6awV83tHv+wC7IgFDL29iNTk8nGFaInbGMA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1CCA321CD3; Sat, 30 Dec 2023 19:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1703963384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSXpAVjztLVFUt183SjRezqlMsM2gxrkco1oWVrApbA=; b=HkBSvzxlg1BoCvOVlxm7dg7accHCA6hIqgXPXNfi1Cu6kAaM4buMYNxxs4KaZfi1oUUg8F 1sXudnFuL1W0PnsjBRuRFoHp4g/2+oBStJrpirgrv6BJ3t7SgEwb+5JMAqgBTkqcFAUIVJ Tpa2OO6HgCxLu2vNFHz4R08DvMj4l3Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1703963384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSXpAVjztLVFUt183SjRezqlMsM2gxrkco1oWVrApbA=; b=ZaCYcQwtTrs17dYhZwj/UEaCXDCrqYdi3BhijC9FMaVFUjAWlx17UX7DDHrjsbfP7B0Ma6 NB3h9N53uIllNkAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1703963384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSXpAVjztLVFUt183SjRezqlMsM2gxrkco1oWVrApbA=; b=HkBSvzxlg1BoCvOVlxm7dg7accHCA6hIqgXPXNfi1Cu6kAaM4buMYNxxs4KaZfi1oUUg8F 1sXudnFuL1W0PnsjBRuRFoHp4g/2+oBStJrpirgrv6BJ3t7SgEwb+5JMAqgBTkqcFAUIVJ Tpa2OO6HgCxLu2vNFHz4R08DvMj4l3Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1703963384; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSXpAVjztLVFUt183SjRezqlMsM2gxrkco1oWVrApbA=; b=ZaCYcQwtTrs17dYhZwj/UEaCXDCrqYdi3BhijC9FMaVFUjAWlx17UX7DDHrjsbfP7B0Ma6 NB3h9N53uIllNkAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DCA0513782; Sat, 30 Dec 2023 19:09:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id rJ4vNPdqkGXsGAAAD6G6ig (envelope-from ); Sat, 30 Dec 2023 19:09:43 +0000 Message-ID: <65d61012-51d4-4592-96be-0431ccacca88@suse.de> Date: Sat, 30 Dec 2023 20:09:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.base/gdb-index-err.exp for root user Content-Language: en-US To: Lancelot SIX Cc: gdb-patches@sourceware.org References: <20231229063543.10033-1-tdevries@suse.de> <20231230154721.phc7hqhxmn7fkt5i@octopus> From: Tom de Vries In-Reply-To: <20231230154721.phc7hqhxmn7fkt5i@octopus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -4.29 X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[sourceware.org:url,amd.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org On 12/30/23 16:47, Lancelot SIX wrote: > Hi Tom, > > On Fri, Dec 29, 2023 at 07:35:43AM +0100, Tom de Vries wrote: >> When running test-case gdb.base/gdb-index-err.exp in a container as root user, >> I run into: >> ... >> FAIL: gdb.base/gdb-index-err.exp: flag=: \ >> try to write index to a non-writable directory >> FAIL: gdb.base/gdb-index-err.exp: flag=-dwarf-5: \ >> try to write index to a non-writable directory >> ... >> >> The test-case creates a directory without write permissions: >> ... >> $ ls -ald private >> dr-xr-xr-x 2 root root 4096 Dec 29 06:26 private/ >> ... >> but apparently the root user is still able to write in it. >> >> Fix this by making the test unsupported for the root user. >> >> Tested on x86_64-linux. >> >> PR testsuite/31197 >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31197 >> --- >> gdb/testsuite/gdb.base/gdb-index-err.exp | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/gdb/testsuite/gdb.base/gdb-index-err.exp b/gdb/testsuite/gdb.base/gdb-index-err.exp >> index 31f133efbcd..cefd708f5ab 100644 >> --- a/gdb/testsuite/gdb.base/gdb-index-err.exp >> +++ b/gdb/testsuite/gdb.base/gdb-index-err.exp >> @@ -62,9 +62,15 @@ remote_exec host "chmod u-w,g-w ${non_writable_dir}" >> >> # Try to write the index into a non-writable directory. >> foreach_with_prefix flag { "" "-dwarf-5" } { >> + set test "try to write index to a non-writable directory" >> + if { [root_user] } { >> + unsupported $test >> + continue >> + } >> + >> gdb_test "save gdb-index ${flag} ${non_writable_dir}" \ >> "Error while writing index for `[string_to_regexp $binfile]': couldn't open `[string_to_regexp $non_writable_dir]/${gdb_test_file_name}.*': Permission denied\\." \ >> - "try to write index to a non-writable directory" >> + $test >> } >> >> # Create copies of the executable, we will add an index section to >> >> base-commit: a6d0019eb7fcd634e12b7bcc535d5181c47fc82a >> -- >> 2.35.3 >> > > This looks reasonable to me. Thanks for doing this. > > I had a look around because the other places which use root_user > generate XFAILs and not UNSUPPORTED as you do here. I however don’t > think that gdb.base/fileio.exp could use UNSUPPORTED, and it is better > suited for the case you are addressing here, so that LGTM. > Thanks for the review, pushed. [ FWIW, I've looked at the case of gdb.base/fileio.exp, and I suspect it also should use unsupported. The xfail tag is supposed to tag known incorrect behaviour of the environment (say, a compiler bug in generating debug info), and I don't see any there. ] Thanks, - Tom > Best, > Lancelot. > > Reviewed-By: Lancelot SIX >