mirror of https://github.com/digint/btrbk
ssh_filter_btrbk: correctly handle --sudo option
parent
3b7ede773a
commit
da70158c24
|
@ -1,6 +1,8 @@
|
||||||
btrbk-current
|
btrbk-current
|
||||||
|
|
||||||
* MIGRATION
|
* MIGRATION
|
||||||
|
- If you call ssh_filter_btrbk.sh with "--sudo" option, make sure
|
||||||
|
to set "backend btrfs-progs-sudo" in btrbk.conf for this host.
|
||||||
- If "rate_limit" is enabled, update ssh_filter_btrbk.sh on remote
|
- If "rate_limit" is enabled, update ssh_filter_btrbk.sh on remote
|
||||||
source hosts, and make sure the "pv" command is available there.
|
source hosts, and make sure the "pv" command is available there.
|
||||||
* Allow converting backup disks to source disks (close #114).
|
* Allow converting backup disks to source disks (close #114).
|
||||||
|
|
|
@ -89,7 +89,8 @@ Log ACCEPT and REJECT messages to the system log.
|
||||||
.PP
|
.PP
|
||||||
\-\-sudo
|
\-\-sudo
|
||||||
.RS 4
|
.RS 4
|
||||||
Call SSH_ORIGINAL_COMMAND using sudo.
|
Allow btrfs commands to be called via sudo. Enable this if you have
|
||||||
|
"backend btrfs-progs-sudo" in your btrbk configuration file.
|
||||||
.RE
|
.RE
|
||||||
.SH AVAILABILITY
|
.SH AVAILABILITY
|
||||||
Please refer to the btrbk project page \fBhttp://digint.ch/btrbk/\fR
|
Please refer to the btrbk project page \fBhttp://digint.ch/btrbk/\fR
|
||||||
|
|
|
@ -89,8 +89,12 @@ reject_filtered_cmd()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# FIXME: "--sudo" must be set before all other options!
|
# check for "--sudo" option before processing other options
|
||||||
sudo_prefix=
|
sudo_prefix=
|
||||||
|
for key; do
|
||||||
|
[[ "$key" == "--sudo" ]] && sudo_prefix="sudo -n "
|
||||||
|
done
|
||||||
|
|
||||||
while [[ "$#" -ge 1 ]]; do
|
while [[ "$#" -ge 1 ]]; do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
||||||
|
@ -100,7 +104,7 @@ while [[ "$#" -ge 1 ]]; do
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--sudo)
|
--sudo)
|
||||||
sudo_prefix="sudo -n "
|
# already processed above
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-p|--restrict-path)
|
-p|--restrict-path)
|
||||||
|
|
Loading…
Reference in New Issue