5 Replies Latest reply on Oct 14, 2013 1:37 AM by edri

    CF10 expandPath() problem

    DanielKB Level 1

      I currently have 2 servers.  Server 1 runs Win 2003 with CF9 and IIS.  Server 2 runs Win 2008 R2 64bit with CF10 and Apache 2.2 with virtual hosts.

       

      For years, on Server 1 when it ran CF7, CF8, and now CF9, if I were to run 'expandPath' this is the behavior I would see:

       

      expandPath("/")  -  web site root directory  (D:\sites\mysite\htdocs\)

      expandPath("/myDir/")  -  directory under web site root (D:\sites\mysite\htdocs\myDir\)

      expandPath("/../storage/")  -  directory above web site root  (D:\sites\mysite\storage\)

       

      But, now on my Server 2, the behavior has changed to:

       

      expandPath("/")  -  web site root directory  (D:\sites\mysite\htdocs\)

      expandPath("/myDir/")  -  directory under web site root (D:\sites\mysite\htdocs\myDir\)

      expandPath("/../storage/")  -  directory above web site root  (C:\ColdFusion10\cffusion2\bin\)

       

      I can't figure out if this is an issue in my configuration/setup or if this is a CF10 bug.  Any help would be greatly appreciated.

       

      Thanks,

      Daniel

       

       

      -=UPDATE=-

      I have been able to confirm that this works without issue under Server 2008 R2, IIS7 and CF10.  I'm guessing I have a configuration off somewhere, but I have no idea where to look.

        • 1. Re: CF10 expandPath() problem
          DanielKB Level 1

          Will no one else at least confirm the same behavior on another Apache 2 and CF10 server?  If I can get a confirmation, then I can at least report the issue.

          • 2. Re: CF10 expandPath() problem
            edri

            Hi,

             

            I have something close here.

             

            Win 2008. Apache 2. CF10.

             

            The second line of this code makes my cf server crash :

             


            this.errorRelPath = "/media/_error/";

            this.errorAbsPath = expandPath(this.errorRelPath);

             

            My component is in the directory :

            F5/component/helpers/Err.cfc

             

            And there is a mapping on

            /component   ==> D:/Clients/Sites/F5/component/ 

            • 3. Re: CF10 expandPath() problem
              Aegis Kleais Level 3

              Can you try creating a per-application mapping?

               

              <cfset THIS.mappings[ '/storage' ] = 'C:\path\to\storage\folder\' />

               

              And then in your page code, just:

               

              <cfdump var="#directoryExists( expandPath( '/storage' ) )#" abort="1" />

               

              I"m wondering if IIS8 has some kinda issue where it will not let you access paths outside the site root directory.  If you create a CF-mapping, CF can access these paths with it's own internal mappings and hopefully go around IIS8.

              • 4. Re: CF10 expandPath() problem
                edri Level 1

                I am first trying to reproduce the issue on another machine.

                 

                I have no direct access to the server that I am crashing with my tests, I must pass through a third party to restart and they make us pay for that.

                 

                I'll keep you updated.

                • 5. Re: CF10 expandPath() problem
                  edri Level 1

                  Couldn't reproduce it.

                   

                  It worked perfectly on the other machine.

                   

                  The server was crashing because of an overload from the SGBD on the same machine.

                   

                  SGBD issue solved, we finaly were able to produce an error without crashing the server.

                   

                  directoryExists said the directory didn't exist (which is true), but directoryCreate raised an error because it was trying to create something like that :

                   

                  "SOME_PATH_I_DONT_REMEMBER:redirectSOME_OTHER_PATH_I_DONT_REMEMBER"

                   

                  Note the ":redirect" which is I think the problem.

                   

                  Then I comented the line, and it worked.

                   

                  We added a few mappings, I restarted it worked.

                   

                  I uncommented the line, it works.

                   

                  Now, it is working, and I don't know why.