Date: Sat, 27 Oct 2001 08:32:05 +1000 (EST) From: =?iso-8859-1?q?Paul=20Jansen?= <vlaero@yahoo.com.au> To: Ruslan Ermilov <ru@FreeBSD.org>, Boris Popov <bp@FreeBSD.org> Cc: questions@FreeBSD.org, ports@FreeBSD.org Subject: Re: smbfs bug? Message-ID: <20011026223205.53731.qmail@web12907.mail.yahoo.com> In-Reply-To: <20011022185147.D31361@sunbay.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ru@FreeBSD.org> 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-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011026223205.53731.qmail>
