summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authormarks <none@none>2006-02-13 08:52:39 -0800
committermarks <none@none>2006-02-13 08:52:39 -0800
commit5a5eeccada4b11bc692e9a5015d5f4a4f188226c (patch)
tree93010db6eee0a810fa5cb60ee056f620f533a721 /usr/src/cmd
parentf00e6aa66b34910d24fa464cabb82f8e83f87bc8 (diff)
downloadillumos-joyent-5a5eeccada4b11bc692e9a5015d5f4a4f188226c.tar.gz
PSARC/2006/043 ls -V
PSARC/2006/047 acl_totext PSARC/2006/048 Compact chmod ACL syntax 6362641 tar does not store ACLs in a suitable format 6379909 Need compact ACL utility support for NFSv4/ZFS
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/bart/create.c4
-rw-r--r--usr/src/cmd/chmod/chmod.c8
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/rcp.c4
-rw-r--r--usr/src/cmd/cpio/cpio.c2
-rw-r--r--usr/src/cmd/ls/ls.c17
-rw-r--r--usr/src/cmd/tar/tar.c3
6 files changed, 22 insertions, 16 deletions
diff --git a/usr/src/cmd/bart/create.c b/usr/src/cmd/bart/create.c
index a676cd480b..c1eb95eca6 100644
--- a/usr/src/cmd/bart/create.c
+++ b/usr/src/cmd/bart/create.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -642,7 +642,7 @@ get_acl_string(const char *fname, const struct stat64 *statb, int *err_code)
(void) fprintf(stderr, "%s: %s\n", fname, acl_strerror(error));
return (safe_strdup("-"));
} else {
- acltext = acl_totext(aclp);
+ acltext = acl_totext(aclp, 0);
acl_free(aclp);
return (acltext);
}
diff --git a/usr/src/cmd/chmod/chmod.c b/usr/src/cmd/chmod/chmod.c
index 403d757dbd..8be3ff9373 100644
--- a/usr/src/cmd/chmod/chmod.c
+++ b/usr/src/cmd/chmod/chmod.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -429,7 +429,6 @@ parse_acl_args(char *arg, acl_args_t **acl_args)
{
acl_t *new_acl = NULL;
int slot;
- int error;
int len;
int action;
acl_args_t *new_acl_args;
@@ -478,9 +477,8 @@ parse_acl_args(char *arg, acl_args_t **acl_args)
return (1);
if (acl_spec) {
- if (error = acl_fromtext(acl_spec, &new_acl)) {
- errmsg(1, 1, "%s\n", acl_strerror(error));
- return (1);
+ if (acl_parse(acl_spec, &new_acl)) {
+ exit(1);
}
}
diff --git a/usr/src/cmd/cmd-inet/usr.bin/rcp.c b/usr/src/cmd/cmd-inet/usr.bin/rcp.c
index 7b76b8967a..057a0c7f1c 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/rcp.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/rcp.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1826,7 +1826,7 @@ sendacl(int f)
* imply its not trivial.
*/
if (aclp && (trivial != ACL_IS_TRIVIAL)) {
- acltext = acl_totext(aclp);
+ acltext = acl_totext(aclp, 0);
if (acltext == NULL) {
error("rcp: failed to convert to text\n");
acl_free(aclp);
diff --git a/usr/src/cmd/cpio/cpio.c b/usr/src/cmd/cpio/cpio.c
index 6f8e97a199..adfa8c53e6 100644
--- a/usr/src/cmd/cpio/cpio.c
+++ b/usr/src/cmd/cpio/cpio.c
@@ -6645,7 +6645,7 @@ append_secattr(
case ACLENT_T:
case ACE_T:
/* LINTED alignment */
- attrtext = acl_totext(aclp);
+ attrtext = acl_totext(aclp, ACL_APPEND_ID | ACL_COMPACT_FMT);
if (attrtext == NULL) {
(void) fprintf(stderr, "acltotext failed\n");
return (-1);
diff --git a/usr/src/cmd/ls/ls.c b/usr/src/cmd/ls/ls.c
index 540be3b046..50027cf4eb 100644
--- a/usr/src/cmd/ls/ls.c
+++ b/usr/src/cmd/ls/ls.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -221,6 +221,7 @@ static int Lflg;
static int Rflg;
static int Sflg;
static int vflg;
+static int Vflg;
static long hscale;
static mode_t flags;
static int err = 0; /* Contains return code */
@@ -287,7 +288,7 @@ main(int argc, char *argv[])
}
while ((c = getopt(argc, argv,
- "aAbcCdeEfFghHilLmnopqrRsStux1@v")) != EOF)
+ "aAbcCdeEfFghHilLmnopqrRsStux1@vV")) != EOF)
switch (c) {
case 'a':
aflg++;
@@ -416,6 +417,9 @@ main(int argc, char *argv[])
cflg = 0;
uflg++;
continue;
+ case 'V':
+ Vflg++;
+ /*FALLTHROUGH*/
case 'v':
vflg++;
#if !defined(XPG4)
@@ -460,7 +464,7 @@ main(int argc, char *argv[])
}
if (opterr) {
(void) fprintf(stderr, gettext(
- "usage: ls -aAbcCdeEfFghHilLmnopqrRsStuxv1@ [files]\n"));
+ "usage: ls -aAbcCdeEfFghHilLmnopqrRsStuxvV1@ [files]\n"));
exit(2);
}
@@ -868,7 +872,7 @@ pentry(struct lbuf *ap)
if (vflg) {
new_line();
if (p->aclp) {
- acl_printacl(p->aclp, num_cols);
+ acl_printacl(p->aclp, num_cols, Vflg);
}
}
}
@@ -1378,6 +1382,11 @@ gstat(char *file, int argfl, struct ditem *myparent)
}
}
+ if (!vflg && !Vflg && rep->aclp) {
+ acl_free(rep->aclp);
+ rep->aclp = NULL;
+ }
+
if (atflg && pathconf(file, _PC_XATTR_EXISTS) == 1)
rep->acl = '@';
} else
diff --git a/usr/src/cmd/tar/tar.c b/usr/src/cmd/tar/tar.c
index f1a132892e..92eb40a452 100644
--- a/usr/src/cmd/tar/tar.c
+++ b/usr/src/cmd/tar/tar.c
@@ -3025,7 +3025,6 @@ filedone:
/* header is 8 */
attrsize = 8 + (int)strlen(
&attr->attr_info[0]) + 1;
-
error =
acl_fromtext(
&attr->attr_info[0], &aclp);
@@ -5571,7 +5570,7 @@ append_secattr(
switch (acl_type(aclp)) {
case ACLENT_T:
case ACE_T:
- attrtext = acl_totext(aclp);
+ attrtext = acl_totext(aclp, ACL_APPEND_ID | ACL_COMPACT_FMT);
if (attrtext == NULL) {
(void) fprintf(stderr, "acltotext failed\n");
return (-1);