Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-110002

scp can delete file if copying to local host

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • rhel-9.2.0
    • openssh
    • None
    • Yes
    • Low
    • rhel-security-crypto-diamonds
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

      What were you trying to do that didn't work?

      a testcase was trying to copy a file to itself, but on newer versions of openssh, the file is deleted instead.

      What is the impact of this issue to you?

      scp unexpectedly deletes a file

      Please provide the package NVR for which the bug is seen:

      How reproducible is this bug?:

      Steps to reproduce

      1. cat /tmp/a
        test_text
      2. scp host1:/tmp/a host1:/tmp/a
        a                                                            0%    0     0.0KB/s   -:- ETA
        2025-08-19-08.51.11 -0700 | Aug 19 08:51:11
         # ls -lart /tmp/a
        rw-rr- 1 root root 0 Aug 19 08:51 /tmp/a
      3. cat /tmp/a 
      1. rpm -qa | grep openssh
        openssh-8.7p1-45.el9.x86_64
        openssh-clients-8.7p1-45.el9.x86_64
        openssh-server-8.7p1-45.el9.x86_64

        Expected results

      Not to delete the file contents. This looks to be a regression with the move to sftp since this does not occur when you use the `-O` parameter.

       

      Note, this is not a practical thing to do, but it broke some automation we had so probably better to fix it.

      Actual results

              dbelyavs@redhat.com Dmitry Belyavskiy
              ryan_w55 Ryan Woodard (Inactive)
              IBM Confidential Group
              Dmitry Belyavskiy Dmitry Belyavskiy
              Miluse Bezo Konecna Miluse Bezo Konecna
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: