Debian Bug report logs - #173456
sftp: batch mode does not abort as documented

version graph

Package: ssh; Maintainer for ssh is Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>; Source for ssh is src:openssh (PTS, buildd, popcon).

Reported by: Robert Bihlmeyer <robbe@orcus.priv.at>

Date: Tue, 17 Dec 2002 17:03:01 UTC

Severity: normal

Found in version 1:3.5p1-2

Done: Colin Watson <cjwatson@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://bugzilla.mindrot.org/show_bug.cgi?id=452

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org:
Bug#173456; Package ssh. (full text, mbox, link).


Acknowledgement sent to Robert Bihlmeyer <robbe@orcus.priv.at>:
New Bug report received and forwarded. Copy sent to Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Robert Bihlmeyer <robbe@orcus.priv.at>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: sftp: batch mode does not abort as documented
Date: 17 Dec 2002 17:50:52 +0100
Package: ssh
Version: 1:3.5p1-2
Severity: normal

From sftp(1):

     -b batchfile
             Batch mode reads a series of commands from an input batchfile
             instead of stdin.  Since it lacks user interaction it should be
             used in conjunction with non-interactive authentication.  sftp
             will abort if any of the following commands fail: get, put,
             rename, ln, rm, mkdir, chdir, lchdir and lmkdir.

Aborting does not work, sftp keeps executing commands from the batchfile.

-- System Information
Debian Release: testing/unstable
Kernel Version: Linux hoss 2.4.18-hoss #1 Tue Sep 24 20:49:25 CEST 2002 i686 unknown unknown GNU/Linux

Versions of the packages ssh depends on:
ii  adduser        3.48           Add and remove users and groups
ii  debconf        1.2.20         Debian configuration management system
ii  libc6          2.3.1-5        GNU C Library: Shared libraries and Timezone
ii  libpam-modules 0.76-8         Pluggable Authentication Modules for PAM
ii  libpam0g       0.76-8         Pluggable Authentication Modules library
ii  libssl0.9.6    0.9.6g-10      SSL shared libraries
ii  libwrap0       7.6-ipv6.1-3   Wietse Venema's TCP wrappers library
ii  zlib1g         1.1.4-8        compression library - runtime

-- 
Robbe



Information forwarded to debian-bugs-dist@lists.debian.org, Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org:
Bug#173456; Package ssh. (full text, mbox, link).


Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org. (full text, mbox, link).


Message #10 received at 173456@bugs.debian.org (full text, mbox, reply):

From: Colin Watson <cjwatson@debian.org>
To: Robert Bihlmeyer <robbe@orcus.priv.at>, 173456@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#173456: sftp: batch mode does not abort as documented
Date: Tue, 17 Dec 2002 17:38:57 +0000
forwarded 173456 http://bugzilla.mindrot.org/show_bug.cgi?id=452
thanks

On Tue, Dec 17, 2002 at 05:50:52PM +0100, Robert Bihlmeyer wrote:
> Package: ssh
> Version: 1:3.5p1-2
> Severity: normal
> 
> >From sftp(1):
> 
>      -b batchfile
>              Batch mode reads a series of commands from an input batchfile
>              instead of stdin.  Since it lacks user interaction it should be
>              used in conjunction with non-interactive authentication.  sftp
>              will abort if any of the following commands fail: get, put,
>              rename, ln, rm, mkdir, chdir, lchdir and lmkdir.
> 
> Aborting does not work, sftp keeps executing commands from the batchfile.

This has been reported upstream as bug #452 ("sftp does not abort when
commands given via -b fail").

Thanks,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Noted your statement that Bug has been forwarded to http://bugzilla.mindrot.org/show_bug.cgi?id=452. Request was from Colin Watson <cjwatson@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org:
Bug#173456; Package ssh. (full text, mbox, link).


Acknowledgement sent to Robert Bihlmeyer <robbe@orcus.priv.at>:
Extra info received and forwarded to list. Copy sent to Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org. (full text, mbox, link).


Message #17 received at 173456@bugs.debian.org (full text, mbox, reply):

From: Robert Bihlmeyer <robbe@orcus.priv.at>
To: 173456@bugs.debian.org
Subject: sftp: batch mode does not abort as documented
Date: 21 Dec 2002 12:38:26 +0100
tags + 173456 patch
thanks

> This has been reported upstream as bug #452.

Ah, thanks! I'd participate there, but am refusing to create accounts
for every package on which I report bugs. Silly bureaucrazilla. So I'll
keep my comments here (feel free to forward them, of course):

The following "-b" script should work if everything ran as documented:

  get the-remote-file
  rm the-remote-file

In the status quo it can incur dataloss (and did for me, aargh!) if
the get fails for some reason (e.g. disk full).

The appended patch fixes the some cases, and should point people in
the right direction. There are still more places where process_get
will return -1 (which will not lead to abort). Either all these get
changed to 1, or -- as it seems the intention is not to abort on every
error -- the manpage documents exactly in which cases an abort will
happen. The current situation is just bad.

I'd be most satisfied with a "abort on every miniscule error" switch,
akin to sh's -e.

-- 
Robbe
Wasn't sh's-e the 34th emperor of the snake people of Omicron Perseii 5?



