From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 01C123896C02; Tue, 15 Nov 2022 14:25:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01C123896C02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668522346; bh=lJk44IoAiiTr3bB+V9WtO9aSPHWHcyczRX8BLEYpTAA=; h=From:To:Subject:Date:From; b=jv+9P1sQW17peRTqgye3+AEOTI2oMRbBb3uqpByfaD0Pt7F58WseTkaJIJX9Calgg wg0n/rq8B9KeYYGUGmWYudWS4zbjGB4E7DxXuxNEiib2OVNxvHRixpY1NZ2BcJ6obQ 6U/C0O8wfN32DtyHsI3KuY7IKsvNTJi3Fmi6Mo0g= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Normalize gdbserver path name X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 7642de570f32bf901f397c419172cd2ab863ebc6 X-Git-Newrev: bfa50dc8820416dd362b1c59aabd50633b9bbc67 Message-Id: <20221115142546.01C123896C02@sourceware.org> Date: Tue, 15 Nov 2022 14:25:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dbfa50dc88204= 16dd362b1c59aabd50633b9bbc67 commit bfa50dc8820416dd362b1c59aabd50633b9bbc67 Author: Tom de Vries Date: Tue Nov 15 15:24:54 2022 +0100 [gdb/testsuite] Normalize gdbserver path name =20 Currently for the target board remote-gdbserver-on-localhost we use the gdbserver file on build, using a file name which includes "/../". =20 Fix this by using a normalized file name instead. =20 This allows us to be more restrictive about which files REMOTE_TARGET_U= SERNAME can access: ... - remote_exec build "chmod go-rx $objdir/outputs" + remote_exec build "chmod go-rx $objdir" ... =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/boards/gdbserver-base.exp | 3 ++- gdb/testsuite/boards/remote-gdbserver-on-localhost.exp | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/boards/gdbserver-base.exp b/gdb/testsuite/boards= /gdbserver-base.exp index 20ee90d6116..633ac7e2342 100644 --- a/gdb/testsuite/boards/gdbserver-base.exp +++ b/gdb/testsuite/boards/gdbserver-base.exp @@ -22,7 +22,8 @@ process_multilib_options "" set_board_info compiler "[find_gcc]" =20 # Test the copy of gdbserver in the build directory. -set_board_info gdb_server_prog "[pwd]/../../gdbserver/gdbserver" +set_board_info gdb_server_prog \ + "[file normalize [pwd]/../../gdbserver/gdbserver]" =20 # gdbserver does not intercept target file operations and perform them # on the host. diff --git a/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp b/gdb/t= estsuite/boards/remote-gdbserver-on-localhost.exp index 931fba7fa26..af23eaad083 100644 --- a/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp +++ b/gdb/testsuite/boards/remote-gdbserver-on-localhost.exp @@ -42,10 +42,8 @@ if { [board_info $board username] !=3D $env(USER) } { # We're pretending that some local user account is remote target. # Make things a bit more realistic by restricting file permissions. =20 - # Make sure remote target can't see files on build. Note that we're - # currently using $objdir/output instead of $objdir because of gdbserv= er - # being accessed on the target using $objdir/../../gdbserver/gdbserver. - remote_exec build "chmod go-rx $objdir/outputs" + # Make sure remote target can't see files on build. + remote_exec build "chmod go-rx $objdir" =20 # Make sure build can't see files on remote target. We can't use # remote_exec target, because we're in the middle of parsing the