Content-type: text/html
typedef int (*safe_open_pw_callback)(const char *fn);
safe_open_pw_callback safe_open_register_path_warning_callback(safe_open_pw_callback func);
This provides the application with a warning mechanism that an attack on the file name may be occurring. An application may expect to see an occasional false positive depending upon its design, but repeated warnings almost certainly indicates an active attack or a misconfigured or designed application.
The expected use of this function is to log the file name that caused the path manipulation to be detected to allow an active attack to be detected.
Other potential uses would be to immediately cause the program to exit, or returning a non-zero value and having the function return an error immediately (-1 for the open(2) replacements and NULL for the fopen (3) replacements).