Information forwarded to debian-bugs-dist@lists.debian.org, Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org:
Bug#173456; Package ssh. (full text, mbox, link).


Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org. (full text, mbox, link).


Message #22 received at 173456@bugs.debian.org (full text, mbox, reply):

From: Colin Watson <cjwatson@debian.org>
To: Robert Bihlmeyer <robbe@orcus.priv.at>, 173456@bugs.debian.org
Subject: Re: Bug#173456: sftp: batch mode does not abort as documented
Date: Sun, 29 Dec 2002 21:20:57 +0000
On Sat, Dec 21, 2002 at 12:38:26PM +0100, Robert Bihlmeyer wrote:
> tags + 173456 patch
> thanks
> 
> > This has been reported upstream as bug #452.
> 
> Ah, thanks! I'd participate there, but am refusing to create accounts
> for every package on which I report bugs. Silly bureaucrazilla. So I'll
> keep my comments here (feel free to forward them, of course):

I'll certainly forward your comments if you actually send the patch. :-)

Thanks,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Information forwarded to debian-bugs-dist@lists.debian.org, Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org:
Bug#173456; Package ssh. (full text, mbox, link).


Acknowledgement sent to Robert Bihlmeyer <robbe@orcus.priv.at>:
Extra info received and forwarded to list. Copy sent to Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org. (full text, mbox, link).


Message #27 received at 173456@bugs.debian.org (full text, mbox, reply):

From: Robert Bihlmeyer <robbe@orcus.priv.at>
To: Colin Watson <cjwatson@debian.org>
Cc: 173456@bugs.debian.org
Subject: Re: Bug#173456: sftp: batch mode does not abort as documented
Date: 30 Dec 2002 01:13:53 +0100
[Message part 1 (text/plain, inline)]
Colin Watson <cjwatson@debian.org> writes:

> I'll certainly forward your comments if you actually send the patch. :-)

Whoops, here goes:

[Message part 2 (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Robbe

Information forwarded to debian-bugs-dist@lists.debian.org, Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org:
Bug#173456; Package ssh. (full text, mbox, link).


Acknowledgement sent to Colin Watson <cjwatson@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthew Vernon <matthew@debian.org>, openssh@packages.qa.debian.org. (full text, mbox, link).


Message #32 received at 173456@bugs.debian.org (full text, mbox, reply):

From: Colin Watson <cjwatson@debian.org>
To: Robert Bihlmeyer <robbe@orcus.priv.at>
Cc: 173456@bugs.debian.org
Subject: Re: Bug#173456: sftp: batch mode does not abort as documented
Date: Mon, 30 Dec 2002 00:19:11 +0000
On Mon, Dec 30, 2002 at 01:13:53AM +0100, Robert Bihlmeyer wrote:
> Colin Watson <cjwatson@debian.org> writes:
> > I'll certainly forward your comments if you actually send the patch. :-)
> 
> Whoops, here goes:

Thanks, I've appended this to the upstream bug.

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply sent to Colin Watson <cjwatson@debian.org>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Robert Bihlmeyer <robbe@orcus.priv.at>:
Bug acknowledged by developer. (full text, mbox, link).


Message #37 received at 173456-done@bugs.debian.org (full text, mbox, reply):

From: Colin Watson <cjwatson@debian.org>
To: 173456-done@bugs.debian.org
Subject: Re: sftp: batch mode does not abort as documented
Date: Sat, 5 Apr 2003 13:40:54 +0100
On Tue, Dec 17, 2002 at 05:50:52PM +0100, Robert Bihlmeyer wrote:
> Package: ssh
> Version: 1:3.5p1-2
> Severity: normal
> 
> >From sftp(1):
> 
>      -b batchfile
>              Batch mode reads a series of commands from an input batchfile
>              instead of stdin.  Since it lacks user interaction it should be
>              used in conjunction with non-interactive authentication.  sftp
>              will abort if any of the following commands fail: get, put,
>              rename, ln, rm, mkdir, chdir, lchdir and lmkdir.
> 
> Aborting does not work, sftp keeps executing commands from the batchfile.

This is fixed as of 1:3.6p1-1. Upstream says:

  ------- Additional Comment #4 From Damien Miller  2003-01-09 10:51 -------
  
  Fixed in CVS. Any error in any command will now be considered a fatal error,
  unless you prefix the command with a '-' sign.
  
  E.g.
  
  put /tmp/existing 
  -put /tmp/nonexisting
  put /tmp/existing2
  
  will run to completion

And here's the CVS log entry:

  PatchSet 2961
  Date: 2003/01/10 10:40:00
  Author: djm
  Log:
   - (djm) OpenBSD CVS Sync
     - djm@cvs.openbsd.org 2003/01/08 23:53:26
       [sftp.1 sftp.c sftp-int.c sftp-int.h]
       Cleanup error handling for batchmode
       Allow blank lines and comments in input
       Ability to suppress abort on error in batchmode ("-put blah")
       Fixes mindrot bug #452; markus@ ok
  
  Members:
          ChangeLog:1.2558->1.2559
          sftp-int.c:1.39->1.40
          sftp-int.h:1.5->1.6
          sftp.1:1.35->1.36
          sftp.c:1.32->1.33

Thanks,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Mar 25 17:21:48 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.