smbmount et al...

Michael H. Warfield mhw at wittsend.com
Tue Sep 15 03:34:41 GMT 1998


Yo!  Tridge...

Andrew Tridgell enscribed thusly:
> > What's the magic incantation or did something get missed in the conversion?

> it got missed :)

	Kinda figured that...

> We're still trying to work out if we want to include smbmount in Samba
> 2.0. The problem with including it is that we don't have anyone who
> can look after it (handle bug reports etc) and Jeremy and I don't use
> it at all. It might have been a mistake to include it in Samba in the
> first place as it is so Linux specific.

	Ok...  I waited until I had Luke safely back in my office and kinda
talked things over with him about this.

	Since you and Jeremy don't use it, but I do, and I've posted fixes
in the past, I guess I'm a prime candidate.  Judging from the number of
requests I've gotten for my smbmount version switching script, I would
say there are a number of others using it (or trying to) as well.  I've
also been fielding complaints / help requests on the linux lists for some
time now.

	I'm also one of the primary bitchers about the change in syntax
from the old smbfs version of smbmount to the new samba version of smbmount.
I'm not going to go down the road of why it got where it is or why it should
or shouldn't have.  We have users that are heavily invested in it and we
have some responsibility to the sins of the past...  So be it.

	I've dug into it and gotten smbmount, smbmnt, and smbumount to
compile under the current CVS tree under both libc (RedHat 4.x) and glibc
(RedHat 5.x) systems.  The patch against the current CVS tree is attached
below.  It only affects Makefile.in, configure.in, and the three smb*.c
files under the client directory.  That SHOULD be safe enough to plug
into CVS without screwing anything else up.  While the smbmount stuff
only applies to Linux, I did not add Linux checks or validation to the
autoconf stuff.  Your shot to call if you think it needs that level of
idiot proofing.  I'll do it if you ask...

	Luke thinks we should just let things "float" and when people want
things fixed, someone will "pony up to the bar" and fix them.  I tend to
agree with him and I really don't want to "own" this particular "tar baby".
However, if that's what it takes to keep this thing rolling, then so be it.
I'll take it and deal with it one way or the other, if that will make life
easier on you and Jeremy.

	I knew Luke was working with some smbclient stuff and I know the
smbmount is some perversion of the smbclient.  If Luke and I can coordinate,
we should be able to keep each other from commiting too many heinious sins.
We might even get some real work done!  :-)  I'll help him out, best I can
and he can keep me from gumming up the works by thrashing around in a
setup I haven't worked in before.  If that's ok with you, that is (and if
you aren't overly worried about the two of us together creating new
synergistic random acts of terrorism)...

	Here is my current patch.  Let me know what you want to do with
it and what you would like me to do.  Yes, I'm volunteering, for what
it's worth.  I just want to keep this thing compiling and working until
if and when anything else better comes along.  Hell...  Might as well
make it something to be happy about...

	BTW...  Just to make sure I maximize confusion all the way around...

	mhw at iss.net == mhw at wittsend.com

	My personal home domain is WittsEnd.com and mhw at wittsend.com is my
home address.  My office persona is mhw at iss.net.  I may send E-Mail from
either or both.  I check both continuously through the day whether I'm
telecommuting from home (3 days a week) or in the office (currently Monday
and Friday).  I know I sent some E-Mail to you and Jeremy, last time Luke
was here, from my iss.net account.  This is just letting you know that I
be he...  :-) ;-> :-/

	Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw at 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!

===== Begin attachment ===== samba.smbmount.diff =====
diff -urN samba/source/Makefile.in samba.smbmount/source/Makefile.in
--- samba/source/Makefile.in	Mon Sep 14 22:57:50 1998
+++ samba.smbmount/source/Makefile.in	Mon Sep 14 18:21:44 1998
@@ -75,7 +75,8 @@
 SPROGS = bin/smbd bin/nmbd bin/swat
 PROGS1 = bin/smbclient bin/testparm bin/testprns bin/smbrun bin/smbstatus 
 PROGS2 = bin/smbpasswd bin/make_smbcodepage
-PROGS = $(PROGS1) $(PROGS2) bin/nmblookup bin/make_printerdef 
+MPROGS = @MPROGS@
+PROGS = $(PROGS1) $(PROGS2) $(MPROGS) bin/nmblookup bin/make_printerdef 
 
 SCRIPTS = script/smbtar script/addtosmbpass
 
@@ -180,6 +181,15 @@
 CLIENT_OBJ = client/client.o client/clientutil.o client/clitar.o \
              $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
 
