Subject: Re: changing to NetBSD, still not quite sure... :-/
To: None <netbsd-users@netbsd.org>
From: Michael van Elst <mlelstv@serpens.de>
List: netbsd-users
Date: 10/28/2007 23:54:32
acruhl@gmail.com ("Andy Ruhl") writes:

>I found a simple, cheap "NAS" enclosure that spins down the disk and
>uses almost zero power for the most part. Well, while the disk isn't
>spinning. I've found that these simple "NAS" devices do their shares
>similar to how win95 did it, no username, just a password. I'm not up
>to speed on what this is called in Windows speak. But this
>functionality doesn't work with the mount_smbfs in NetBSD.

Share level access still requires a user, even when you have
guest access.

Anonymous access doesn't use a user but AFAIK it doesn't require a password
either. Currently you cannot use such an anonymous mount. The following
patch fixed this for netbsd3:

Index: sys/netsmb/smb_usr.c
===================================================================
RCS file: /cvsroot/src/sys/netsmb/smb_usr.c,v
retrieving revision 1.10
diff -u -r1.10 smb_usr.c
--- sys/netsmb/smb_usr.c	26 Feb 2005 22:39:50 -0000	1.10
+++ sys/netsmb/smb_usr.c	28 Oct 2007 23:52:11 -0000
@@ -67,8 +67,10 @@
 	int flags = 0;
 
 	bzero(spec, sizeof(*spec));
+#ifdef NOANON
 	if (dp->ioc_user[0] == 0)
 		return EINVAL;
+#endif
 	if (dp->ioc_server == NULL)
 		return EINVAL;
 	if (dp->ioc_localcs[0] == 0) {
Index: dist/smbfs/lib/smb/ctx.c
===================================================================
RCS file: /cvsroot/src/dist/smbfs/lib/smb/ctx.c,v
retrieving revision 1.9
diff -u -r1.9 ctx.c
--- dist/smbfs/lib/smb/ctx.c	21 Mar 2004 12:30:51 -0000	1.9
+++ dist/smbfs/lib/smb/ctx.c	28 Oct 2007 23:52:11 -0000
@@ -508,11 +508,13 @@
 		smb_error("no server name specified", 0);
 		return EINVAL;
 	}
+#ifdef NOANON
 	if (ssn->ioc_user[0] == 0) {
 		smb_error("no user name specified for server %s",
 		    0, ssn->ioc_srvname);
 		return EINVAL;
 	}
+#endif
 	if (ctx->ct_minlevel >= SMBL_SHARE && sh->ioc_share[0] == 0) {
 		smb_error("no share name specified for %s@%s",
 		    0, ssn->ioc_user, ssn->ioc_srvname);

-- 
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."