getcifsacl: Do not go to parse_sec_desc if getxattr fails.
authorKenneth D'souza <kdsouza@redhat.com>
Tue, 19 Feb 2019 01:43:43 +0000 (07:13 +0530)
committerPavel Shilovsky <pshilov@microsoft.com>
Sat, 9 Mar 2019 00:23:04 +0000 (16:23 -0800)
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>
getcifsacl.c

index f08cdea1ada81561253899401305aa06a80f0f9c..aaf15fa44f644ba7e4b77b6194d379cbf83e6fc3 100644 (file)
@@ -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);