smbmount & /etc/mtab

Urban Widmark urban at
Sat Sep 2 15:45:36 GMT 2000

[Why not post problems/bugs to samba at instead? Followups to this 
 should go there.]

On Sat, 2 Sep 2000, Hagen Heiduck wrote:

> Hi,
> I think there's a little bug with smbmount (I'm using version 2.0.7) and
> mounting to directories containing backslashes. For example:


> Even "mount" handles it right with other types of file systems I guess
> this has to be solved in smbmount.

mount has special code to deal with "wierd" characters, such as space, tab
and \. mount and umount understand each other, that does not necessarily
mean that they do it right.

Passing /mnt/aa\\bb on the commandline makes smbmnt get /mnt/aa\bb. That
is passed to the c library using addmntent and to me it looks like the c
library adds an extra \ making it \\ again, like this:
	//localhost/data /mnt/aa\\bb smbfs  0 0
(Note, if you umount something the entries will be changed from \\ into
 \134\134 as mount apparently rewrites the mtab file)

mount however doesn't use addmntent from the c library and escapes \ into
some octal format \134 when writing the entries itself, so
% mount -t vfat /dev/sda5 /mnt/aa\\bb
generates an entry in /etc/mtab like this:
	/dev/sda5 /mnt/aa\134bb vfat rw 0 0

I think the problem is that mount and glibc disagrees on how to write the
mtab. smbmount could try to work around the problem, but that doesn't
solve it (should it be \\ or \134, or both) and doesn't help other users
of mtab (I'm guessing that ncpmount also writes mtab entries).

I have
	mount from util-linux-2.10o (latest) and mount-2.9u
bugs for these can be reported here:
	util-linux at

You may want to try research how it really should be before reporting it
as a bug to one of the above. Maybe someone here knows what other
platforms do. They do agree on how to escape space, with a \040.


More information about the samba-technical mailing list