[Pkg-samba-maint] Bug#970266: mount: comment=x-gvfs-show not removed from options for non-reoot user

Chris Hofstaedtler zeha at debian.org
Thu Sep 24 16:45:25 BST 2020


Control: reassign -1 cifs-utils

Dear Samba Maintainers,

this appears to be something you could probably investigate better.

* Martin Schwenke <martin at meltin.net> [200924 15:34]:
> On Mon, 14 Sep 2020 08:45:04 +0200, Chris Hofstaedtler
> <zeha at debian.org> wrote:
> > * Martin Schwenke <martin at meltin.net> [200914 01:48]:
> > [..]
> > > I add this to /etc/fstab:
> > >   //digby/flac    /mnt/flac       cifs                    noauto,user,username=guest,password=,ro,soft,vers=3,comment=x-gvfs-show      0       0
> > > "mount /mnt/flac" as root works without a problem.
> > >   
> > [..]
> > > /var/log/kern.log shows:
> > >   Sep 14 09:38:05 kloof kernel: [183360.156767] CIFS: Attempting to mount //digby/flac
> > >   Sep 14 09:38:05 kloof kernel: [183360.156809] CIFS: Unknown mount option "comment=x-gvfs-show"
> > > 
> > > So it appears that the comment is being passed to the helper, which
> > > does not follow the documentation.  
> > 
> > Please be so kind and run this on your machine:
> >     $ strace -ttf -bexecve -s30000 mount /mnt/flac
> > 
> > And look for the execve() line, probably something like this:
> >     pid 1687840] 06:42:51.534769 execve("/sbin/mount.cifs", ["/sbin/mount.cifs", "/mnt/flac", "-o", ... 
> > 
> > Please check if comment=x-gvfs-show actually appears there.
> > In my limited testing I found mount does not pass a comment=...
> > option to mount.cifs.
> 
> Wow!  Correct:
[..]

It appears mount.cifs somehow re-adds a comment=... option from
/etc/fstab when calling mount(), for "user"-style mounts.

$ strace -ttf -bexecve -s30000 mount /mnt
 execve("/sbin/mount.cifs", ["/sbin/mount.cifs", "//x/y", "/mnt", "-o", "rw,noexec,nosuid,nodev,username=ch,user"], 0x7ffc40273cb0 /* 42 vars */) = 0

In a root-strace of mount.cifs, you'll see:
 mount("//x/y$", ".", "cifs", MS_NOSUID|MS_NODEV, "ip=10.100.0.52,unc=\\\\x\\y,noauto,comment=foo,uid=1000,gid=1000,user=ch,pass=yolo") = -1 EINVAL (Invalid argument)

Doesn't appear to be a util-linux/mount problem to me.

Best,
Chris



More information about the Pkg-samba-maint mailing list