Re: [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Steve French <stfrench@xxxxxxxxxxxxx>

On Mon, Feb 18, 2019 at 7:43 PM Kenneth D'souza <kdsouza@xxxxxxxxxx> wrote:
>
> Add more to the error message by printing the filename and error.
>
> Signed-off-by: Kenneth D'souza <kdsouza@xxxxxxxxxx>
> ---
>  getcifsacl.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/getcifsacl.c b/getcifsacl.c
> index f08cdea..7f6e673 100644
> --- a/getcifsacl.c
> +++ b/getcifsacl.c
> @@ -399,7 +399,12 @@ cifsacl:
>                         bufsize += BUFSIZE;
>                         goto cifsacl;
>                 } else
> -                       printf("getxattr error: %d\n", errno);
> +               {
> +                       fprintf(stderr, "getxattr failed on %s: %s\n", filename, strerror(errno) );
> +                       free(attrval);
> +                       ret = -1;
> +                       goto out;
> +               }
>         }
>
>         parse_sec_desc((struct cifs_ntsd *)attrval, attrlen, raw);
> --
> 2.20.1
>


-- 
Thanks,

Steve



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux