GraphicsMagick

- Home
- Project
- Download
- Install
- Source
- News
- Utilities
- Programming
- Reference

# confirm_access

## Access confirmation functions

Contents

- MagickConfirmAccess
- MagickSetConfirmAccessHandler

# MagickConfirmAccess

## Synopsis

    MagickPassFail MagickConfirmAccess( const ConfirmAccessMode mode, const char *path,
                                        ExceptionInfo *exception );

## Description

MagickConfirmAccess() calls the access confirmation handler method with parameters which describe the requested access mode and path/URL, as well as an ExceptionInfo structure to update with any error information. A user-provided callback (set by MagickSetConfirmAccessHandler()) is invoked. If the callback returns MagickFail, then this function also returns MagickFail, which is intended to determine if the operation may continue. The callback is expected to report the reason access is denied by filling out the ExceptionInfo structure. If the callback fails to do so, then a generic "access denied" error is reported.

The format of the MagickConfirmAccess method is:

    MagickPassFail MagickConfirmAccess( const ConfirmAccessMode mode, const char *path,
                                        ExceptionInfo *exception );

mode:
  The type of access to be performed.
path:
  The local path or URL requested to be accessed.
exception:
  Return any errors or warnings in this structure.

# MagickSetConfirmAccessHandler

## Synopsis

    ConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler );

## Description

MagickSetConfirmAccessHandler() sets the access confirmation handler to the specified method and returns the previous access confirmation handler. This access confirmation handler is used to "approve" access to files and URLs. If the handler returns MagickFalse, then access is denied. This mechanism may be used to enforce security policies and/or may be used to monitor file and URL accesses.

The format of the MagickSetConfirmAccessHandler method is:

    ConfirmAccessHandler MagickSetConfirmAccessHandler( ConfirmAccessHandler handler );

A description of each parameter follows:

handler:
  Specifies a pointer to a method to handle access confirmation.

Copyright © GraphicsMagick Group 2002 - 2021