[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] setfacl: preserve the failed status when processing multiple
From: |
Andreas Grünbacher |
Subject: |
Re: [PATCH] setfacl: preserve the failed status when processing multiple files |
Date: |
Thu, 5 Oct 2023 12:50:05 +0200 |
Am Do., 5. Okt. 2023 um 11:21 Uhr schrieb Lukáš Zaoral <lzaoral@redhat.com>:
> From: Renaud Metrich <rmetrich@redhat.com>
>
> Resolves the following bug:
> ```
> $ mkdir FOO
> $ setfacl -m d:g:user:rwX -m g:user:rwX ./FOO/bar ./FOO
> setfacl: ./FOO/bar: No such file or directory
> $ echo $?
> 0
> ```
> ---
> tools/setfacl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/setfacl.c b/tools/setfacl.c
> index fd0bf2e..fd32692 100644
> --- a/tools/setfacl.c
> +++ b/tools/setfacl.c
> @@ -555,7 +555,7 @@ int main(int argc, char *argv[])
> goto synopsis;
> saw_files = 1;
>
> - status = next_file(optarg, seq);
> + status |= next_file(optarg, seq);
> break;
>
> case 'B': /* restore ACL backup */
> @@ -642,7 +642,7 @@ int main(int argc, char *argv[])
> goto synopsis;
> saw_files = 1;
>
> - status = next_file(argv[optind++], seq);
> + status |= next_file(argv[optind++], seq);
> }
> if (!saw_files)
> goto synopsis;
> --
> 2.41.0
Applied (after changing this so that the first non-zero status value
is retained rather than doing bitwise or).
Thanks,
Andreas