+MOUNT_OBJ = client/smbmount.o client/clientutil.o \
+             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+
+MNT_OBJ = client/smbmnt.o \
+             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+
+UMOUNT_OBJ = client/smbumount.o \
+             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+
 NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(UBIQX_OBJ) \
                 $(LIBSMB_OBJ) $(LIB_OBJ)
 
@@ -224,6 +234,18 @@
 bin/smbclient: $(CLIENT_OBJ) 
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LIBS)
+
+bin/smbmount: $(MOUNT_OBJ) 
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(MOUNT_OBJ) $(LIBS)
+
+bin/smbmnt: $(MNT_OBJ) 
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(LIBS)
+
+bin/smbumount: $(UMOUNT_OBJ) 
+	@echo Linking $@
+	@$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(LIBS)
 
 bin/testparm: $(TESTPARM_OBJ)
 	@echo Linking $@
diff -urN samba/source/client/smbmnt.c samba.smbmount/source/client/smbmnt.c
--- samba/source/client/smbmnt.c	Mon Sep 14 22:57:55 1998
+++ samba.smbmount/source/client/smbmnt.c	Mon Sep 14 23:04:33 1998
@@ -5,33 +5,22 @@
  *
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <sys/socket.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-/* #include <sys/wait.h> */  /* generates a warning here */
-extern pid_t waitpid(pid_t, int *, int);
-#include <sys/errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <sys/mount.h>
+#include "includes.h"
+
 #include <mntent.h>
 
-#include <linux/fs.h>
+#include <asm/types.h>
 #include <linux/smb.h>
 #include <linux/smb_mount.h>
-
 #include <asm/unistd.h>
+
+#ifndef	MS_MGC_VAL
+/* This may look strange but MS_MGC_VAL is what we are looking for and
+	is what we need from <linux/fs.h> under libc systems and is
+	provided in standard includes on glibc systems.  So...  We
+	switch on what we need...  */
+#include <linux/fs.h>
+#endif
 
 static char *progname;
 
diff -urN samba/source/client/smbmount.c samba.smbmount/source/client/smbmount.c
--- samba/source/client/smbmount.c	Mon Sep 14 22:57:57 1998
+++ samba.smbmount/source/client/smbmount.c	Mon Sep 14 18:22:22 1998
@@ -28,6 +28,8 @@
 #endif
 
 #include "includes.h"
+
+#include <asm/types.h>
 #include <linux/smb_fs.h>
 static struct smb_conn_opt conn_options;
 
diff -urN samba/source/client/smbumount.c samba.smbmount/source/client/smbumount.c
--- samba/source/client/smbumount.c	Mon Sep 14 22:57:58 1998
+++ samba.smbmount/source/client/smbumount.c	Mon Sep 14 18:22:22 1998
@@ -5,30 +5,11 @@
  *
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <sys/socket.h>
-#include <sys/param.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-/* #include <sys/wait.h> */  /* generates a warning here */
-extern pid_t waitpid(pid_t, int *, int);
-#include <sys/errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <sys/mount.h>
+#include "includes.h"
+
 #include <mntent.h>
 
-#include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <asm/types.h>
 #include <linux/smb.h>
 #include <linux/smb_mount.h>
 #include <linux/smb_fs.h>
diff -urN samba/source/configure.in samba.smbmount/source/configure.in
--- samba/source/configure.in	Mon Sep 14 22:57:54 1998
+++ samba.smbmount/source/configure.in	Mon Sep 14 18:18:25 1998
@@ -6,6 +6,7 @@
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_SUBST(SHELL)
+AC_SUBST(MPROGS)
 AC_PROG_AWK
 
 AC_CANONICAL_SYSTEM
@@ -416,6 +417,27 @@
     ;;
   esac ],
   AC_MSG_RESULT(no)
+)
+
+#################################################
+# check for smbmount support
+AC_MSG_CHECKING(whether to use SMBMOUNT)
+AC_ARG_WITH(smbmount,
+[  --with-smbmount     Include SMBMOUNT (Linux only) support
+  --without-smbmount  Don't include SMBMOUNT support (default)],
+[ case "$withval" in
+  yes)
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(WITH_SMBMOUNT)
+    MPROGS="bin/smbmount bin/smbmnt bin/smbumount"
+    ;;
+  *)
+    AC_MSG_RESULT(no)
+    MPROGS=
+    ;;
+  esac ],
+  AC_MSG_RESULT(no)
+  MPROGS=
 )
 
 #################################################
===== End attachment ===== samba.smbmount.diff =====


More information about the samba-technical mailing list