Bug 33068

Summary: /dev/nsmb* devices not created with make world
Product: Base System Reporter: dim <dim>
Component: binAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-PRERELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dim 2001-12-21 18:20:01 UTC
When smbfs was still a port, its Makefile created the required (at
least on -STABLE, without devfs) /dev/nsmb0 device during the install
phase. Now that smbfs has been imported into the base system, this
doesn't seem to be the case anymore, leading to mount_smbfs etc
failing. Also, MAKEDEV seems to be missing code to create these nsmb*
devices.

Fix: I'm not sure about this. The nsmb* devices can be created as part of
installworld, or they can simply be added to the MAKEDEV script, as
in the following patch. It also creates nsmb0 and nsmb1 as part of
"MAKEDEV all", which seems reasonable to me. The devices are created
with default owner/group (root/wheel) and permissions (0600), as the
smbfs port has always done.

Note that I'm just guessing that an nsmb1 device can exist or makes
any sense. I haven't been able to find much documentation about that,
except the source. ;) There seems to be no nsmb(4) man page
available, alas.
How-To-Repeat: Uninstall any smbfs ports
Update to 4.5-PRERELEASE
Try "mount_smbfs //LUSER@WINBOX/C$ /mnt", you'll get:
mount_smbfs: can't get handle to requester (no /dev/net/nsmb* device)
Also note that "/dev/net/nsmb*" in the message could be bisleading, it
should probably be "/dev/nsmb*", or even "/dev/"NSMB_NAME.
Comment 1 ru freebsd_committer freebsd_triage 2001-12-21 19:44:34 UTC
On Fri, Dec 21, 2001 at 07:11:24PM +0100, Dimitry Andric wrote:
> 
> When smbfs was still a port, its Makefile created the required (at
> least on -STABLE, without devfs) /dev/nsmb0 device during the install
> phase. Now that smbfs has been imported into the base system, this
> doesn't seem to be the case anymore, leading to mount_smbfs etc
> failing. Also, MAKEDEV seems to be missing code to create these nsmb*
> devices.
> 
> Uninstall any smbfs ports
> Update to 4.5-PRERELEASE
> Try "mount_smbfs //LUSER@WINBOX/C$ /mnt", you'll get:
> mount_smbfs: can't get handle to requester (no /dev/net/nsmb* device)
> Also note that "/dev/net/nsmb*" in the message could be bisleading, it
> should probably be "/dev/nsmb*", or even "/dev/"NSMB_NAME.
> 
> I'm not sure about this. The nsmb* devices can be created as part of
> installworld, or they can simply be added to the MAKEDEV script, as
> in the following patch. It also creates nsmb0 and nsmb1 as part of
> "MAKEDEV all", which seems reasonable to me. The devices are created
> with default owner/group (root/wheel) and permissions (0600), as the
> smbfs port has always done.
> 
> Note that I'm just guessing that an nsmb1 device can exist or makes
> any sense. I haven't been able to find much documentation about that,
> except the source. ;) There seems to be no nsmb(4) man page
> available, alas.
> 
You beat me to it.  :-)

Index: etc/MAKEDEV
===================================================================
RCS file: /home/ncvs/src/etc/MAKEDEV,v
retrieving revision 1.243.2.41
diff -u -p -r1.243.2.41 MAKEDEV
--- etc/MAKEDEV	2001/12/12 06:38:12	1.243.2.41
+++ etc/MAKEDEV	2001/12/21 19:43:50
@@ -152,6 +152,7 @@
 #	kbd	keyboard devices
 #	agpgart	AGP interface
 #	cfs*	Coda Distributed Filesystem
+#	nsmb*	SMB/CIFS protocol interface
 #
 
 if [ -n "$MAKEDEVPATH" ]; then
@@ -334,6 +335,7 @@ all)
 	sh MAKEDEV i4btel0 i4btel1 i4bteld0 i4bteld1	# cdev, ISDN
 	sh MAKEDEV i4brbch0 i4brbch1			# cdev, ISDN
 	sh MAKEDEV agpgart				# cdev, AGP
+	sh MAKEDEV nsmb0				# cdev, SMB/CIFS
 	;;
 
 # a much restricted set of the above, to save precious i-nodes on the
@@ -1799,6 +1801,11 @@ tw*)
 cfs*)
 	unit=`expr $i : 'cfs\(.*\)'`
 	mknod cfs$unit c 93 $unit root:operator
