Access NFS share from Linux - usage of separator

26 views
Skip to first unread message

adie...@tecracer.de

unread,
Feb 24, 2017, 4:07:21 AM2/24/17
to Lucee
Hello,
I try to access a remote fileshare with UNC notation to read and put files with cffile. 
The basics does not work for me, how I have to escape / write the path?

<cftry>
   
<cffile action="write" file="/\/\172.20.12.1/\document_root/\data/\hallo.html" output="hallo">
   
<cfcatch><cfoutput>#cfcatch.message#<br></cfoutput></cfcatch>
</cftry>

<cftry>
   
<cffile action="write" file="\\172.20.12.1\document_root\data\hallo.html" output="hallo">
   
<cfcatch><cfoutput>#cfcatch.message#<br></cfoutput></cfcatch>
</cftry>

<cftry>
   
<cffile action="write" file="//172.20.12.1/document_root/data/hallo.html" output="hallo">
   
<cfcatch><cfoutput>#cfcatch.message#<br></cfoutput></cfcatch>
</cftry>

All results in :
parent directory for [/172.20.12.1/document_root/data/hallo.html] doesn't exist
parent directory for [/172.20.12.1/document_root/data/hallo.html] doesn't exist
parent directory for [/172.20.12.1/document_root/data/hallo.html] doesn't exist

What I am doing wrong?
I use the latest Lucee 5.1.1.65 with CentOS 7.3 to connect to a Windows file share.

Joseph Gooch

unread,
Feb 24, 2017, 4:22:09 PM2/24/17
to lu...@googlegroups.com
Unless Lucee is doing some serious magic, UNC isn't going to work on Linux.  Using UNC on windows is leveraging a core OS feature, not a Lucee or Java feature.  UNC doesn't exist on Linux.  (further, what credentials would it use to connect?  Do you have kerberos configured?)  Even on windows, it would only work if your Lucee process were not running as LocalSystem, but a domain user with appropriate access to the file share.

Drive mappings will work.  You could use cifs to mount your document_root to a known file path, and access that (with static credentials).

Or you can leverage the JCIFS java library or similar to make calls against SMB shares.

That said, I see Lucee depends on jCIFS.jar, so it's entirely possible Lucee has some built in support for it and I'm wrong.  But I'd fully expect you'd at least need username and password.

If Lucee did support it, it's probably be at the VFS layer, so since you can do things like file:/// and ram:/// in various parts of Lucee, there's probably a prefix for SMB.  Try smb://host/path or cifs://host/path . and you might have to set jcifs.smb.client.username and jcifs.smb.client.password properties, or do a url like smb://user:pw@host/path


-G





--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/a7c9f596-920b-4744-9bb7-11dba6046b07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages