diff options
author | Kenneth D'souza <kdsouza@redhat.com> | 2019-02-19 07:13:43 +0530 |
---|---|---|
committer | Pavel Shilovsky <pshilov@microsoft.com> | 2019-03-08 16:23:04 -0800 |
commit | 670f416d2c0d07a4d9ff469eb797e5bef624d863 (patch) | |
tree | 65482cabbc438b6e8b492a4966b257bff322e9cf | |
parent | b3f78f6dc200f61418d3d6c256ec116c3137ffee (diff) | |
download | cifs-utils-670f416d2c0d07a4d9ff469eb797e5bef624d863.tar.gz cifs-utils-670f416d2c0d07a4d9ff469eb797e5bef624d863.tar.bz2 cifs-utils-670f416d2c0d07a4d9ff469eb797e5bef624d863.zip |
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>
-rw-r--r-- | getcifsacl.c | 8 |
1 files 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); |