Skip to contentSkip to conversation

getcifsacl: Do not go to parse_sec_desc if getxattr fails.

PATCH In review Kenneth D'souza 3 participants 3 messages Feb 19, 2019 – Mar 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 getcifsacl: Do not go to parse_sec_desc if getxattr fails.

Add more to the error message by printing the filename and error.

---
 getcifsacl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
getcifsacl.c +6 -1
index f08cdea..7f6e673 100644
@@ -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);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Kenneth D'souza

Add more to the error message by printing the filename and error.

---
 getcifsacl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
getcifsacl.c +6 -2
index f08cdea..7f6e673 100644
@@ -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

Signature · 3 lines
Thanks,

Steve
#2 lore raw

пн, 18 февр. 2019 г. в 20:40, Steve French <[email protected]>:

Quoted 29 lines
Quoted 25 lines · Kenneth D'souza

Add more to the error message by printing the filename and error.

---
 getcifsacl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
getcifsacl.c +6 -1
index f08cdea..7f6e673 100644
@@ -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;
+               }
        }
 
Quoted 4 lines
Quoted 4 lines
getcifsacl.c +0 -1
        parse_sec_desc((struct cifs_ntsd *)attrval, attrlen, raw);
--

2.20.1

merged, thanks.
--
Best regards,
Pavel Shilovsky