summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-02-10 04:48:26 +0000
committerrwatson <rwatson@FreeBSD.org>2002-02-10 04:48:26 +0000
commit8055280c8a39e1b8582720773d6ad24624647131 (patch)
tree96433847050072755ffd54dd4cb754fa827fd722 /usr.sbin
parent00cc7ae31839d4ec20bcf8814d74dcaac3b59cb6 (diff)
downloadFreeBSD-src-8055280c8a39e1b8582720773d6ad24624647131.zip
FreeBSD-src-8055280c8a39e1b8582720773d6ad24624647131.tar.gz
Update userland tools to reflect extattr API changes.
Note that getextattr has not yet been updated to dynamically allocate a read buffer, although that can now be done. Obtained from: TrustedBSD Project Sponsored by: NAI Labs
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/getextattr/getextattr.c11
-rw-r--r--usr.sbin/setextattr/setextattr.c7
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);
OpenPOWER on IntegriCloud