# "mount_smbfs" not working in Leopard!



## mickey79 (Oct 31, 2007)

Ave,

I used to run Mac OS X 10.3.9 Panther, and used a neat shell command to mount a Windows Share on a Share Point in my Mac. Using the Share Point, different PHP Scripts in my Web Sites hosted on my Apache Web Server were able to access the files on the windows share.

Following is the shell command I used to mount a Windows Share called "Transfer" on a Share Point on my Mac called "OSM":



> mount_smbfs -u 70 -g 70 //user@192.168.1.2/Transfer ~/Documents/XFER/osm



This gave Read/Write permissions to files in the 'Transfer' Share. 
My PHP scripts could then access the files in such a manner:



> $db = dbase_open("/Users/user/Documents/XFER/osm/file.dbf", 0);



Unfortunately, none of this is working Leopard. I just upgraded to Mac OS X 10.5. 

First of all, *mount_smbfs -u 70 -g 70 //user@192.168.1.2/Transfer ~/Documents/XFER/osm* fails completely. I get an error that "-u" is not a supported argument. Which tells me that the "*mount_smbfs*" command has changed in Leopard and does not accept the -u or -g arguments. 

If it doesn't, then how am I to mount the shares?

I was able to mount the shares in Leopard by simply using *mount_smbfs //user@192.168.1.2/Transfer ~/Documents/XFER/osm* ... but when I do this - although the mount does appear and I can browse through the files in Finder - no Permissions have been specified and thus my PHP scripts fail to open files on the share. 

Does anyone know what I have to do to be able to mount Windows Shares using mount_smbfs and apply desired Read/Write permissions?
Also, has anything with Share Points changed?

Thanks.


----------



## Giaguara (Oct 31, 2007)

How about

smbclient //ip.or.dns/sharename -W workgroupname -U username

As that works for 10.4 at least...


----------



## mickey79 (Oct 31, 2007)

Giaguara said:


> How about
> 
> smbclient //ip.or.dns/sharename -W workgroupname -U username
> 
> As that works for 10.4 at least...



I need to mount the share on a Share Point other the PHP scripts are not able to access the files through the website on the Web Server!


----------



## Cow Loon (Oct 31, 2007)

Me too...

mount -t smbfs //host/share dir

which I did regularly under tiger now produces an error message in syslog:

/sbin/mount_smbfs[89071]: smb_mount: open session failed!: syserr = Broken pipe

I can login using smbclient, but can't mount.


----------



## kirkrr (Nov 1, 2007)

I connect with the smbclient, but am unable to move into the subordinate directory structure, or view files. 

"Unable to follow dfs referral" is returned. 

This is a Windows 2003 server share, NTFS, from a PB running Leopard 10.5

The "connect to server" function behaves identically, albeit without the verbose response. 

Suggestions? Gave my MB Pro to my son to go to college with, so a VM or Boot Camp solution is not effective. Attempting a MacFUSE solution - we'll see where that goes.


----------



## mickey79 (Nov 1, 2007)

The Share Point in Leopard does not react the same way as the Share Point in previous mac's. 

Somehow the Share Point in Leopard is giving permission denied whereas the exact same Share Point with exact same permissions, owners etcetera works fine in Panther. I don't know what they changed in Share Points in Leopard and I have no clue why would they.


----------



## kirkrr (Nov 1, 2007)

Solved the smbclient part - if you don't use the user account to include the domain, then it defaults to local, which doesn't work against a network share. 

This allows terminal to see the files on the network, but the Leopard GUI does not have the save visibility. Connect To Server, from the go menu, does not work. It connects, but I can't navigate into the directory structure that I can now see from terminal.


----------



## Cow Loon (Nov 1, 2007)

That worked thanks:

mount -t smbfs //user@host/share dir


----------



## kirkrr (Nov 1, 2007)

OK, 
smbclient //"domain"/"share" -U "domain"/"login_name" works, but I can only navigate the file structure from the smbclient prompt. 

When I just to another terminal session, and go to the /Volumes/"share" directory, I get the same error as I do from the Leopard GUI - I see the share directory, but nothing underneath is visible. 

Tried the mount command from COW LOON, but it returned a "broken pipe" message.

I substituted for SHARE - the share point name, which is the same as the directory name. That returned "no such file or directory"

The dir shows up it the VOLUMES dir, but cannot navigated to - no files.

Struggling a bit with the share name vs the dir name ......
The path is "domain"/it/


----------



## mickey79 (Nov 1, 2007)

Unfortunately my problems remains as it is 

mount -t smbfs /userwd@ip/share sharepoint and several of it's combinations, including mount_smbfs /userwd@ip/share sharepoint ... that all work for Finder. They will mount the share and you case use the share just like any other folder in Finder.

However, PHP is not able to access any file that resides on these shares through the Apache Web Server. In other words - Apache Web Server is not getting the permission to access these files.

I host websites on my Mac OS X, using Apache Web Server, in /Library/WebServer/Documents and some of these websites (running PHP) need to access files which are on a Windows share. 

I never had any problems in Panther doing the same. Just simply mount_smbfs -u 70 -g 70 //userwd@ip/share sharepoint worked.
Now all I get is permission denied.

Just don't get it.


----------



## Cow Loon (Nov 1, 2007)

Is it a permissions problem?

It looks like you can use -onoowners to make the owner be the current user. So maybe you could do something like:

sudo -u www-data mount -onoowners -t msbfs //user@host/share dir

Where www-data would be your web server's user name.


----------



## mickey79 (Nov 2, 2007)

That Worked!! Well actually, what worked better was:

sudo -u www mount_smbfs -f 777 -d 777 //usrwd@ip/share node

But got that out of your suggestion. Man - Can't thank you enough!!!


----------

