dynamic linker problem

Arne Schwabe arne at rfc2549.org
Fri Feb 13 19:05:37 PST 2004


Kimura Fuyuki <fuyuki at nigredo.org> writes:

> OK, I more clearly point out the problem; run the following test and
> think that behavior is secure/modular/comfortable or not.
>
> BEGIN--cut here--cut here
> #!/bin/sh
>
> cat <<'[EOF]' >crypt.c
> /* Define this function since I want to do so! */
> char *crypt_md5(const char *pw, const char *salt)
> {
> 	return "imbogus";
> }
> [EOF]
>
> cat <<'[EOF]' >dltest.c
> #include <stdio.h>
> #include <dlfcn.h>
>
> int main(void)
> {
> 	void *h;
> 	char *(*crypt)(const char *, const char *);
>
> 	h = dlopen("/lib/libcrypt.so", 0);

At least on my system /lib/libcrypt.so does not even exist, if I
change it to /lib/libcrypt.so.2 it works.

Arne


More information about the freebsd-current mailing list