Re: More on smbfs - I got it working...

Michael H. Warfield (mhw@wittsend.com)
Sat, 23 May 1998 11:32:38 -0400 (EDT)


David Woodhouse enscribed thusly:
> ....eventually.
>
> Apparently the latest mount utilities are included in the samba distribution.
> That's true, I suppose, but they're not compiled by default, and they
> definitely aren't included in the RPM packages.
>
> Furthermore, they don't even compile out of the box. The included patch was
> required to get them to work, along with a minor change to linux/include/linux/

Your patches are similar to changes I sent up to the samba-technical
list (Cc: in on this) minus the kernel header change. A lot of this has
to do the the moras created by RedHat 5.0 and the headers that came along
with glibc.

One other problem remains though. These changes work if you are
doing manual mounts. If you are using autofs and the autofs daemon, you
are in trouble. The old smbmount and the new smbmount do not have compatible
command line syntax. The old smbmount will work with autofs. The new
one is a mess. I'm leaning toward some sort of conversion script that will
take the old syntax and convert it to the new syntax and call the new
smbmount with it. Some of my systems dual-boot between 2.0 kernels and
2.1 kernels and switching the syntax back and forth between the two
families of boot configurations is BOGUS.

If anyone else has a solution for making autofs work with the
new smbmount, please post. Eventually, autofs will need to be adapted
as the old smbmount is depreciated.

