#ifndef DK4FOPT_H_INCLUDED #define DK4FOPT_H_INCLUDED 1 /** @file dk4fopt.h File open tests. */ #ifndef DK4NUMCO_H_INCLUDED #include "dk4numco.h" #endif /** Skip one ore more security checks when opening files. */ enum { /** Deny write operation if the path does not refer to a regular file. */ DK4_FOPEN_SC_IS_REGULAR = 1, /** Deny write operation if any path component is a symbolic link. Ignored on Windows and on systems without symbolic links. */ DK4_FOPEN_SC_WR_SYMLINK_IN_PATH = 2, /** Deny write operation if the path is a symbolic link (complete path). Ignored on Windows and on systems without symbolic links. */ DK4_FOPEN_SC_WR_PATH_IS_SYMLINK = 4, /** Deny write operation if the path is a symbolic link and the link owner is not the link destination owner. Ignored on Windows, on systems without symbolic links and on systems where the st_uid member of the stat structure has no meaning. */ DK4_FOPEN_SC_WR_SYMLINK_OWNER = 8, /** Apply security checks recommended for non-privileged users. */ DK4_FOPEN_SC_USER = ( DK4_FOPEN_SC_IS_REGULAR | DK4_FOPEN_SC_WR_SYMLINK_OWNER ), /** Apply security checks recommended for privileged users. */ DK4_FOPEN_SC_PRIVILEGED = ( DK4_FOPEN_SC_IS_REGULAR | DK4_FOPEN_SC_WR_SYMLINK_IN_PATH | DK4_FOPEN_SC_WR_PATH_IS_SYMLINK | DK4_FOPEN_SC_WR_SYMLINK_OWNER ), /** Apply all security checks (recommended if process is running with administrative privileges). */ DK4_FOPEN_SC_ALL = INT_MAX }; #endif