bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug report [tar-1.13]


From: Atsushi Naito
Subject: bug report [tar-1.13]
Date: Thu, 16 Nov 2000 14:19:48 +0900

Hi, GNU tar maintainers

I found a part that seems to be a bug in tar-1.13 source code.

I executed tar on Solaris 2.6 in order to back up some files
to remote tape device
# /usr/local/bin/tar cvf remotehost:/dev/rmt/0n files

then it said below and back up failed.
sh: unknown host
tar: Cannot open remotehost:/dev/rmt/0n: I/O error
tar: Error is not recoverable: exiting now


[rtapelib.c]
00416:      remote_shell_basename = base_name (remote_shell);
00417:    if (remote_shell_basename)
00418:      remote_shell_basename++;
00419:    else
00420:      remote_shell_basename = remote_shell;
...
00457:        if (remote_user)
00457:          execl (remote_shell, remote_shell_basename, remote_host,
00457:                 "-l", remote_user, "/etc/rmt", (char *) 0);
00457:        else
00457:          execl (remote_shell, remote_shell_basename, remote_host,
00457:                 "/etc/rmt", (char *) 0);

remote_shell is pointing to "/usr/bin/rsh" on Solaris.
remote_shell_basename should be "rsh".
and remote_shell_basename is made to be "sh" in the next step.
the arguments of execl is to be ("/usr/bin/rsh", "sh", "remotehost", ...).

Solaris rsh seems to think of argv[0](that is "sh") as remote
host instead of rsh itself.
# It's a strange behavior to me ....

prior to 1.13, the line of 'remote_shell_basename = ....' is
'remote_shell_basename = strrchr(remote_shell, '/')'.
so remote_shell_basename should be "/rsh" and next step is
correct.

Is it a really bug ?


Regards
---
 Atsushi Naito (address@hidden)
 below is patch


*** rtapelib.c.orig     Thu Nov 16 13:55:32 2000
--- rtapelib.c  Thu Nov 16 14:09:14 2000
***************
*** 414,422 ****
  #endif
        }
      remote_shell_basename = base_name (remote_shell);
!     if (remote_shell_basename)
!       remote_shell_basename++;
!     else
        remote_shell_basename = remote_shell;

      /* Set up the pipes for the `rsh' command, and fork.  */
--- 414,420 ----
  #endif
        }
      remote_shell_basename = base_name (remote_shell);
!     if (!remote_shell_basename)
        remote_shell_basename = remote_shell;

      /* Set up the pipes for the `rsh' command, and fork.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]