[PATCH v6] usertools: rewrite pmdinfo

Robin Jarry rjarry at redhat.com
Wed Sep 28 08:51:39 CEST 2022


Bruce Richardson, Sep 26, 2022 at 17:17:
> > * fixed typo: /etc/ld.so.conf/*.conf -> /etc/ld.so.conf.d/*.conf
>
> I am a little uncertain about doing this parsing, and worried it may be a
> bit fragile. The main file for ld.so still is ld.so.conf, which, on my
> system anyway, does indeed just have an include for *.conf in the .d
> directory. However, is it possible that there are systems out there that
> still have entries in ld.so.conf and possibly elsewhere?
>
> I think my preference would still be to shell out to ldconfig and query its
> database, or to shell out to ldd to get the dependencies of a .so from
> there. I just think it may be more robust, but at the cost of running some
> shell commands.
>
> However, I don't feel strongly about this, so if others prefer the
> pure-python ld.so.conf parsing approach better, I'm ok with that.

I was also concerned with parsing ld.so.conf files. However, I did not
find a way to get ldconfig simply to print the folders that are to be
analyzed. This would require some regexp parsing of ldconfig output:

  ldconfig -vNX 2>/dev/null | sed -nre 's,^(/.*): \(from .*\)$,\1,p'

I don't know which way is the least hacky.



More information about the dev mailing list