From 0ea98a9f3419e8b34f96da03337c8b3b16102c55 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 24 Jun 2017 08:15:15 +0200 Subject: [PATCH] Added SetSecurityPolicy to Magick++. --- Magick++/lib/Functions.cpp | 14 +++++++++++++- Magick++/lib/Magick++/Functions.h | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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(); } -- 2.40.0