From lucifer@orac.xyzzy.net.au  Sat Jan 11 02:32:17 1997
Received: from orac.xyzzy.net.au (orac.maths.uq.oz.au [130.102.160.13])
          by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id CAA09602
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Jan 1997 02:32:11 -0800 (PST)
Received: (from lucifer@localhost) by orac.xyzzy.net.au (8.8.4/0.0.0) id UAA06434; Sat, 11 Jan 1997 20:31:38 +1000 (EST)
Message-Id: <199701111031.UAA06434@orac.xyzzy.net.au>
Date: Sat, 11 Jan 1997 20:31:38 +1000 (EST)
From: David Conran <lucifer@xyzzy.net.au>
Reply-To: lucifer@xyzzy.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: Problem in interactive restore.
X-Send-Pr-Version: 3.2

>Number:         2446
>Category:       bin
>Synopsis:       Problem in interactive restore.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 11 02:40:01 PST 1997
>Closed-Date:    Fri Jan 24 22:32:19 MST 1997
>Last-Modified:  Fri Jan 24 22:33:44 MST 1997
>Originator:     David Conran
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Dept. of Mathematics UofQ
>Environment:

day old sup, scsi tape drive
dump done on a 2.2-snap

>Description:

interactive restore of a 2.2 dump seems to fail with a nasty message.

orac:/tmp$ restore ivf /dev/nrst1
Verify tape and initialize maps
Tape block size is 32
Dump   date: Mon Jan  6 00:39:10 1997
Dumped from: the epoch
Level 0 dump of /usr on orac.xyzzy.net.au:/dev/sd0e
Label: none
Extract directories from tape
Initialize symbol table.
restore > cd include
canonname: not enough bufferspace
orac:/tmp$ 

but:
restore xvf /dev/nrst1 include/dlfcn.h

worked fine.

the old 2.2-snap version of restore worked as per normal
>How-To-Repeat:

dump /usr to tape
restore ivf /dev/nrstX
cd include

>Fix:
	
    don't use the interactive part of restore .. or use the old 2.2 binary
>Release-Note:
>Audit-Trail:

From: j@uriah.heep.sax.de (J Wunsch)
To: lucifer@xyzzy.net.au
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/2446: Problem in interactive restore.
Date: Sat, 11 Jan 1997 14:45:18 +0100

 As David Conran wrote:
 
 > orac:/tmp$ restore ivf /dev/nrst1
 > Verify tape and initialize maps
 > Tape block size is 32
 > Dump   date: Mon Jan  6 00:39:10 1997
 > Dumped from: the epoch
 > Level 0 dump of /usr on orac.xyzzy.net.au:/dev/sd0e
 > Label: none
 > Extract directories from tape
 > Initialize symbol table.
 > restore > cd include
 > canonname: not enough bufferspace
 
 Can you perhaps track this with gdb?  Interactive restore works fine
 for me (and worked all the time), so i probably have a hard time to
 reproduce this.
 
 (Hint: send followups to your PR to freebsd-gnats-submit@freebsd.org,
 using the same subject.)
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)

