PERFORCE change 144381 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Mon Jun 30 20:04:46 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=144381
Change 144381 by trasz at trasz_traszkan on 2008/06/30 20:04:27
Backout more stuff.
Affected files ...
.. //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/Makefile#3 edit
.. //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/ace.c#3 delete
.. //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/getfacl.1#4 edit
.. //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/getfacl.c#4 edit
Differences ...
==== //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/Makefile#3 (text+ko) ====
@@ -1,6 +1,5 @@
# $FreeBSD: src/bin/getfacl/Makefile,v 1.6 2001/12/04 01:57:44 obrien Exp $
PROG= getfacl
-SRCS= getfacl.c ace.c
.include <bsd.prog.mk>
==== //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/getfacl.1#4 (text+ko) ====
@@ -38,7 +38,7 @@
.Nd get ACL information
.Sh SYNOPSIS
.Nm
-.Op Fl dhqv
+.Op Fl dhq
.Op Ar
.Sh DESCRIPTION
The
@@ -68,8 +68,6 @@
Do not write commented information about file name and ownership.
This is
useful when dealing with filenames with unprintable characters.
-.It Fl v
-For the NFSv4 ACLs, return the ACL in verbose form.
.El
.Pp
The following operand is available:
==== //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/getfacl.c#4 (text+ko) ====
@@ -54,7 +54,7 @@
usage(void)
{
- fprintf(stderr, "getfacl [-dhqv] [file ...]\n");
+ fprintf(stderr, "getfacl [-dhq] [file ...]\n");
}
static char *
@@ -174,24 +174,8 @@
return(acl);
}
-int load_aces(char *path, ace_t *acesp[], int *nentriesp);
-int print_aces_aligned_nicely(const ace_t *ace, int nentries, int compact);
-
-int
-print_nfsv4_acl(char *path, int verbose)
-{
- int ret, nentries = -1;
- ace_t *aces;
-
- ret = load_aces(path, &aces, &nentries);
- if (ret)
- return (-1);
-
- return (print_aces_aligned_nicely(aces, nentries, !verbose));
-}
-
static int
-print_acl(char *path, acl_type_t type, int hflag, int qflag, int vflag)
+print_acl(char *path, acl_type_t type, int hflag, int qflag)
{
struct stat sb;
acl_t acl;
@@ -216,9 +200,6 @@
printf("# file: %s\n# owner: %s\n# group: %s\n", path,
getuname(sb.st_uid), getgname(sb.st_gid));
- if (pathconf(path, _ACL_ACE_ENABLED))
- return (print_nfsv4_acl(path, vflag));
-
if (hflag)
acl = acl_get_link_np(path, type);
else
@@ -253,7 +234,7 @@
}
static int
-print_acl_from_stdin(acl_type_t type, int hflag, int qflag, int vflag)
+print_acl_from_stdin(acl_type_t type, int hflag, int qflag)
{
char *p, pathname[PATH_MAX];
int carried_error = 0;
@@ -261,7 +242,7 @@
while (fgets(pathname, (int)sizeof(pathname), stdin)) {
if ((p = strchr(pathname, '\n')) != NULL)
*p = '\0';
- if (print_acl(pathname, type, hflag, qflag, vflag) == -1) {
+ if (print_acl(pathname, type, hflag, qflag) == -1) {
carried_error = -1;
}
}
@@ -275,12 +256,11 @@
acl_type_t type = ACL_TYPE_ACCESS;
int carried_error = 0;
int ch, error, i;
- int hflag, qflag, vflag;
+ int hflag, qflag;
hflag = 0;
qflag = 0;
- vflag = 0;
- while ((ch = getopt(argc, argv, "dhqv")) != -1)
+ while ((ch = getopt(argc, argv, "dhq")) != -1)
switch(ch) {
case 'd':
type = ACL_TYPE_DEFAULT;
@@ -291,9 +271,6 @@
case 'q':
qflag = 1;
break;
- case 'v':
- vflag = 1;
- break;
default:
usage();
return(-1);
@@ -302,17 +279,17 @@
argv += optind;
if (argc == 0) {
- error = print_acl_from_stdin(type, hflag, qflag, vflag);
+ error = print_acl_from_stdin(type, hflag, qflag);
return(error ? 1 : 0);
}
for (i = 0; i < argc; i++) {
if (!strcmp(argv[i], "-")) {
- error = print_acl_from_stdin(type, hflag, qflag, vflag);
+ error = print_acl_from_stdin(type, hflag, qflag);
if (error == -1)
carried_error = -1;
} else {
- error = print_acl(argv[i], type, hflag, qflag, vflag);
+ error = print_acl(argv[i], type, hflag, qflag);
if (error == -1)
carried_error = -1;
}
More information about the p4-projects
mailing list