[PATCH] Print cwd path to AT_FDCWD when -y (--decode-fd=path) flag is used

Renaud Métrich rmetrich at redhat.com
Wed Oct 6 18:36:33 UTC 2021


Hi,

This set of patches enables to resolve the AT_FDCWD dirfd, which is very 
useful when syscalls perform an operation on the cwd and relative 
pathname, avoiding the need to search for the pwd, which is sometimes 
just not available.

Also available as a PR: https://github.com/strace/strace/pull/194

The patch is split into 4 pieces for now because I found out that the 
filter on --decode-fds=path isn't used at all in current strace code: 
paths get decoded as soon as --decode-fds=<something> is used.

Since I don't know if this is really the expected behaviour, I kept the 
commits separated in case we just want decoding when --decode-fd=path is 
specified only:

- 0001 only decodes when --decode-fd=path is specified

- 0002 decodes whenever --decode-fd=<something> is specified

The other commits are unit tests.

Renaud.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Check-for-readlink-returning-1-or-PATH_MAX.patch
Type: text/x-patch
Size: 4406 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20211006/1e331cc2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-tests-adjusted-tests-for-AT_FDCWD-decoding.patch
Type: text/x-patch
Size: 16429 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20211006/1e331cc2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Print-path-for-AT_FDCWD-whenever-decode_fd-is-used.patch
Type: text/x-patch
Size: 939 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20211006/1e331cc2/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Print-cwd-path-to-AT_FDCWD-when-y-decode-fd-path-fla.patch
Type: text/x-patch
Size: 1764 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20211006/1e331cc2/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20211006/1e331cc2/attachment-0004.bin>


More information about the Strace-devel mailing list