+2014-11-27 11:12 Christos Zoulas <christos@zoulas.com>
+
+ * Adjust ELF parameters and the default recursion
+ level.
+ * Allow setting the recursion level dynamically.
+
2014-11-24 8:55 Christos Zoulas <christos@zoulas.com>
* The following fixes resulted from Thomas Jarosch's fuzzing
-.\" $File: file.man,v 1.105 2014/01/31 01:57:00 christos Exp $
-.Dd January 30, 2014
+.\" $File: file.man,v 1.106 2014/03/07 23:11:51 christos Exp $
+.Dd November 27, 2014
.Dt FILE __CSECTION__
.Os
.Sh NAME
.Op Fl F Ar separator
.Op Fl f Ar namefile
.Op Fl m Ar magicfiles
+.Op Fl R Ar maxrecursion
.Ar
.Ek
.Nm
Normally
.Nm
translates unprintable characters to their octal representation.
+.It Fl R , Fl Fl recursion Ar maxlevel
+Set the maximum recursion level for indirect type magic or name/use entry
+invocations.
+The default is
+.Dv 15 .
.It Fl s , Fl Fl special-files
Normally,
.Nm
-.\" $File: libmagic.man,v 1.28 2014/03/02 14:47:16 christos Exp $
+.\" $File: libmagic.man,v 1.29 2014/08/04 06:19:44 christos Exp $
.\"
.\" Copyright (c) Christos Zoulas 2003.
.\" All Rights Reserved.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 4, 2014
+.Dd November 27, 2014
.Dt LIBMAGIC 3
.Os
.Sh NAME
.Nm magic_compile ,
.Nm magic_list ,
.Nm magic_load ,
+.Nm magic_load_buffers ,
+.Nm magic_setparam ,
+.Nm magic_getparam ,
.Nm magic_version
.Nd Magic number recognition library
.Sh LIBRARY
.Ft int
.Fn magic_load_buffers "magic_t cookie" "void **buffers" "size_t *sizes" "size_t nbuffers"
.Ft int
+.Fn magic_getparam "magic_t cookie" "int param" "void *value"
+.Ft int
+.Fn magic_setparam "magic_t cookie" "int param" "const void *value"
+.Ft int
.Fn magic_version "void"
.Sh DESCRIPTION
These functions
database via shared memory or other IPC means.
.Pp
The
+.Fn magic_getparam
+and
+.Fn magic_setparam
+allow getting and setting various limits related to the the magic
+library.
+.Bl -column "MAGIC_PARAM_MAX_RECURSION" "size_t" "Default" -offset indent
+.It Sy "Parameter" Ta Sy "Type" Ta Sy "Default
+.It Li MAGIC_PARAM_MAX_RECURSION Ta size_t Ta 15
+.El
+The
+.Dv MAGIC_PARAM_MAX_RECURSION
+parameter controls how many levels of recursion will be followed for
+indirect magic entries or for name/use calls.
+.Pp
+The
.Fn magic_version
command returns the version number of this library which is compiled into
the shared library using the constant