Bug 2005 - smbmount doesn't parse codepage and iocharset arguments always correctly
smbmount doesn't parse codepage and iocharset arguments always correctly
Product: Samba 3.0
Classification: Unclassified
Component: smbmount (unmaintained)
x86 Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2004-11-09 01:52 UTC by Matthäus Wander
Modified: 2006-01-17 22:18 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Matthäus Wander 2004-11-09 01:52:53 UTC
Character translation from codepage to iocharset doesn't work, if option 
arguments are in wrong order.


Doesn't work: username=remoteuser,uid=localuser,gid=localgroup,

Works: codepage=cp850,iocharset=iso8859-1,username=remoteuser,uid=localuser,

Local system is Linux, remote system is Windows XP. No matter if options are in 
fstab or as a arguments for mount or smbmount.
Comment 1 Andrew Zabolotny 2005-01-13 12:52:58 UTC
I'm not sure whether this is a matter of options order, or a matter of unknown 
options (for smbmount) being passed by mount. I've resolved the issue for me by 
renaming smbmount to smbmount2, and putting the following script in place of 

opts=`echo $* | sed -e 's/,no[a-z]*//g' -e 's/,user,/,/'`
/usr/bin/smbmount2 $share $mpoint $opts

As you can see, it removes all arguments that mount passes always to smbmount 
(no matter what you have in fstab). Here is what smbmount gets and the following 
line is the result after filtering:

-o rw,noexec,nosuid,nodev,noauto,user,fmask=666,dmask=777,

boils down to

-o rw,fmask=666,dmask=777,credentials=/home/zap/samba/cs::ftp,iocharset=cp1251,

which works. As soon as smbmount encounters an unknown option (such as, for 
example, nosuid) it either cheases to parse further options or resets the 
charset, I don't understand yet clearly.

It is also possible that this is a different bug, but it's clearly related to 
this one.
Comment 2 Steve Clark 2006-01-05 08:28:49 UTC

Based on the reponse to bug 2203, it looks like this site is refusing to fix smbclient programs.

A slightly cleaner way to implement your idea on Linux at least is to replace the symbolic link /sbin/mount.smbfs with your script calling /usr/bin/smbmount.  Thanks for your workaround.
Comment 3 Gerald (Jerry) Carter 2006-01-17 22:18:33 UTC
It's not smbclient.  It's smbmount.  Please contact the 
kernel maintainers.