diff mbox series

[v2,1/2] xfs_admin: correctly parse IO_OPTS parameters

Message ID 20230126003311.7736-2-catherine.hoang@oracle.com (mailing list archive)
State Accepted
Headers show
Series xfs_admin: get/set label of mounted filesystems | expand

Commit Message

Catherine Hoang Jan. 26, 2023, 12:33 a.m. UTC
Change exec to eval so that the IO_OPTS parameters are parsed correctly
when the parameters contain quotations.

Fixes: e7cd89b2da72 ("xfs_admin: get UUID of mounted filesystem")
Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
---
 db/xfs_admin.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Allison Henderson Jan. 26, 2023, 6:02 p.m. UTC | #1
On Wed, 2023-01-25 at 16:33 -0800, Catherine Hoang wrote:
> Change exec to eval so that the IO_OPTS parameters are parsed
> correctly
> when the parameters contain quotations.
> 
> Fixes: e7cd89b2da72 ("xfs_admin: get UUID of mounted filesystem")
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Looks good to me
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>

> ---
>  db/xfs_admin.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/db/xfs_admin.sh b/db/xfs_admin.sh
> index b73fb3ad..3a7f44ea 100755
> --- a/db/xfs_admin.sh
> +++ b/db/xfs_admin.sh
> @@ -69,7 +69,8 @@ case $# in
>                         fi
>  
>                         if [ -n "$IO_OPTS" ]; then
> -                               exec xfs_io -p xfs_admin $IO_OPTS
> "$mntpt"
> +                               eval xfs_io -p xfs_admin $IO_OPTS
> "$mntpt"
> +                               exit $?
>                         fi
>                 fi
>
Carlos Maiolino Feb. 3, 2023, 12:44 p.m. UTC | #2
On Wed, Jan 25, 2023 at 04:33:10PM -0800, Catherine Hoang wrote:
> Change exec to eval so that the IO_OPTS parameters are parsed correctly
> when the parameters contain quotations.
> 
> Fixes: e7cd89b2da72 ("xfs_admin: get UUID of mounted filesystem")
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>

Looks good, thanks Catherine..

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  db/xfs_admin.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/db/xfs_admin.sh b/db/xfs_admin.sh
> index b73fb3ad..3a7f44ea 100755
> --- a/db/xfs_admin.sh
> +++ b/db/xfs_admin.sh
> @@ -69,7 +69,8 @@ case $# in
>  			fi
> 
>  			if [ -n "$IO_OPTS" ]; then
> -				exec xfs_io -p xfs_admin $IO_OPTS "$mntpt"
> +				eval xfs_io -p xfs_admin $IO_OPTS "$mntpt"
> +				exit $?
>  			fi
>  		fi
> 
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/db/xfs_admin.sh b/db/xfs_admin.sh
index b73fb3ad..3a7f44ea 100755
--- a/db/xfs_admin.sh
+++ b/db/xfs_admin.sh
@@ -69,7 +69,8 @@  case $# in
 			fi
 
 			if [ -n "$IO_OPTS" ]; then
-				exec xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+				eval xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+				exit $?
 			fi
 		fi