#2406 Issue closed: OUTPUT_LFTP_OPTIONS does not work for setting connection details

Labels: fixed / solved / done, minor bug

gozora opened issue at 2020-05-25 12:34:

  • ReaR version ("/usr/sbin/rear -V"): Current upstream master (after https://github.com/rear/rear/pull/2384)

  • OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"): SUSE Linux Enterprise Server 12 SP3

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

...
OUTPUT_LFTP_OPTIONS="set sftp:connect-program \"ssh -o StrictHostKeyChecking=no -x -a -i $BORGBACKUP_SSH_KEY -l borg \""
...
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR): VirtualBox

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device): x86 compatible

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot): UEFI

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe): local disk

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):

# lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT
NAME                                    KNAME     PKNAME   TRAN   TYPE FSTYPE       SIZE MOUNTPOINT
/dev/sda                                /dev/sda           sata   disk               50G 
|-/dev/sda1                             /dev/sda1 /dev/sda        part vfat         148M /boot/efi
|-/dev/sda2                             /dev/sda2 /dev/sda        part swap           2G [SWAP]
`-/dev/sda3                             /dev/sda3 /dev/sda        part btrfs       47.9G /
  • Description of the issue (ideally so that others can reproduce it):
    When using OUTPUT_LFTP_OPTIONS to setup sftp connection details, options are ignored because OUTPUT_LFTP_OPTIONS variable is evaluated after connection is opened.

In other words:

lftp -c "open $OUTPUT_URL; $OUTPUT_LFTP_OPTIONS mput $result_file"

opens connection to $OUTPUT_URL and set options afterwards, this is however too late if one want to set e.g. sftp:connect-program for lftp, because connection options have to set before actual connection is made.

@vigri do you see any issue when $OUTPUT_LFTP_OPTIONS is moved BEFORE lftp open as follows?

- lftp -c "open $OUTPUT_URL; $OUTPUT_LFTP_OPTIONS mput $result_file"
+ lftp -c "$OUTPUT_LFTP_OPTIONS; open $OUTPUT_URL; mput ${RESULT_FILES[*]}"

vigri commented at 2020-05-26 06:53:

This shouldn't be a problem.
I've made a quick successful test with
lftp -d -c 'set ssl:verify-certificate no set ftp:ssl-protect-data true set ftp:ssl-force true; open USERNAME:PASSWORD@SERVER;

gozora commented at 2020-05-26 07:08:

@vigri thanks!
I'll prepare PR today.

V.

jsmeix commented at 2020-05-28 09:24:

With https://github.com/rear/rear/pull/2410 merged
I assume this issue can be closed as fixed.

gozora commented at 2020-05-28 09:56:

@jsmeix thanks, I've forgotten about this issue!

V.


[Export of Github issue for rear/rear.]