3
    <cfdirectory
    action="list"
    directory="\\uncPath\test"
    sort="directory ASC"
    name="resultQry"
    />

Result (in CF error object): access denied (java.io.FilePermission \uncPath\test read) null

I found this article: http://coldfusion-tip.blogspot.in/2012/02/file-write-operation-on-shared-path-on.html (from coldfusion-tip.blogspot)

Which mentions that you need to provide the main Coldfusion Service account that's running, a service account that has access to whatever network location you're trying to access. So I did that, I added AD group permissions (which included access to \uncPath\test) to a separate service account, and am using that instead of the default local service account for the CF Application Service.

I verified that the account does indeed have access to this location, by logging into another machine and navigating to the path in Windows. Wrote a test text file and moved there to verify that I had both read/write access.

I tried my code again (the CFDIRECTORY) call, and it fails with the same error as before.

If I try to access the same path with an absolute path which is the same location as the UNC path, it works just fine

    <cfdirectory
    action="list"
    directory="C:\ColdFusion10\cfusion\wwwroot\test"
    sort="directory ASC"
    name="resultQry"
    />

So CF treats the two references differently it appears. I'm just trying to figure out how/why it does, and what work-around I can use to get it to function as desired.

I should also mention that IF I set myself (as the CF service account user) with my AD creds, the UNC path works just fine and can access the UNC(\uncPath\test). So I'm not sure why there's a discrepancy there between myself, and a service account user w/ the same access rights to a UNC location on the network.

user1178394
  • 83
  • 1
  • 8
  • Are you using ColdFusion sandbox security? Perhaps that is tripping your code up. – Miguel-F May 30 '14 at 11:47
  • 1
    Sorry if this is not helpful, I am assuming your UNC is a Windows shared location. Does your CF service account have access to the actual share? I've had a number of problems with this, and 9 times out of 10, it was a problem with my permissions set up on Active Directory. – Charlie Jun 04 '14 at 17:18
  • I had same issue: unc path worked with cf running under my account and not working when cf ran undere a service account even though I had manually updated the security properties of the directory to give the security account read permissions. When I checked the remote box I wanted to access I saw that the local administrators account included an AD group that I was a member of but the service account was not. I made the service account a member of the local admin group in windows and that solved my problems... please note that it may take several minutes for the account change to proagate – gabriel Jan 31 '18 at 20:33

0 Answers0