This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug cli/15145] New: cd and $cwd do not handle symlink/../ correctly
- From: "jan.kratochvil at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 13 Feb 2013 17:44:19 +0000
- Subject: [Bug cli/15145] New: cd and $cwd do not handle symlink/../ correctly
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=15145
Bug #: 15145
Summary: cd and $cwd do not handle symlink/../ correctly
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: cli
AssignedTo: unassigned@sourceware.org
ReportedBy: jan.kratochvil@redhat.com
Classification: Unclassified
cd_command tries to remove "name/../" from the path.
But that is incorrect if "name" is a symlink.
$ mkdir /tmp/{bar,baz,baz/xxx,baz/bar}
$ ln -s baz/xxx /tmp/foo
$ gdb -q -ex 'cd /tmp/foo/../bar' -ex 'path .' -ex r -ex q --args bash -c 'echo
$PATH'
Working directory /tmp/bar
(canonically /tmp/baz/bar).
Starting program: /usr/bin/bash -c echo\ \$PATH
Actual:
/tmp/bar:[...]
Expected:
/tmp/foo/../bar
or
/tmp/baz/bar
As /tmp/bar is a directory never referenced by user above.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.