[129924] trunk/base/src/port1.0/porttrace.tcl

Clemens Lang cal at macports.org
Thu Dec 25 09:57:18 PST 2014


On December 25, 2014 3:59:48 PM CET, Mihai Moldovan <ionic at macports.org> wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA512
>
>On 25.12.2014 04:49 AM, Lawrence Velázquez wrote:
>> Originally I was just thinking about reorganizing the code, but after
>> staring at it a bit, I'd suggest something like this. As far as I can
>tell,
>> using `realpath` here obviates both `file normalize` and `file
>> readlink`.
>
>Only that realpath can't be used consistently within tracelib. At least
>not when
>the darwintrace stuff is being injected, neverpanic mentioned potential
>loops
>due to realpath using functions using realpath ...
>
>Thus, src/darwintracelib1.0/darwintrace.c +766 includes a simple
>non-exported
>realpath implementation, which tries to cut down depending on other
>system calls.
>
>It's not guaranteed that both realpath and this dt algorithm return the
>same
>canonical path, though.
>
>I'm not sure how porttrace comes into play, though. Maybe realpath
>there is OK?
>Maybe not?
>
>That's why I originally decided to keep the file normalize stuff and
>add file
>readlink to resolve the last component. Then again, my implementation
>is
>opportunistic only, because it doesn't loop to see if the last
>component is a
>symlink again. It's good enough for stuff like /tmp etc., though.
>
>realpath would alleviate these issues, but I'm really not sure whether
>it can be
>used in porttrace or rather avoided. cal?
>
>
>
>Mihai
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v2
>Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
>iQIcBAEBCgAGBQJUnCZhAAoJEB/WLtluJTqHWooQAMIzCL3cDsUpcSLNHqGxPTd3
>oZ/9aV0rvOE2Dz0bDFNCsfZiqtaZaJIh6b35a/zCm3wtTZgYI5trVuCHCcxUjFMk
>mk3ef44LEqbkFC1vZBt8xLNd3s1eokqcJqjGiHXKsZwqbUJLQqvduBcDtEk2SLhc
>XlMvOX8u4Ra3PaQoni4MQqiQo3vNPLqAbWHhVt74d8IS/XfkBLMnGDCkhkOg5HmE
>0p/GPB6zvnqCZRb/GH2bF4y9IeRzvQrkStGlWo/igFyXIXpPwCAu7+mmALofjpv+
>DfxNWKqz2cHRVHS+j41DIgRMtAkpE/KS8rpyNADO4T0ZdiJG51yY+5odu7orXQ19
>hfS514hY2E+y+y4sxcD6k9XX4x9pPiXVadtLnTFiYEuM+kjdyWFvKzm6OlaecuM7
>mk1rZuJxyo1KS1DGzcjp0F0L/cKspWYo26zpt1VM0zShy+DTaSfRhHeRWsOg1c3F
>KlPsx4SUMnapclAAcadlX2RhDnc1SmPnm6qWNRcxIY2qNVVnKgy4wBtA+XOYhPo2
>PEqzLUMtuSYO2b61jBKDdWlQ17dPLaTHhSVDYV5NF+8OIzyLXdbaQo4zT3j9Jb5d
>XOD2SkyxDyYMjaLARdPqy9UXiUPyyMV3JNFrbpV0nDvPqD+3/+x2dskRnj8wTO3p
>0pkSozLnt1H4lbt2ldpF
>=0ENN
>-----END PGP SIGNATURE-----

It can be used in porttrace.tcl, but there's a chance it behaves different from darwintrace.c's implementation on some paths.
-- 
Clemens Lang


More information about the macports-dev mailing list