From dim@tensor.xs4all.nl  Fri Dec 21 10:11:26 2001
Return-Path: <dim@tensor.xs4all.nl>
Received: from tensor.xs4all.nl (tensor.xs4all.nl [213.84.53.200])
	by hub.freebsd.org (Postfix) with ESMTP id 3F8F737B417
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 21 Dec 2001 10:11:26 -0800 (PST)
Received: by tensor.xs4all.nl (Postfix, from userid 1000)
	id 4B57E3E38; Fri, 21 Dec 2001 19:11:24 +0100 (CET)
Message-Id: <20011221181124.4B57E3E38@tensor.xs4all.nl>
Date: Fri, 21 Dec 2001 19:11:24 +0100 (CET)
From: Dimitry Andric <dim@xs4all.nl>
Reply-To: Dimitry Andric <dim@xs4all.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: /dev/nsmb* devices not created with make world
X-Send-Pr-Version: 3.113
X-GNATS-Notify: ru

>Number:         33068
>Category:       bin
>Synopsis:       /dev/nsmb* devices not created with make world
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 21 10:20:01 PST 2001
>Closed-Date:    Wed Dec 26 18:44:38 PST 2001
>Last-Modified:  Wed Dec 26 18:45:00 PST 2001
>Originator:     Dimitry Andric <dim@xs4all.nl>
>Release:        FreeBSD 4.5-PRERELEASE i386
>Organization:
n/a
>Environment:
System: FreeBSD tensor.xs4all.nl 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #0: Fri Dec 21 04:19:53 CET 2001 root@tensor.xs4all.nl:/usr/obj/usr/src/sys/TENSOR i386
>Description:
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.
>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.
>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.

diff -ud etc/MAKEDEV.orig etc/MAKEDEV
--- MAKEDEV.orig	Tue Dec 18 05:18:23 2001
+++ MAKEDEV	Fri Dec 21 18:54:32 2001
@@ -334,6 +334,7 @@
 	sh MAKEDEV i4btel0 i4btel1 i4bteld0 i4bteld1	# cdev, ISDN
 	sh MAKEDEV i4brbch0 i4brbch1			# cdev, ISDN
 	sh MAKEDEV agpgart				# cdev, AGP
+	sh MAKEDEV nsmb0 nsmb1				# cdev, smbfs device
 	;;
 
 # a much restricted set of the above, to save precious i-nodes on the
@@ -1799,6 +1800,11 @@
 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)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: ru 
Responsible-Changed-When: Fri Dec 21 11:44:46 PST 2001 
Responsible-Changed-Why:  
Sheldon, can we please fix this ASAP? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33068 

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Dimitry Andric <dim@xs4all.nl>
Cc: bug-followup@FreeBSD.org, Sheldon Hearn <sheldonh@FreeBSD.org>,
	Boris Popov <bp@FreeBSD.org>
Subject: Re: bin/33068: /dev/nsmb* devices not created with make world
Date: Fri, 21 Dec 2001 21:44:34 +0200

 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

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: Dimitry Andric <dim@xs4all.nl>, bug-followup@FreeBSD.org,
	Boris Popov <bp@FreeBSD.org>
Subject: Re: bin/33068: /dev/nsmb* devices not created with make world 
Date: Fri, 21 Dec 2001 21:56:46 +0200

 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.

From: Boris Popov <bp@butya.kz>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: Dimitry Andric <dim@xs4all.nl>, bug-followup@FreeBSD.org,
	Sheldon Hearn <sheldonh@FreeBSD.org>
Subject: Re: bin/33068: /dev/nsmb* devices not created with make world
Date: Sat, 22 Dec 2001 11:38:45 +0600 (ALMT)

 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
 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Boris Popov <bp@butya.kz>
Cc: Ruslan Ermilov <ru@FreeBSD.org>, Dimitry Andric <dim@xs4all.nl>,
	bug-followup@FreeBSD.org
Subject: Re: bin/33068: /dev/nsmb* devices not created with make world 
Date: Sun, 23 Dec 2001 22:56:13 +0200

 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.

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Boris Popov <bp@butya.kz>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/33068: /dev/nsmb* devices not created with make world 
Date: Wed, 26 Dec 2001 17:47:09 +0200

 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.
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Wed Dec 26 18:44:38 PST 2001 
State-Changed-Why:  
Committed and merged onto RELENG_4 in time for 4.5-RELEASE. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=33068 
>Unformatted:
