diff options
-rw-r--r-- | usr.sbin/getextattr/getextattr.c | 11 | ||||
-rw-r--r-- | usr.sbin/setextattr/setextattr.c | 7 |
2 files changed, 8 insertions, 10 deletions
diff --git a/usr.sbin/getextattr/getextattr.c b/usr.sbin/getextattr/getextattr.c index c16cf41..677b6fb 100644 --- a/usr.sbin/getextattr/getextattr.c +++ b/usr.sbin/getextattr/getextattr.c @@ -54,7 +54,6 @@ usage(void) int main(int argc, char *argv[]) { - struct iovec iov_buf; char *attrname; char buf[BUFSIZE]; char visbuf[BUFSIZE*4]; @@ -93,12 +92,14 @@ main(int argc, char *argv[]) argc--; argv++; - iov_buf.iov_base = buf; - iov_buf.iov_len = BUFSIZE; - + /* + * XXX: Note: now that EAs support querying the size, we could + * actually allocate a buffer of the right size, rather than + * truncating at BUFSIZE. + */ for (arg_counter = 1; arg_counter < argc; arg_counter++) { error = extattr_get_file(argv[arg_counter], attrnamespace, - attrname, &iov_buf, 1); + attrname, buf, BUFSIZE); if (error == -1) perror(argv[arg_counter]); diff --git a/usr.sbin/setextattr/setextattr.c b/usr.sbin/setextattr/setextattr.c index df7be4f..de68e68 100644 --- a/usr.sbin/setextattr/setextattr.c +++ b/usr.sbin/setextattr/setextattr.c @@ -52,7 +52,6 @@ usage(void) int main(int argc, char *argv[]) { - struct iovec iov_buf; int error, attrnamespace; if (argc != 5) @@ -64,10 +63,8 @@ main(int argc, char *argv[]) return (-1); } - iov_buf.iov_base = argv[4]; - iov_buf.iov_len = strlen(argv[4]); - - error = extattr_set_file(argv[3], attrnamespace, argv[2], &iov_buf, 1); + error = extattr_set_file(argv[3], attrnamespace, argv[2], argv[4], + strlen(argv[4])); if (error == -1) { perror(argv[3]); return (-1); |