15 Security Guards
Before a primitive procedure accesses the filesystem or creates a network connection, it should first consult the current security guard to determine whether such access is allowed for the current thread.
File access is normally preceded by a call to scheme_expand_filename, which accepts flags to indicate the kind of filesystem access needed, so that the security guard is consulted automatically.
An explicit filesystem-access check can be made by calling scheme_security_check_file. Similarly, an explicit network-access check is performed by calling scheme_security_check_network.
|
SCHEME_GUARD_FILE_READ
SCHEME_GUARD_FILE_WRITE
SCHEME_GUARD_FILE_EXECUTE
SCHEME_GUARD_FILE_DELETE
SCHEME_GUARD_FILE_EXISTS (do not combine with other values)
The filename argument can be NULL (in which case #f is sent to the security manager’s procedure), and guards should be SCHEME_GUARD_FILE_EXISTS in that case.
If access is denied, an exception is raised.
|
If access is denied, an exception is raised.