From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Kleikamp Subject: Re: [PATCH] small smbfs bugfix Date: Fri, 26 Jan 2007 08:57:35 -0600 Message-ID: <1169823455.11159.23.camel@kleikamp.austin.ibm.com> References: <9510655228.20070126095123@rambler.ru> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk To: Pavel Fedin Return-path: Received: from e33.co.us.ibm.com ([32.97.110.151]:52209 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030705AbXAZO5i (ORCPT ); Fri, 26 Jan 2007 09:57:38 -0500 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.13.8/8.12.11) with ESMTP id l0QEvcAX007652 for ; Fri, 26 Jan 2007 09:57:38 -0500 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by westrelay02.boulder.ibm.com (8.13.8/8.13.8/NCO v8.2) with ESMTP id l0QEvcG4521440 for ; Fri, 26 Jan 2007 07:57:38 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l0QEvbLM029319 for ; Fri, 26 Jan 2007 07:57:38 -0700 In-Reply-To: <9510655228.20070126095123@rambler.ru> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 2007-01-26 at 09:51 +0300, Pavel Fedin wrote: > Hello! > > This small patch fixes a problem with smbfs in 2.6.19.2 kernel. > Should also apply to other kernels. NACK > The problem is that smbfs doesn't understand "user" and "noexec" > options. This makes it impossible to include into /etc/fstab lines > like: > > /pc2/myshare /mnt/smb/pc2/myshare smbfs user,noauto 0 0 > > Smbmount expands "user,noauto" to "user,noauto,noexec" plus something > else, don't remember exactly what. In the result such an entry simply > can't be mounted because smbfs fails due to unknown options. > This patch makes smbfs silently ignoring all unknown options instead of > producing an error. I believe the problem is in smbmount. At the system call level, "user" and "noauto" are not valid options. These are usually parsed by the mount command, but not sent to the mount syscall. "noexec" also shouldn't be passed as a string in the syscall, but the MS_NOEXEC flag should be set in the mountflags argument. > Also i would suggest to introduce this behavor to all other > filesystems. This would greatly improve autofs usability. Imagine a > situation: i have a ZIP drive and i'd like to be able to use ext2, > ext3 and vfat-formatted cartridges. Also i'm russian user so i use NLS feature > for names translation. In the fstab i would write: > > /dev/hdd /mnt/zip ext2,ext3,vfat user,noauto,iocharset=koi8-r,codepage=866 0 0 > > But in this case ext2 and ext3 wouldn't work at all since they would > fail due to unknown "iocharset" and "codepage" options. If the file system doesn't honor the option, it shouldn't accept it. In the first example, if you really want to mount with noexec, and smbfs simply ignores it, you've undermined the security of the system. Not recognizing the iocharset and codepage probably isn't as big a problem, but ext2/3 would not be behaving the same was as if it truly respected those options. > > -- > Best regards, > Pavel mailto:sonic_amiga@rambler.ru Shaggy -- David Kleikamp IBM Linux Technology Center