mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tools: fix iterating over argv when recovering xattr
The libvirt_recover_xattrs.sh tool hangs when run. When no flags are provided OPTIND is 1, so the loop expands to 'shift 0' which has not effect. Rewrite to just loop over $@ instead which involves less cleverness. Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
010613cfd8
commit
e674218dc2
@ -106,9 +106,9 @@ fix_xattrs() {
|
|||||||
|
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
while [ $# -gt 0 ]; do
|
for arg in "$@"
|
||||||
fix_xattrs "$1"
|
do
|
||||||
shift $((OPTIND - 1))
|
fix_xattrs "$arg"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
if [ ${UNSAFE} -eq 1 ]; then
|
if [ ${UNSAFE} -eq 1 ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user