ad_page_contract_filter_proc_tmpfile (public)

 ad_page_contract_filter_proc_tmpfile name value_varname

Defined in packages/acs-tcl/tcl/tcl-documentation-procs.tcl

Checks to see that the tmpfile path is allowed on the system

Parameters:
name
value_varname
Author:
Lars Pind <lars@pinds.com>
Created:
25 July 2000

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
Source code:
upvar $value_varname value

    # ensure no .. in the path
    ns_normalizepath $value

    # check to make sure path is to an authorized directory
    set tmpdir_list [ad_parameter_all_values_as_list -package_id [ad_conn subsite_id] TmpDir]
    if { $tmpdir_list eq "" } {
        set tmpdir_list [list [ns_config ns/parameters tmpdir] "/var/tmp" "/tmp"]
    }

    foreach tmpdir $tmpdir_list {
        if { [string match "$tmpdir*" $value] } {
            return 1
        }
    }

    # Log details about this filter failing, to make it easier to debug.
    ns_log Notice "ad_page_contract tmpfile filter on variable '$name' at URL '[ad_conn url]': The tmpfile given was '$value', and the list of valid directories is '$tmpdir_list'."

    ad_complain [_ acs-tcl.lt_You_specified_a_path_]
    return 0
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: