Document new flags and internal processing of ld.so.conf changes.

This commit is contained in:
thorpej 1997-08-27 06:43:07 +00:00
parent 788dcf907f
commit c46d775b91
2 changed files with 92 additions and 70 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ldconfig.8,v 1.6 1997/01/05 12:07:53 mrg Exp $ .\" $NetBSD: ldconfig.8,v 1.7 1997/08/27 06:43:07 thorpej Exp $
.\" .\"
.\" Copyright (c) 1993,1995 Paul Kranenburg .\" Copyright (c) 1993,1995 Paul Kranenburg
.\" All rights reserved. .\" All rights reserved.
@ -28,7 +28,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd October 3, 1993 .Dd August 24, 1997
.Dt LDCONFIG 8 .Dt LDCONFIG 8
.Os NetBSD .Os NetBSD
.Sh NAME .Sh NAME
@ -36,32 +36,30 @@
.Nd configure the shared library cache .Nd configure the shared library cache
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm ldconfig .Nm ldconfig
.Op Fl mrsv .Op Fl cmrsSv
.Op Ar directory Ar ... .Op Ar directory Ar ...
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
is used to prepare a set of is used to prepare a set of
.Dq hints .Dq hints
for use by the run-time linker for use by the run-time linker
.Xr ld.so .Nm ld.so
to facilitate quick lookup of shared libraries available in multiple to facilitate quick lookup of shared libraries available in multiple
directories. It scans a set of built-in system directories and any directories. By default, it scans a set of built-in system directories,
directories listed in
.Pa /etc/ld.so.conf ,
and any
.Ar directories .Ar directories
specified on the command line (in the given order) looking for shared specified on the command line (in the given order) looking for shared
libraries and stores the results in the file libraries and stores the results in the file
.Xr /var/run/ld.so.hints .Pa /var/run/ld.so.hints
to forestall the overhead that would otherwise result from the to forestall the overhead that would otherwise result from the
directory search operations directory search operations
.Xr ld.so .Nm ld.so
would have to perform to load the required shared libraries. The system would have to perform to load required shared libraries.
reads the file
.Pa /etc/ld.so.conf
as a list of directories to pass to
.Nm
at boot time.
.Pp .Pp
The shared libraries so found will be automatically available for loading The shared libraries so found will be automatically available for loading
if needed by the program being prepared for execution. This obviates the need if needed by the program being prepared for execution. This obviates the need
for storing search paths within the executable. for storing search paths within the executable.
.Pp .Pp
The The
@ -72,59 +70,72 @@ directories where shared libraries might be found.
.Ev LD_LIBRARY_PATH .Ev LD_LIBRARY_PATH
is a is a
.Sq \: .Sq \:
separated list of directory paths which are searched by separated list of directory paths that are searched by
.Xr ld.so .Nm ld.so
when it needs to load a shared library. It can be viewed as the run-time when it needs to load a shared library. It can be viewed as the run-time
equivalent of the equivalent of the
.Fl L .Fl L
switch of switch of
.Xr ld. .Nm ld .
.Pp .Pp
.Nm Ldconfig .Nm
is typically run as part of the boot sequence. is typically run as part of the boot sequence.
.Pp .Pp
The following options are recognized by The following options are recognized by
.Nm ldconfig: .Nm ldconfig :
.Bl -tag -width indent .Bl -tag -width indent
.It Fl c
Do not scan directories listed in
.Pa /etc/ld.so.conf
for shared libraries.
.It Fl m .It Fl m
Merge the result of the scan of the directories given as arguments into Merge the result of the scan of the directories given as arguments into
the existing hints file. The default action is to build the hints file afresh. the existing hints file. The default action is to build the hints file afresh.
.It Fl r .It Fl r
Lists the current contents of Lists the current contents of
.Xr ld.so.hints .Pa ld.so.hints
on the standard output. The hints file will not be modified. on the standard output. The hints file will not be modified.
.It Fl s .It Fl s
Do not scan the built-in system directory Do not scan the built-in system directory
.Pq Dq /usr/lib .Pq Dq /usr/lib ,
nor any directories listed in
.Pa /etc/ld.so.conf
for shared libraries. for shared libraries.
.It Fl S
Do not scan the built-in system directory
.Pq Dq /usr/lib ,
for shared libraries. (Directories listed in
.Pa /etc/ld.so.conf
are still scanned.)
.It Fl v .It Fl v
Switch on verbose mode. Switch on verbose mode.
.Sh Security .Sh Security
Special care must be taken when loading shared libraries into the address Special care must be taken when loading shared libraries into the address
space of space of
.Ev set-user-Id .Ev set-user-Id
programs. Whenever such a program is run, programs. Whenever such a program is run,
.Xr ld.so .Nm ld.so
will only load shared libraries from the will only load shared libraries from the
.Ev ld.so.hints .Pa ld.so.hints
file. In particular, the file. In particular, the
.Ev LD_LIBRARY_PATH .Ev LD_LIBRARY_PATH
is not used to search for libraries. Thus, the role of ldconfig is dual. In is not used to search for libraries. Thus, the role of ldconfig is dual. In
addition to building a set of hints for quick lookup, it also serves to addition to building a set of hints for quick lookup, it also serves to
specify the trusted collection of directories from which shared objects can specify the trusted collection of directories from which shared objects can
be safely loaded. It is presumed that the set of directories specified to be safely loaded. It is presumed that the set of directories specified to
.Nm ldconfig .Nm
are under control of the system's administrator. is under control of the system's administrator.
.Xr ld.so .Nm ld.so
further assists set-user-Id programs by erasing the further assists set-user-Id programs by erasing the
.Ev LD_LIBRARY_PATH .Ev LD_LIBRARY_PATH
from the environment. from the environment.
.Sh FILES .Sh FILES
.Xr /var/run/ld.so.hints , .Pa /var/run/ld.so.hints ,
.Xr /etc/ld.so.conf .Pa /etc/ld.so.conf
.Sh SEE ALSO .Sh SEE ALSO
.Xr ld 1 , .Xr ld 1 ,
.Xr ld.so 1 ,
.Xr ld.so.conf 5 , .Xr ld.so.conf 5 ,
.Xr link 5 .Xr link 5
.Sh HISTORY .Sh HISTORY

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ldconfig.8,v 1.6 1997/01/05 12:07:53 mrg Exp $ .\" $NetBSD: ldconfig.8,v 1.7 1997/08/27 06:43:07 thorpej Exp $
.\" .\"
.\" Copyright (c) 1993,1995 Paul Kranenburg .\" Copyright (c) 1993,1995 Paul Kranenburg
.\" All rights reserved. .\" All rights reserved.
@ -28,7 +28,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd October 3, 1993 .Dd August 24, 1997
.Dt LDCONFIG 8 .Dt LDCONFIG 8
.Os NetBSD .Os NetBSD
.Sh NAME .Sh NAME
@ -36,32 +36,30 @@
.Nd configure the shared library cache .Nd configure the shared library cache
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm ldconfig .Nm ldconfig
.Op Fl mrsv .Op Fl cmrsSv
.Op Ar directory Ar ... .Op Ar directory Ar ...
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
is used to prepare a set of is used to prepare a set of
.Dq hints .Dq hints
for use by the run-time linker for use by the run-time linker
.Xr ld.so .Nm ld.so
to facilitate quick lookup of shared libraries available in multiple to facilitate quick lookup of shared libraries available in multiple
directories. It scans a set of built-in system directories and any directories. By default, it scans a set of built-in system directories,
directories listed in
.Pa /etc/ld.so.conf ,
and any
.Ar directories .Ar directories
specified on the command line (in the given order) looking for shared specified on the command line (in the given order) looking for shared
libraries and stores the results in the file libraries and stores the results in the file
.Xr /var/run/ld.so.hints .Pa /var/run/ld.so.hints
to forestall the overhead that would otherwise result from the to forestall the overhead that would otherwise result from the
directory search operations directory search operations
.Xr ld.so .Nm ld.so
would have to perform to load the required shared libraries. The system would have to perform to load required shared libraries.
reads the file
.Pa /etc/ld.so.conf
as a list of directories to pass to
.Nm
at boot time.
.Pp .Pp
The shared libraries so found will be automatically available for loading The shared libraries so found will be automatically available for loading
if needed by the program being prepared for execution. This obviates the need if needed by the program being prepared for execution. This obviates the need
for storing search paths within the executable. for storing search paths within the executable.
.Pp .Pp
The The
@ -72,59 +70,72 @@ directories where shared libraries might be found.
.Ev LD_LIBRARY_PATH .Ev LD_LIBRARY_PATH
is a is a
.Sq \: .Sq \:
separated list of directory paths which are searched by separated list of directory paths that are searched by
.Xr ld.so .Nm ld.so
when it needs to load a shared library. It can be viewed as the run-time when it needs to load a shared library. It can be viewed as the run-time
equivalent of the equivalent of the
.Fl L .Fl L
switch of switch of
.Xr ld. .Nm ld .
.Pp .Pp
.Nm Ldconfig .Nm
is typically run as part of the boot sequence. is typically run as part of the boot sequence.
.Pp .Pp
The following options are recognized by The following options are recognized by
.Nm ldconfig: .Nm ldconfig :
.Bl -tag -width indent .Bl -tag -width indent
.It Fl c
Do not scan directories listed in
.Pa /etc/ld.so.conf
for shared libraries.
.It Fl m .It Fl m
Merge the result of the scan of the directories given as arguments into Merge the result of the scan of the directories given as arguments into
the existing hints file. The default action is to build the hints file afresh. the existing hints file. The default action is to build the hints file afresh.
.It Fl r .It Fl r
Lists the current contents of Lists the current contents of
.Xr ld.so.hints .Pa ld.so.hints
on the standard output. The hints file will not be modified. on the standard output. The hints file will not be modified.
.It Fl s .It Fl s
Do not scan the built-in system directory Do not scan the built-in system directory
.Pq Dq /usr/lib .Pq Dq /usr/lib ,
nor any directories listed in
.Pa /etc/ld.so.conf
for shared libraries. for shared libraries.
.It Fl S
Do not scan the built-in system directory
.Pq Dq /usr/lib ,
for shared libraries. (Directories listed in
.Pa /etc/ld.so.conf
are still scanned.)
.It Fl v .It Fl v
Switch on verbose mode. Switch on verbose mode.
.Sh Security .Sh Security
Special care must be taken when loading shared libraries into the address Special care must be taken when loading shared libraries into the address
space of space of
.Ev set-user-Id .Ev set-user-Id
programs. Whenever such a program is run, programs. Whenever such a program is run,
.Xr ld.so .Nm ld.so
will only load shared libraries from the will only load shared libraries from the
.Ev ld.so.hints .Pa ld.so.hints
file. In particular, the file. In particular, the
.Ev LD_LIBRARY_PATH .Ev LD_LIBRARY_PATH
is not used to search for libraries. Thus, the role of ldconfig is dual. In is not used to search for libraries. Thus, the role of ldconfig is dual. In
addition to building a set of hints for quick lookup, it also serves to addition to building a set of hints for quick lookup, it also serves to
specify the trusted collection of directories from which shared objects can specify the trusted collection of directories from which shared objects can
be safely loaded. It is presumed that the set of directories specified to be safely loaded. It is presumed that the set of directories specified to
.Nm ldconfig .Nm
are under control of the system's administrator. is under control of the system's administrator.
.Xr ld.so .Nm ld.so
further assists set-user-Id programs by erasing the further assists set-user-Id programs by erasing the
.Ev LD_LIBRARY_PATH .Ev LD_LIBRARY_PATH
from the environment. from the environment.
.Sh FILES .Sh FILES
.Xr /var/run/ld.so.hints , .Pa /var/run/ld.so.hints ,
.Xr /etc/ld.so.conf .Pa /etc/ld.so.conf
.Sh SEE ALSO .Sh SEE ALSO
.Xr ld 1 , .Xr ld 1 ,
.Xr ld.so 1 ,
.Xr ld.so.conf 5 , .Xr ld.so.conf 5 ,
.Xr link 5 .Xr link 5
.Sh HISTORY .Sh HISTORY