This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug cli/15145] New: cd and $cwd do not handle symlink/../ correctly


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]