Invoking ldconfig without arguments wipes all hints and makes me very sad

Roland Smith rsmith at xs4all.nl
Thu Apr 10 20:14:46 UTC 2008


On Thu, Apr 10, 2008 at 02:30:12PM -0500, Shelby Cain wrote:
> Greetings list.  I'm a new user to FreeBSD and I just managed to
> introduce myself to ldconfig's default behavior.  I'm currently locked
> out of my remote server since bash isn't statically compiled and will
> have to get physical access to correct my blunder.  :(

It is unwise to use a port as a root shell. What if /usr or /usr/local is on a
separate partition which isn't mounted in single user mode?

Do you know that there are a lot of statically linked binaries available
in /rescue just for this eventuality? And that there are two shells
amongst them; (t)csh and sh?
 
> As a new user to FreeBSD, ldconfig's default behavior makes about as
> much sense to me as rm adding "-fr ~" or kill adding "-9 1" in the
> absence of arguments.  I hate to sound ignorant but I have to ask, is
> there any particular reason FreeBSD's ldconfig defaults to this
> seemingly unintuitive and non-newbie-safe behavior?
> 
> Would a patch that changes the behavior of ldconfig to assume -r in the
> absence of command line arguments and adds a new parameter like
> -e[rase]|-d[estroy]|-w[ipe]|-z[ap]|-l[olnewbie] to enable the original
> behavior be likely to gain any acceptance?

Can you specify what exactly you mean?

Calling ldconfig without arguments doesn't do anything to the hints
file:

slackbox# ll /var/run/ld-elf.so.hints
-r--r--r--  1 root  wheel  287 Apr  8 19:40 /var/run/ld-elf.so.hints
slackbox# cp /var/run/ld-elf.so.hints /var/run/ld-elf.so.hints.orig
slackbox# ldconfig
slackbox# ll /var/run/ld-elf.so.hints
-r--r--r--  1 root  wheel  287 Apr 10 22:03 /var/run/ld-elf.so.hints
slackbox# diff -u /var/run/ld-elf.so.hints.orig /var/run/ld-elf.so.hints
slackbox# 

So there was no change to the file.

Did you perchance delete the hints file, or unmounted the filesystem
where /var is located?

Roland
-- 
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20080410/4aca525c/attachment.pgp


More information about the freebsd-questions mailing list