From: Dirk Lemstra Date: Sat, 24 Jun 2017 06:15:15 +0000 (+0200) Subject: Added SetSecurityPolicy to Magick++. X-Git-Tag: 7.0.6-1~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ea98a9f3419e8b34f96da03337c8b3b16102c55;p=imagemagick Added SetSecurityPolicy to Magick++. --- diff --git a/Magick++/lib/Functions.cpp b/Magick++/lib/Functions.cpp index a4da42ef9..1867efce2 100644 --- a/Magick++/lib/Functions.cpp +++ b/Magick++/lib/Functions.cpp @@ -1,7 +1,7 @@ // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2002, 2003 -// Copyright Dirk Lemstra 2014-2015 +// Copyright Dirk Lemstra 2014-2017 // // Simple C++ function wrappers for ImageMagick equivalents // @@ -52,6 +52,18 @@ MagickPPExport void Magick::SetRandomSeed(const unsigned long seed) MagickCore::SetRandomSecretKey(seed); } +MagickPPExport bool Magick::SetSecurityPolicy(const std::string &policy_) +{ + bool + status; + + GetPPException; + status=MagickCore::SetMagickSecurityPolicy(policy_.c_str(), + exceptionInfo) != MagickFalse; + ThrowPPException(false); + return(status); +} + MagickPPExport void Magick::TerminateMagick(void) { if (magick_initialized) diff --git a/Magick++/lib/Magick++/Functions.h b/Magick++/lib/Magick++/Functions.h index 863cab138..68c52fda5 100644 --- a/Magick++/lib/Magick++/Functions.h +++ b/Magick++/lib/Magick++/Functions.h @@ -1,7 +1,7 @@ // This may look like C code, but it is really -*- C++ -*- // // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003 -// Copyright Dirk Lemstra 2014 +// Copyright Dirk Lemstra 2014-2017 // // Simple C++ function wrappers for often used or otherwise // inconvenient ImageMagick equivalents @@ -31,6 +31,9 @@ namespace Magick // Seed a new sequence of pseudo-random numbers MagickPPExport void SetRandomSeed(const unsigned long seed); + // Set the ImageMagick security policy. + MagickPPExport bool SetSecurityPolicy(const std::string &policy_); + // C library initialization routine MagickPPExport void TerminateMagick(); }