* [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails.
@ 2019-02-19 1:43 Kenneth D'souza
2019-02-19 4:40 ` Steve French
0 siblings, 1 reply; 3+ messages in thread
From: Kenneth D'souza @ 2019-02-19 1:43 UTC (permalink / raw)
To: linux-cifs; +Cc: piastryyy, smfrench
Add more to the error message by printing the filename and error.
Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails.
2019-02-19 1:43 [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails Kenneth D'souza
@ 2019-02-19 4:40 ` Steve French
2019-03-09 0:37 ` Pavel Shilovsky
0 siblings, 1 reply; 3+ messages in thread
From: Steve French @ 2019-02-19 4:40 UTC (permalink / raw)
To: Kenneth D'souza; +Cc: CIFS, Pavel Shilovsky
Reviewed-by: Steve French <stfrench@microsoft.com>
On Mon, Feb 18, 2019 at 7:43 PM Kenneth D'souza <kdsouza@redhat.com> wrote:
>
> Add more to the error message by printing the filename and error.
>
> Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails.
2019-02-19 4:40 ` Steve French
@ 2019-03-09 0:37 ` Pavel Shilovsky
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Shilovsky @ 2019-03-09 0:37 UTC (permalink / raw)
To: Steve French; +Cc: Kenneth D'souza, CIFS
пн, 18 февр. 2019 г. в 20:40, Steve French <smfrench@gmail.com>:
>
> Reviewed-by: Steve French <stfrench@microsoft.com>
>
> On Mon, Feb 18, 2019 at 7:43 PM Kenneth D'souza <kdsouza@redhat.com> wrote:
> >
> > Add more to the error message by printing the filename and error.
> >
> > Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
> > ---
> > 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
> >
merged, thanks.
--
Best regards,
Pavel Shilovsky
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-09 0:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 1:43 [PATCH] getcifsacl: Do not go to parse_sec_desc if getxattr fails Kenneth D'souza
2019-02-19 4:40 ` Steve French
2019-03-09 0:37 ` Pavel Shilovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).