mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-21 21:25: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))
|
||||
if [ $# -gt 0 ]; then
|
||||
while [ $# -gt 0 ]; do
|
||||
fix_xattrs "$1"
|
||||
shift $((OPTIND - 1))
|
||||
for arg in "$@"
|
||||
do
|
||||
fix_xattrs "$arg"
|
||||
done
|
||||
else
|
||||
if [ ${UNSAFE} -eq 1 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user