> smb_fs.h:
>
> --- linux/include/linux/smb_fs.h.orig Sat May 23 02:21:12 1998
> +++ linux/include/linux/smb_fs.h Sat May 23 02:21:42 1998
> @@ -9,7 +9,11 @@
> #ifndef _LINUX_SMB_FS_H
> #define _LINUX_SMB_FS_H
>
> +#ifdef __KERNEL__
> #include <linux/dirent.h>
> +#else
> +#include <dirent.h>
> +#endif
> #include <linux/smb.h>
>
> /*
>
> I've also made a patch to the documentation, and an RPM of the new mount
> utilities. The former is attached, and they're both up for FTP from
> dwmw2.robinson.cam.ac.uk in /pub/kernel
>
>
>
> --==_Exmh_-6717072770
> Content-Type: text/plain ; name="smbfs-docs-patch"; charset=us-ascii
> Content-Description: smbfs-docs-patch
> Content-Disposition: attachment; filename="smbfs-docs-patch"
>
> --- linux/Documentation/Changes.orig Sat May 23 03:14:00 1998
> +++ linux/Documentation/Changes Sat May 23 03:23:47 1998
> @@ -59,6 +59,7 @@
> - NFS 0.4.21 ; showmount --version
> - Bash 1.14.7 ; bash -version
> - Ncpfs 2.2.0 ; ncpmount -v
> +- Smbfs Samba 1.9.18 ; smbmount -h
> - Pcmcia-cs 3.0.1
> - PPP 2.3.5 ; pppd -v
>
> @@ -262,6 +263,17 @@
> To mount NetWare shares, you'll need to upgrade to a more recent
> version of the ncpfs utils.
>
> +
> +Smbfs
> +=====
> +
> + To mount SMB shares, you'll need to obtain the a recent version of Samba,
> +which now contains the mount utilities which were once in a separate 'smbfs'
> +package. If your smbmount utility claims to be version 2.0 or 2.1, then it is
> +obsolete. Fetch the latest Samba distribution, uncomment the MOUNT_PROGS line
> +in the Makefile, and recompile it.
> +
> +
> Pcmcia-cs
> =========
>
> @@ -443,6 +455,12 @@
>
> The 2.2.0 release:
> ftp://ftp.gwdg.de/pub/linux/misc/ncpfs/ncpfs-2.2.0.tgz
> +
> +Smbfs
> +=====
> +
> +The latest (currently 1.9.18p7) release:
> +ftp://samba.anu.edu.au/pub/samba/samba-latest.tar.gz
>
> Pcmcia-cs
> =========
> --- linux/Documentation/filesystems/smbfs.txt.orig Sat May 23 03:23:56 1998
> +++ linux/Documentation/filesystems/smbfs.txt Sat May 23 03:41:28 1998
> @@ -11,6 +11,10 @@
> smbfs volumes. Refer to the smbmount(8) and smbmnt(8) manpages for the
> details regarding smbfs mounts.
>
> +NOTE: The Samba package does not compile the mount utilities by default, and
> +RPM or debian packages of Samba are unlikely to include them either. You will
> +probably have to download the Samba source and recompile it yourself.
> +
> The smbmount utility reads the Samba smb.conf config file for some of its
> options, and at least one of these is important for smbfs operation. You
> should enable the TCP_NODELAY socket option, or else directory listings
>
> --==_Exmh_-6717072770
> Content-Type: application/x-patch ; name="samba-1.9.18p7-kernel2.1.patch"
> Content-Description: samba-1.9.18p7-kernel2.1.patch
> Content-Disposition: attachment; filename="samba-1.9.18p7-kernel2.1.patch"
>
> --- samba-1.9.18p7/source/Makefile.orig Mon May 11 09:37:44 1998
> +++ samba-1.9.18p7/source/Makefile Sat May 23 02:19:06 1998
> @@ -200,7 +200,7 @@
> # you must use the smbfs utilities from
> # ftp://ftp.gwdg.de/pub/linux/misc/smbfs
>
> -# MOUNT_PROGS = smbmount smbmnt smbumount
> +MOUNT_PROGS = smbmount smbmnt smbumount
>
> # Use this for Linux with shadow passwords - but not using PAM!
> # contributed by Andrew.Tridgell@anu.edu.au
> --- samba-1.9.18p7/source/smbmount.c.orig Sat May 23 02:20:11 1998
> +++ samba-1.9.18p7/source/smbmount.c Sat May 23 02:33:12 1998
> @@ -28,7 +28,7 @@
> #if LINUX_VERSION_CODE < LVERSION(2,1,70)
> #error this code will only compile on versions of linux after 2.1.70
> #endif
> -
> +#include <asm/types.h>
> #include "includes.h"
> #include <linux/smb_fs.h>
> static struct smb_conn_opt conn_options;
> --- samba-1.9.18p7/source/smbumount.c.orig Sat May 23 02:33:41 1998
> +++ samba-1.9.18p7/source/smbumount.c Sat May 23 02:36:48 1998
> @@ -26,9 +26,9 @@
> #include <stdlib.h>
> #include <sys/mount.h>
> #include <mntent.h>
> -
> +#include <asm/types.h>
> #include <sys/ioctl.h>
> -#include <linux/fs.h>
> +/*#include <linux/fs.h>*/
> #include <linux/smb.h>
> #include <linux/smb_mount.h>
> #include <linux/smb_fs.h>
> @@ -92,7 +92,7 @@
> if (realpath (path, canonical))
> return canonical;
>
> - pstrcpy (canonical, path);
> + strcpy (canonical, path);
> return canonical;
> }
>
> --- samba-1.9.18p7/source/smbmnt.c.orig Sat May 23 02:34:25 1998
> +++ samba-1.9.18p7/source/smbmnt.c Sat May 23 02:35:26 1998
> @@ -27,7 +27,8 @@
> #include <sys/mount.h>
> #include <mntent.h>
>
> -#include <linux/fs.h>
> +#include <asm/types.h>
> +/*#include <linux/fs.h>*/
^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: This is a RedHat 5.0 / glibc problem and really should be this:

+#ifdef GLIBC2
+#include <asm/types.h>
+#else
#include <linux/fs.h>
+#endif

> #include <linux/smb.h>
> #include <linux/smb_mount.h>
>
>
> ---- ---- ----
> David Woodhouse, Robinson College, CB3 9AN, England. (+44) 0976 658355
> Dave@imladris.demon.co.uk http://www.imladris.demon.co.uk
> finger pgp@dwmw2.robinson.cam.ac.uk for PGP key.

-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw@WittsEnd.com
  (The Mad Wizard)      |  (770) 925-8248   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu