From: Christos Zoulas Date: Thu, 27 Nov 2014 16:15:06 +0000 (+0000) Subject: Document changes X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73461d64a898ed627895d156c825ce0be256343b;p=file Document changes --- diff --git a/ChangeLog b/ChangeLog index 4d654806..e326bf31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-11-27 11:12 Christos Zoulas + + * Adjust ELF parameters and the default recursion + level. + * Allow setting the recursion level dynamically. + 2014-11-24 8:55 Christos Zoulas * The following fixes resulted from Thomas Jarosch's fuzzing diff --git a/doc/file.man b/doc/file.man index 361188e1..296cb1f2 100644 --- a/doc/file.man +++ b/doc/file.man @@ -1,5 +1,5 @@ -.\" $File: file.man,v 1.106 2014/03/07 23:11:51 christos Exp $ -.Dd January 30, 2014 +.\" $File: file.man,v 1.107 2014/11/27 16:15:06 christos Exp $ +.Dd November 27, 2014 .Dt FILE __CSECTION__ .Os .Sh NAME @@ -16,6 +16,7 @@ .Op Fl F Ar separator .Op Fl f Ar namefile .Op Fl m Ar magicfiles +.Op Fl R Ar maxrecursion .Ar .Ek .Nm @@ -308,6 +309,11 @@ Don't translate unprintable characters to \eooo. 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 diff --git a/doc/libmagic.man b/doc/libmagic.man index 1c145638..87d9f2ba 100644 --- a/doc/libmagic.man +++ b/doc/libmagic.man @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.29 2014/08/04 06:19:44 christos Exp $ +.\" $File: libmagic.man,v 1.30 2014/11/27 16:15:06 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" 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 @@ -40,6 +40,9 @@ .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 @@ -73,6 +76,10 @@ .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 @@ -268,6 +275,21 @@ not have direct access to the filesystem, but can access the magic 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