From cb086a53b73901cf0dfc957915ff454a30f333b3 Mon Sep 17 00:00:00 2001
From: Kenneth D'souza <kdsouza@redhat.com>
Date: Tue, 19 Feb 2019 07:13:43 +0530
Subject: [PATCH 14/36] getcifsacl: Do not go to parse_sec_desc if getxattr
fails.
Add more to the error message by printing the filename and error.
Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
Reviewed-by: Steve French <stfrench@microsoft.com>
(cherry picked from commit 670f416d2c0d07a4d9ff469eb797e5bef624d863)
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
---
getcifsacl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/getcifsacl.c b/getcifsacl.c
index f08cdea..aaf15fa 100644
--- a/getcifsacl.c
+++ b/getcifsacl.c
@@ -398,8 +398,12 @@ cifsacl:
free(attrval);
bufsize += BUFSIZE;
goto cifsacl;
- } else
- printf("getxattr error: %d\n", errno);
+ } else {
+ 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);
--
1.8.3.1