Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 2008 12:22:27 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 146202 for review
Message-ID:  <200807291222.m6TCMR3h008507@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146202

Change 146202 by trasz@trasz_traszkan on 2008/07/29 12:21:28

	Change the last argument for acl_to_text_np into proper flags field.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/getfacl.c#7 edit
.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_to_text.c#5 edit
.. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_to_text_nfs4.c#7 edit
.. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/acl.h#13 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/bin/getfacl/getfacl.c#7 (text+ko) ====

@@ -222,7 +222,10 @@
 		}
 	}
 
-	acl_text = acl_to_text_np(acl, 0, vflag);
+	if (vflag)
+		acl_text = acl_to_text_np(acl, 0, ACL_TEXT_VERBOSE);
+	else
+		acl_text = acl_to_text_np(acl, 0, 0);
 	if (!acl_text) {
 		warn("%s", path);
 		return(-1);

==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_to_text.c#5 (text+ko) ====

@@ -51,7 +51,7 @@
  * a non-POSIX.1e semantics ACL.
  */
 
-char *_nfs4_acl_to_text_np(const acl_t acl, ssize_t *len_p, int verbose);
+char *_nfs4_acl_to_text_np(const acl_t acl, ssize_t *len_p, int flags);
 
 static char *
 _posix1e_acl_to_text(acl_t acl, ssize_t *len_p)
@@ -240,14 +240,14 @@
 }
 
 char *
-acl_to_text_np(acl_t acl, ssize_t *len_p, int verbose)
+acl_to_text_np(acl_t acl, ssize_t *len_p, int flags)
 {
 	switch (_acl_brand(acl)) {
 	case ACL_BRAND_POSIX:
 		return (_posix1e_acl_to_text(acl, len_p));
 
 	case ACL_BRAND_NFS4:
-		return (_nfs4_acl_to_text_np(acl, len_p, verbose));
+		return (_nfs4_acl_to_text_np(acl, len_p, flags));
 
 	default:
 		errno = EINVAL;

==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_to_text_nfs4.c#7 (text+ko) ====

@@ -131,14 +131,17 @@
 }
 
 static int
-format_entry(char *str, size_t size, const acl_entry_t entry, int verbose)
+format_entry(char *str, size_t size, const acl_entry_t entry, int flags)
 {
 	size_t off = 0, padding_length, maximum_who_field_length = 18;
 	acl_permset_t permset;
 	acl_flagset_t flagset;
-	int error, len;
+	int error, len, verbose = 0;
 	char buf[MAX_ENTRY_LENGTH + 1];
 
+	if (flags & ACL_TEXT_VERBOSE)
+		verbose = 1;
+
 	assert(_entry_brand(entry) == ACL_BRAND_NFS4);
 
 	error = acl_get_flagset_np(entry, &flagset);
@@ -182,7 +185,7 @@
 }
 
 char *
-_nfs4_acl_to_text_np(const acl_t aclp, ssize_t *len_p, int verbose)
+_nfs4_acl_to_text_np(const acl_t aclp, ssize_t *len_p, int flags)
 {
 	int error, off = 0, size, entry_id = ACL_FIRST_ENTRY;
 	char *str;
@@ -201,7 +204,7 @@
 
 		assert(off < size);
 
-		error = format_entry(str + off, size - off, entry, verbose);
+		error = format_entry(str + off, size - off, entry, flags);
 		if (error) {
 			errno = EINVAL;
 			return (NULL);

==== //depot/projects/soc2008/trasz_nfs4acl/sys/sys/acl.h#13 (text+ko) ====

@@ -225,6 +225,10 @@
  */
 #define	ACL_UNDEFINED_ID	((uid_t)-1)
 
+/*
+ * Possible values for _flags parameter in acl_to_text_np(3).
+ */
+#define ACL_TEXT_VERBOSE	1
 
 #ifdef _KERNEL
 
@@ -346,7 +350,7 @@
 int	acl_set_tag_type(acl_entry_t _entry_d, acl_tag_t _tag_type);
 ssize_t	acl_size(acl_t _acl);
 char	*acl_to_text(acl_t _acl, ssize_t *_len_p);
-char	*acl_to_text_np(acl_t _acl, ssize_t *_len_p, int _verbose);
+char	*acl_to_text_np(acl_t _acl, ssize_t *_len_p, int _flags);
 int	acl_valid(acl_t _acl);
 int	acl_valid_fd_np(int _fd, acl_type_t _type, acl_t _acl);
 int	acl_valid_file_np(const char *_path_p, acl_type_t _type, acl_t _acl);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807291222.m6TCMR3h008507>