<CFFUNCTION NAME="test" ACCESS="public" RETURNTYPE="void" OUTPUT="true">

<CFSET sRequiredCFC = "test1.cfc">
<CFSET sRequiredCFC = "cf" & Replace(sRequiredCFC, ".", "2e")>

<CFTRY>
    <CFTHROW TYPE="Test" MESSAGE="TestMessage">
    <CFCATCH TYPE="any">
        <CFSET sStack = cfcatch.StackTrace>
    </CFCATCH>
</CFTRY>

<CFIF Find(sRequiredCFC, sStack)>
    Called by test1.cfc
<CFELSE>
    Not called by test1.cfc
</CFIF>
</CFFUNCTION>
...
One thought on this particular implementation. I can see how this can detect that test.cfc is part of the stack trace, but what if this CFC was called by another CFC that was called by test.cfc.


Also, it seems this would OK any call from any cfc named test1.cfc. Both of these could make your call:

com.foo.correct_path_to.test1
com.hack.bad_user_call.test1

Correct?

--

    Ben Curtis
    WebSciences International
    http://www.websciences.org/
    v: 310 478 6648
    f: 310 235 2067






----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to