#1678 Issue closed: 'cd somedir' without returning back in BORG/default/400_restore_backup.sh

Labels: bug, fixed / solved / done

jsmeix opened issue at 2018-01-04 14:35:

Current restore/BORG/default/400_restore_backup.sh does

cd $TARGET_FS_ROOT

but never returns from there to the usual working directory
where "rear recover" runs in.
Even if that somehow works it looks dangerous when
all subsequent scripts run with $TARGET_FS_ROOT
as the current working directory.
I suggest to use

pushd $TARGET_FS_ROOT
...
popd

cf. usr/share/rear/build/default/501_check_ssh_keys.sh
and usr/share/rear/pack/GNU/Linux/900_create_initramfs.sh

gozora commented at 2018-01-04 22:02:

@jsmeix thanks for pointing this out!
This could introduce some nasty surprises in the future indeed!
I'll correct it in upcoming days.

V.

gozora commented at 2018-01-23 11:54:

With https://github.com/rear/rear/pull/1698 merged, this issue can be closed!


[Export of Github issue for rear/rear.]