Message ID | 20190219014343.29526-1-kdsouza@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | getcifsacl: Do not go to parse_sec_desc if getxattr fails. | expand |
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 >
пн, 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
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);
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(-)