From owner-freebsd-ports Fri Oct 26 15:32:16 2001 Delivered-To: freebsd-ports@freebsd.org Received: from web12907.mail.yahoo.com (web12907.mail.yahoo.com [216.136.174.74]) by hub.freebsd.org (Postfix) with SMTP id D957537B407 for ; Fri, 26 Oct 2001 15:32:05 -0700 (PDT) Message-ID: <20011026223205.53731.qmail@web12907.mail.yahoo.com> Received: from [203.38.128.182] by web12907.mail.yahoo.com via HTTP; Sat, 27 Oct 2001 08:32:05 EST Date: Sat, 27 Oct 2001 08:32:05 +1000 (EST) From: =?iso-8859-1?q?Paul=20Jansen?= Subject: Re: smbfs bug? To: Ruslan Ermilov , Boris Popov Cc: questions@FreeBSD.org, ports@FreeBSD.org In-Reply-To: <20011022185147.D31361@sunbay.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi Ruslan. Sorry about the delayed reply. I changed the lines you referenced in the following locations: /usr/ports/net/smbfs/work/smbfs-1.4.1/kernel/netsmb/smb_conn.h /usr/ports/net/smbfs/work/smbfs-1.4.1/lib/smb/ctx.c From here (/usr/ports/net/smbfs/work/smbfs-1.4.1) I did a 'make' then a 'make install'. I also found 'smb_conn.h' in the following location so I changed that as well: /usr/src/sys/netsmb/smb_conn.h I then recompiled and re-installed my kernel. mount_smbfs still gave the error it did before about the name being too long. I also trying re-making the port from the '/usr/ports/net/smbfs' directory but this didn't seem to do anything. I am a bit of a novice at this so please bear with with. Any hints? Thanks, Paul --- Ruslan Ermilov wrote: > On Tue, Oct 23, 2001 at 01:22:05AM +1000, Paul > Jansen wrote: > > I'm wondering whether I've come across a bug in > smbfs. > > I've maanged to get this working at home and it's > > doing a great job. I brought one of my FreeBSD > boxes > > into work tongight and plugged it into the LAN > with > > the intention of showing smbfs to one of my > > co-workers. I tried attaching to a workstation on > the > > network and got the following error: > > > > "mount_smbfs: server name 'auadwesm1511625' too > long" > > > > This NT workstation works fine on our network so I > > know that it isn't a problem. As I mentioned > earlier > > I've used smbfs successfully at home but that > with > > with machines that had netbios names less than 15 > > characters in length. > > I know that netbios names can be 16 characters in > > length but that the 16th character is a reserved > > 'special' character used to denote a particular > > function. 15 character netbios names for machines > are > > perfectly legal - does smbfs have a bug? > > > Seems like a bug. > > kernel/netsmb/smb.h:#define SMB_MAXSRVNAMELEN 15 > /* NetBIOS limit */ > lib/smb/ctx.c: if (strlen(name) >= > SMB_MAXSRVNAMELEN) { > lib/smb/ctx.c- smb_error("server name '%s' > too long", 0, name); > > The attached patch (untested) should fix this. > Make sure to apply smb_conn.h patch in > /usr/src/sys/net/netsmb, > if you have this directory, and recompile smbfs KLD > and/or > your kernel (if you have it compiled in statically). > > > 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 > > diff --exclude=CVS -ru > smbfs-1.4.1/kernel/netsmb/smb_conn.h > smbfs-1.4.1/kernel/netsmb/smb_conn.h > --- smbfs-1.4.1/kernel/netsmb/smb_conn.h Tue Apr 10 > 08:37:22 2001 > +++ smbfs-1.4.1/kernel/netsmb/smb_conn.h Mon Oct 22 > 18:47:08 2001 > @@ -148,7 +148,7 @@ > int flags; > enum smbiod_state iodstate; > struct smb_sopt sopt; > - char srvname[SMB_MAXSRVNAMELEN]; > + char srvname[SMB_MAXSRVNAMELEN + 1]; > char vcname[128]; > }; > > diff --exclude=CVS -ru smbfs-1.4.1/lib/smb/ctx.c > smbfs-1.4.1/lib/smb/ctx.c > --- smbfs-1.4.1/lib/smb/ctx.c Fri Apr 6 18:47:14 > 2001 > +++ smbfs-1.4.1/lib/smb/ctx.c Mon Oct 22 18:47:16 > 2001 > @@ -266,7 +266,7 @@ > int > smb_ctx_setserver(struct smb_ctx *ctx, const char > *name) > { > - if (strlen(name) >= SMB_MAXSRVNAMELEN) { > + if (strlen(name) > SMB_MAXSRVNAMELEN) { > smb_error("server name '%s' too long", 0, name); > return ENAMETOOLONG; > } > http://briefcase.yahoo.com.au - Yahoo! Briefcase - Manage your files online. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message