110fe Find installed ports depending on one particular library - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Ports & Packages > Installation and Maintenance of FreeBSD Ports or Packages

Installation and Maintenance of FreeBSD Ports or Packages Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

Reply
 
Thread Tools Display Modes
  #1  
Old May 9th, 2012, 16:07
mecano mecano is offline
Junior Member
 
Join Date: Feb 2009
Location: France
Posts: 89
Thanks: 23
Thanked 7 Times in 5 Posts
Default Find installed ports depending on one particular library

With the OpenSSL security and after updating, one needs to update ports that are depending on libcrypto(3).
Quote:
NOTE: Any third-party applications, including those installed from the FreeBSD ports collection, which are statically linked to libcrypto(3) should be recompiled in order to use the corrected code.
Do you have recipies for doing it automatically? I was thinking of using pkg_info -aI with ldd -v then a grep libcrypto but it looks like pkg_info does not output only package names so you may have to use awk to clean the output. Not a very elegant solution, I'm sure there should be better options.

Last edited by DutchDaemon; May 9th, 2012 at 23:05.
Reply With Quote
  #2  
Old May 9th, 2012, 16:11
kpa kpa is online now
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,018
Thanks: 44
Thanked 468 Times in 398 Posts
Default

Note the wording "which are statically linked to libcrypto(3)". Any port (any binary in fact) that links libcrypto using dynamic linking does not need recompiling unless there's a version bump in the dynamic link library and I don't that the case with this update.

Edit: There have been updates to both the base system libcrypto and the port security/openssl, which one you're using?

Last edited by kpa; May 9th, 2012 at 16:31.
Reply With Quote
The Following User Says Thank You to kpa For This Useful Post:
mecano (May 9th, 2012)
  #3  
Old May 9th, 2012, 16:58
mecano mecano is offline
Junior Member
 
Join Date: Feb 2009
Location: France
Posts: 89
Thanks: 23
Thanked 7 Times in 5 Posts
Default

Thanks to point this out kpa.
I was talking of FreeBSD-SA-12:01.openssl.asc.
The question is still interresting, how to find installed ports that are depending on a library given it name?
Reply With Quote
  #4  
Old May 9th, 2012, 17:10
kpa kpa is online now
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,018
Thanks: 44
Thanked 468 Times in 398 Posts
Default

This is adapted from ldd(1) manual page, it will print out names of ELF binaries in /usr/local/s?bin and and dynamic link libraries the binaries depend on.

# find /usr/local/bin /usr/local/sbin -type f | xargs -n1 file -F ' ' | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A %p\n'


You can then use # pkg_info -W file to figure out to which port a certain file belongs to.

So it becomes something like this:
# find /usr/local/bin /usr/local/sbin /usr/local/libexec -type f | xargs -n1 file -F ' ' | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A\t%p\n' | grep '/lib/libcrypt.so.5$' | cut -f 1 | xargs -n1 pkg_info -W



That's starting to smell like a useful script

Last edited by kpa; May 9th, 2012 at 18:10. Reason: Finetuning the search path for find(1)
Reply With Quote
The Following 2 Users Say Thank You to kpa For This Useful Post:
mecano (May 9th, 2012), wblock@ (May 10th, 2012)
  #5  
Old May 9th, 2012, 17:23
mecano mecano is offline
Junior Member
 
Join Date: Feb 2009
Location: France
Posts: 89
Thanks: 23
Thanked 7 Times in 5 Posts
Default

I have no example part in my ldd(1) manual. Time to jump to FreeBSD 8 I guess. And it works great! Thanks kpa.

What about statically linked libraries in ports as you pointed out? How to find ports that are statically linked to a particular lib?

Last edited by DutchDaemon; May 9th, 2012 at 23:06.
Reply With Quote
  #6  
Old May 9th, 2012, 17:46
kpa kpa is online now
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,018
Thanks: 44
Thanked 468 Times in 398 Posts
Default

That's a tough one, there may not be any real version information that is carried over from the static link library to the linked binary. I would first try to find out if there are any version strings in the static link library with strings(1) that could be used for comparison and then try to find the same strings in the binaries.
Reply With Quote
  #7  
Old May 9th, 2012, 18:30
kpa kpa is online now
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,018
Thanks: 44
Thanked 468 Times in 398 Posts
Default

Note that the above "script" may not be useful for finding out broken dynamic link library dependencies in ports/packages, for that there's a very handy tool pkg_libchk(1) in sysutils/bsdadminscripts.
Reply With Quote
  #8  
Old May 9th, 2012, 22:09
mecano mecano is offline
Junior Member
 
Join Date: Feb 2009
Location: France
Posts: 89
Thanks: 23
Thanked 7 Times in 5 Posts
Default

Thanks kpa for your time and valuable informations will look further these paths.
Reply With Quote
  #9  
Old May 11th, 2012, 03:30
jef jef is offline
Junior Member
 
Join Date: May 2009
Posts: 58
Thanks: 6
Thanked 1 Time in 1 Post
Default

pkg_libchk(1) shaved my butt when I read UPDATING but it didn't indicate that openssl.so was changing revision numbers.

(yes, I'm leaving the typo)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] SSH Library Error: Cannot Find "libkrb.so.10" BinaryMage Installation and Maintenance of FreeBSD Ports or Packages 4 January 22nd, 2012 22:22
[Solved] How to find where Firefox was installed? daringturtle Installation and Maintenance of FreeBSD Ports or Packages 4 June 17th, 2011 12:03
cannot find the library `../zlib/libzlt.la' (or unhandled argument) sneak Installation and Maintenance of FreeBSD Ports or Packages 3 March 15th, 2011 14:52
[Solved] Personally Installed Ports Steve_Laurie Installation and Maintenance of FreeBSD Ports or Packages 9 January 16th, 2011 23:32
[Solved] How to find out which version of KDE and Gnome installed. Lasse Installation and Maintenance of FreeBSD Ports or Packages 1 October 26th, 2010 16:04


All times are GMT +1. The time now is 09:25.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0