rp_file_can_be_public_p (private)
rp_file_can_be_public_p path
Defined in packages/acs-tcl/tcl/request-processor-procs.tcl
Determines if -- absent application restrictions -- a file can be served to a client without violating simple security checks. The checks do not require the initialization of ad_conn or expensive permission:: calls. Log a warning when the file must not be served. The caller handles the response.
- Parameters:
- path (required)
- The file to perform the simple security checks on.
- Returns:
- 0 if the file must not be served. 1 if the application should perform its own checks, if any.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: # first check that we are not serving a forbidden file like a .xql, a backup or CVS file if {[ad_file extension $path] eq ".xql" && ![parameter::get -parameter ServeXQLFiles -package_id $::acs::kernel_id -default 0] } { ns_log Warning "An attempt was made to access an .XQL resource: {$path}." return 0 } foreach match [parameter::get -parameter ExcludedFiles -package_id $::acs::kernel_id -default {}] { if {[string match $match $path]} { ns_log Warning "An attempt was made to access an ExcludedFiles resource: {$path}." return 0 } } return 1XQL Not present: Generic, PostgreSQL, Oracle