public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Normalize gdbserver path name
@ 2022-11-15 14:25 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-11-15 14:25 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bfa50dc8820416dd362b1c59aabd50633b9bbc67
commit bfa50dc8820416dd362b1c59aabd50633b9bbc67
Author: Tom de Vries <tdevries@suse.de>
Date: Tue Nov 15 15:24:54 2022 +0100
[gdb/testsuite] Normalize gdbserver path name
Currently for the target board remote-gdbserver-on-localhost we use the
gdbserver file on build, using a file name which includes "/../".
Fix this by using a normalized file name instead.
This allows us to be more restrictive about which files REMOTE_TARGET_USERNAME
can access:
...
- remote_exec build "chmod go-rx $objdir/outputs"
+ remote_exec build "chmod go-rx $objdir"
...
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]"
# 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]"
# 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/testsuite/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] != $env(USER) } {
# We're pretending that some local user account is remote target.
# Make things a bit more realistic by restricting file permissions.
- # Make sure remote target can't see files on build. Note that we're
- # currently using $objdir/output instead of $objdir because of gdbserver
- # 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"
# 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-15 14:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15 14:25 [binutils-gdb] [gdb/testsuite] Normalize gdbserver path name Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).