linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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).