+	;;
+
+nsmb*)
+	unit=`expr $i : 'nsmb\(.*\)'`
+	mknod nsmb$unit c 144 $unit
 	;;
 
 local)
Index: contrib/smbfs/lib/smb/ctx.c
===================================================================
RCS file: /home/ncvs/src/contrib/smbfs/lib/smb/ctx.c,v
retrieving revision 1.1.1.1.2.1
diff -u -p -r1.1.1.1.2.1 ctx.c
--- contrib/smbfs/lib/smb/ctx.c	2001/12/18 12:31:52	1.1.1.1.2.1
+++ contrib/smbfs/lib/smb/ctx.c	2001/12/21 19:43:52
@@ -615,7 +615,7 @@ smb_ctx_lookup(struct smb_ctx *ctx, int 
 	}
 	error = smb_ctx_gethandle(ctx);
 	if (error) {
-		smb_error("can't get handle to requester (no /dev/net/nsmb* device)", 0);
+		smb_error("can't get handle to requester (no /dev/"NSMB_NAME"* device)", 0);
 		return EINVAL;
 	}
 	bzero(&rq, sizeof(rq));


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age
Comment 2 ru freebsd_committer freebsd_triage 2001-12-21 19:44:46 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

Sheldon, can we please fix this ASAP?
Comment 3 Sheldon Hearn 2001-12-21 19:56:46 UTC
On Fri, 21 Dec 2001 21:44:34 +0200, Ruslan Ermilov wrote:

> > Note that I'm just guessing that an nsmb1 device can exist or makes
> > any sense. I haven't been able to find much documentation about that,
> > except the source. ;) There seems to be no nsmb(4) man page
> > available, alas.
> > 
> You beat me to it.  :-)

The MAKEDEV part of the patch can obviously go in early... The other
part needs to wait for Boris.  He's quite responsive lately. :-)

Ciao,
Sheldon.
Comment 4 bp 2001-12-22 05:38:45 UTC
On Fri, 21 Dec 2001, Ruslan Ermilov wrote:

> > I'm not sure about this. The nsmb* devices can be created as part of
> > installworld, or they can simply be added to the MAKEDEV script, as
> > in the following patch. It also creates nsmb0 and nsmb1 as part of
> > "MAKEDEV all", which seems reasonable to me. The devices are created
> > with default owner/group (root/wheel) and permissions (0600), as the
> > smbfs port has always done.
> > 
> > 
> You beat me to it.  :-)

	Yep, completely forgot about this. I'll try to update 1.4.2 to
1.4.3 this evening and send it to Sheldon.

-- 
Boris Popov
http://rbp.euro.ru
Comment 5 Sheldon Hearn 2001-12-23 20:56:13 UTC
On Sat, 22 Dec 2001 11:38:45 +0600, Boris Popov wrote:

> On Fri, 21 Dec 2001, Ruslan Ermilov wrote:
> 
> > > I'm not sure about this. The nsmb* devices can be created as part of
> > > installworld, or they can simply be added to the MAKEDEV script, as
> > > in the following patch. It also creates nsmb0 and nsmb1 as part of
> > > "MAKEDEV all", which seems reasonable to me. The devices are created
> > > with default owner/group (root/wheel) and permissions (0600), as the
> > > smbfs port has always done.
> > > 
> > > 
> > You beat me to it.  :-)
> 
> 	Yep, completely forgot about this. I'll try to update 1.4.2 to
> 1.4.3 this evening and send it to Sheldon.

Got anything for me yet? :-)

Ciao,
Sheldon.
Comment 6 Sheldon Hearn 2001-12-26 15:47:09 UTC
On Wed, 26 Dec 2001 10:16:22 +0600, Boris Popov wrote:

> > Got anything for me yet? :-)
> 
> 	Sorry for delay. See 1.4.3 attached. Please test it before
> import. This version also includes fixes for WARNS=2 in the mount_smbfs.c
> file.

Hi Boris,

Imported in CURRENT, along with the fix for MAKEDEV.

I'm waiting for the release engineer's permission to MFC.

Ciao,
Sheldon.
Comment 7 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-27 02:44:38 UTC
State Changed
From-To: open->closed

Committed and merged onto RELENG_4 in time for 4.5-RELEASE.