From: David Conran <lucifer@maths.uq.oz.au>
To: joerg_wunsch@uriah.heep.sax.de
Cc: lucifer@xyzzy.net.au, FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/2446: Problem in interactive restore.
Date: Sun, 12 Jan 1997 13:24:06 +1000 (EST)

 J Wunsch writes ...
 > 
 > As David Conran wrote:
 > 
 > > orac:/tmp$ restore ivf /dev/nrst1
 > > Verify tape and initialize maps
 > > Tape block size is 32
 > > Dump   date: Mon Jan  6 00:39:10 1997
 > > Dumped from: the epoch
 > > Level 0 dump of /usr on orac.xyzzy.net.au:/dev/sd0e
 > > Label: none
 > > Extract directories from tape
 > > Initialize symbol table.
 > > restore > cd include
 > > canonname: not enough bufferspace
 > 
 > Can you perhaps track this with gdb?  Interactive restore works fine
 > for me (and worked all the time), so i probably have a hard time to
 > reproduce this.
 > 
 > (Hint: send followups to your PR to freebsd-gnats-submit@freebsd.org,
 > using the same subject.)
 
 Well .. I just re-suped and recompiled restore .. and did it off a very
 recent (ie. 3.0-current) dump
 
 I am no gdb expert .. so .. here is my stuff.
 (if there is something else to do .. let me know.)
 Thanks.
 
 
 orac:/tmp$ gdb /home/src/sbin/restore/restore
 GDB is free software and you are welcome to distribute copies of it
  under certain conditions; type "show copying" to see the conditions.
 There is absolutely no warranty for GDB; type "show warranty" for details.
 GDB 4.13 (i386-unknown-freebsd),
 Copyright 1994 Free Software Foundation, Inc...
 (gdb) set args ivf /dev/nrst1
 (gdb) break canon
 Breakpoint 1 at 0x2821: file interactive.c, line 447.
 (gdb) run
 Starting program: /home/src/sbin/restore/restore ivf /dev/nrst1
 Verify tape and initialize maps
 Tape block size is 32
 Dump   date: Sun Jan 12 01:14:28 1997
 Dumped from: the epoch
 Level 0 dump of /usr on orac.xyzzy.net.au:/dev/sd0e
 Label: none
 Extract directories from tape
 Initialize symbol table.
 
 Breakpoint 1, canon (rawname=0x1b00 "/", canonname=0xefbfcd5c "", len=1024)
     at interactive.c:447
 447             if (strcmp(rawname, ".") == 0 || strncmp(rawname, "./", 2) == 0)
 (gdb) step
 449             else if (rawname[0] == '/')
 (gdb) step
 450                     (void) strcpy(canonname, ".");
 (gdb) step
 453             if (strlen(canonname) + strlen(rawname) >= len) {
 (gdb) step
 458             (void) strcat(canonname, rawname);
 (gdb) step
 462             for (cp = np = canonname; *np != '\0'; cp++) {
 (gdb) step
 463                     *cp = *np++;
 (gdb) step
 464                     while (*cp == '/' && *np == '/')
 (gdb) step
 462             for (cp = np = canonname; *np != '\0'; cp++) {
 (gdb) step
 463                     *cp = *np++;
 (gdb) step
 464                     while (*cp == '/' && *np == '/')
 (gdb) step
 462             for (cp = np = canonname; *np != '\0'; cp++) {
 (gdb) step
 467             *cp = '\0';
 (gdb) step
 468             if (*--cp == '/')
 (gdb) step
 469                     *cp = '\0';
 (gdb) step
 473             for (np = canonname; *np != '\0'; ) {
 (gdb) step
 474                     np++;
 (gdb) step
 475                     cp = np;
 (gdb) step
 476                     while (*np != '/' && *np != '\0')
 (gdb) step
 478                     if (np - cp == 1 && *cp == '.') {
 (gdb) step
 483                     if (np - cp == 2 && strncmp(cp, "..", 2) == 0) {
 (gdb) step
 491     }
 (gdb) step
 runcmdshell () at interactive.c:114
 114             if (setjmp(reset) != 0) {
 (gdb) step
 123             runshell = 1;
 (gdb) step
 124             getcmd(curdir, cmd, name, &arglist);
 (gdb) step
 getcmd (curdir=0xefbfcd5c ".", cmd=0xefbfc55c "", name=0xefbfc95c "",
     ap=0xefbfd15c) at interactive.c:315
 315             if (ap->argcnt > 0)
 (gdb) step
 317             if (nextarg != NULL)
 (gdb) step
 323                     fprintf(stderr, "restore > ");
 (gdb) step
 324                     (void) fflush(stderr);
 (gdb) step
 restore > 325                   (void) fgets(input, BUFSIZ, terminal);
 (gdb) step
 cd include
 326             } while (!feof(terminal) && input[0] == '\n');
 (gdb) c
 Continuing.
 
 Breakpoint 1, canon (rawname=0xefbfc13c "./include", canonname=0xefbfc95c "",
     len=4) at interactive.c:447
 447             if (strcmp(rawname, ".") == 0 || strncmp(rawname, "./", 2) == 0)
 (gdb) step
 448                     (void) strcpy(canonname, "");
 (gdb) step
 453             if (strlen(canonname) + strlen(rawname) >= len) {
 (gdb) step
 454                     fprintf(stderr, "canonname: not enough bufferspace\n");
 (gdb) step
 canonname: not enough bufferspace
 455                     done(1);
 (gdb) step
 done (exitcode=1) at dirs.c:765
 765             closemt();
 (gdb) quit
 The program is running.  Quit anyway (and kill it)? (y or n) y
 orac:/tmp$  
 
 
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Fri Jan 24 22:32:19 MST 1997 
State-Changed-Why:  

Fixed in interactive.c rev 1.3 and 1.1.1.1.8.3 
>Unformatted:
