PERFORCE change 84091 for review

Robert Watson rwatson at FreeBSD.org
Wed Sep 21 22:40:39 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=84091

Change 84091 by rwatson at rwatson_peppercorn on 2005/09/21 22:39:47

	Move more things back from the POSIX.1e acl include file to the
	general ACL include file -- I intended for acl_posix1e.h to be
	for POSIX.1e semantics for ACLs, rather than APIs, since we hope
	to use the POSIX.1e API to manage non-POSIX.1e ACLs.  This notion
	will require some refinement.

Affected files ...

.. //depot/projects/trustedbsd/acl_nfsv4/src/sys/sys/acl.h#5 edit
.. //depot/projects/trustedbsd/acl_nfsv4/src/sys/sys/acl_posix1e.h#3 edit

Differences ...

==== //depot/projects/trustedbsd/acl_nfsv4/src/sys/sys/acl.h#5 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2005 Robert N. M. Watson
+ * Copyright (c) 1999-2001, 2005 Robert N. M. Watson
  * All rights reserved.
  *
  * This software was developed by Robert Watson for the TrustedBSD Project.
@@ -29,7 +29,10 @@
  */
 /*
  * Developed by the TrustedBSD Project.
- * Meta-include file to pull in definitions for various ACL types.
+ *
+ * This include file contains ACL type independent data structures and
+ * definitions, as well as pulling in definitions from particular types of
+ * ACLs.
  */
 
 #ifndef _SYS_ACL_H_
@@ -38,4 +41,122 @@
 #include <sys/acl_nfsv4.h>
 #include <sys/acl_posix1e.h>
 
+/*
+ * Types, data structures, and constants that are abstracted across all
+ * supported ACL types.
+ */
+typedef int	acl_type_t;
+typedef int	acl_tag_t;
+typedef mode_t	acl_perm_t;
+typedef mode_t *acl_permset_t;
+
+struct acl_entry {
+	acl_tag_t	ae_tag;
+	uid_t		ae_id;
+	acl_perm_t	ae_perm;
+};
+typedef struct acl_entry	*acl_entry_t;
+
+/* internal ACL structure */
+struct acl {
+	int			acl_cnt;
+	struct acl_entry	acl_entry[ACL_MAX_ENTRIES];
+};
+
+/* external ACL structure */
+struct acl_t_struct {
+	struct acl		ats_acl;
+	int			ats_cur_entry;
+};
+typedef struct acl_t_struct *acl_t;
+
+/*
+ * Possible valid values for acl_type_t arguments.
+ */
+#define	ACL_TYPE_ACCESS		0x00000000
+#define	ACL_TYPE_DEFAULT	0x00000001
+
+/*
+ * Possible entry_id values for acl_get_entry()
+ */
+#define	ACL_FIRST_ENTRY		0
+#define	ACL_NEXT_ENTRY		1
+
+/*
+ * Undefined value in ae_id field
+ */
+#define	ACL_UNDEFINED_ID	((uid_t)-1)
+
+#ifndef _KERNEL
+/*
+ * Syscall interface -- use the library calls instead as the syscalls
+ * have strict acl entry ordering requirements.
+ */
+__BEGIN_DECLS
+int	__acl_aclcheck_fd(int _filedes, acl_type_t _type, struct acl *_aclp);
+int	__acl_aclcheck_file(const char *_path, acl_type_t _type,
+	    struct acl *_aclp);
+int	__acl_aclcheck_link(const char *_path, acl_type_t _type,
+	    struct acl *_aclp);
+int	__acl_delete_fd(int _filedes, acl_type_t _type);
+int	__acl_delete_file(const char *_path_p, acl_type_t _type);
+int	__acl_delete_link(const char *_path_p, acl_type_t _type);
+int	__acl_get_fd(int _filedes, acl_type_t _type, struct acl *_aclp);
+int	__acl_get_file(const char *_path, acl_type_t _type, struct acl *_aclp);
+int	__acl_get_link(const char *_path, acl_type_t _type, struct acl *_aclp);
+int	__acl_set_fd(int _filedes, acl_type_t _type, struct acl *_aclp);
+int	__acl_set_file(const char *_path, acl_type_t _type, struct acl *_aclp);
+int	__acl_set_link(const char *_path, acl_type_t _type, struct acl *_aclp);
+__END_DECLS
+
+/*
+ * Supported POSIX.1e ACL manipulation and assignment/retrieval API
+ * _np calls are local extensions that reflect an environment capable of
+ * opening file descriptors of directories, and allowing additional
+ * ACL type for different filesystems (i.e., AFS).
+ */
+__BEGIN_DECLS
+int	acl_add_perm(acl_permset_t _permset_d, acl_perm_t _perm);
+int	acl_calc_mask(acl_t *_acl_p);
+int	acl_clear_perms(acl_permset_t _permset_d);
+int	acl_copy_entry(acl_entry_t _dest_d, acl_entry_t _src_d);
+ssize_t	acl_copy_ext(void *_buf_p, acl_t _acl, ssize_t _size);
+acl_t	acl_copy_int(const void *_buf_p);
+int	acl_create_entry(acl_t *_acl_p, acl_entry_t *_entry_p);
+int	acl_delete_entry(acl_t _acl, acl_entry_t _entry_d);
+int	acl_delete_fd_np(int _filedes, acl_type_t _type);
+int	acl_delete_file_np(const char *_path_p, acl_type_t _type);
+int	acl_delete_link_np(const char *_path_p, acl_type_t _type);
+int	acl_delete_def_file(const char *_path_p);
+int	acl_delete_def_link_np(const char *_path_p);
+int	acl_delete_perm(acl_permset_t _permset_d, acl_perm_t _perm);
+acl_t	acl_dup(acl_t _acl);
+int	acl_free(void *_obj_p);
+acl_t	acl_from_text(const char *_buf_p);
+int	acl_get_entry(acl_t _acl, int _entry_id, acl_entry_t *_entry_p);
+acl_t	acl_get_fd(int _fd);
+acl_t	acl_get_fd_np(int fd, acl_type_t _type);
+acl_t	acl_get_file(const char *_path_p, acl_type_t _type);
+acl_t	acl_get_link_np(const char *_path_p, acl_type_t _type);
+void	*acl_get_qualifier(acl_entry_t _entry_d);
+int	acl_get_perm_np(acl_permset_t _permset_d, acl_perm_t _perm);
+int	acl_get_permset(acl_entry_t _entry_d, acl_permset_t *_permset_p);
+int	acl_get_tag_type(acl_entry_t _entry_d, acl_tag_t *_tag_type_p);
+acl_t	acl_init(int _count);
+int	acl_set_fd(int _fd, acl_t _acl);
+int	acl_set_fd_np(int _fd, acl_t _acl, acl_type_t _type);
+int	acl_set_file(const char *_path_p, acl_type_t _type, acl_t _acl);
+int	acl_set_link_np(const char *_path_p, acl_type_t _type, acl_t _acl);
+int	acl_set_permset(acl_entry_t _entry_d, acl_permset_t _permset_d);
+int	acl_set_qualifier(acl_entry_t _entry_d, const void *_tag_qualifier_p);
+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);
+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);
+int	acl_valid_link_np(const char *_path_p, acl_type_t _type, acl_t _acl);
+__END_DECLS
+#endif /* !_KERNEL */
+
 #endif /* !_SYS_ACL_H_ */

==== //depot/projects/trustedbsd/acl_nfsv4/src/sys/sys/acl_posix1e.h#3 (text+ko) ====

@@ -49,31 +49,6 @@
 #define	POSIX1E_ACL_DEFAULT_EXTATTR_NAME	"posix1e.acl_default"
 #define	ACL_MAX_ENTRIES		32 /* maximum entries in an ACL */
 
-typedef int	acl_type_t;
-typedef int	acl_tag_t;
-typedef mode_t	acl_perm_t;
-typedef mode_t *acl_permset_t;
-
-struct acl_entry {
-	acl_tag_t	ae_tag;
-	uid_t		ae_id;
-	acl_perm_t	ae_perm;
-};
-typedef struct acl_entry	*acl_entry_t;
-
-/* internal ACL structure */
-struct acl {
-	int			acl_cnt;
-	struct acl_entry	acl_entry[ACL_MAX_ENTRIES];
-};
-
-/* external ACL structure */
-struct acl_t_struct {
-	struct acl		ats_acl;
-	int			ats_cur_entry;
-};
-typedef struct acl_t_struct *acl_t;
-
 /*
  * Possible valid values for ae_tag field.
  */
@@ -87,12 +62,6 @@
 #define	ACL_OTHER_OBJ		ACL_OTHER
 
 /*
- * Possible valid values for acl_type_t arguments.
- */
-#define	ACL_TYPE_ACCESS		0x00000000
-#define	ACL_TYPE_DEFAULT	0x00000001
-
-/*
  * Possible flags in ae_perm field.
  */
 #define	ACL_EXECUTE		0x0001
@@ -147,78 +116,6 @@
  */
 int			acl_posix1e_check(struct acl *acl);
 
-#else /* !_KERNEL */
-
-/*
- * Syscall interface -- use the library calls instead as the syscalls
- * have strict acl entry ordering requirements.
- */
-__BEGIN_DECLS
-int	__acl_aclcheck_fd(int _filedes, acl_type_t _type, struct acl *_aclp);
-int	__acl_aclcheck_file(const char *_path, acl_type_t _type,
-	    struct acl *_aclp);
-int	__acl_aclcheck_link(const char *_path, acl_type_t _type,
-	    struct acl *_aclp);
-int	__acl_delete_fd(int _filedes, acl_type_t _type);
-int	__acl_delete_file(const char *_path_p, acl_type_t _type);
-int	__acl_delete_link(const char *_path_p, acl_type_t _type);
-int	__acl_get_fd(int _filedes, acl_type_t _type, struct acl *_aclp);
-int	__acl_get_file(const char *_path, acl_type_t _type, struct acl *_aclp);
-int	__acl_get_link(const char *_path, acl_type_t _type, struct acl *_aclp);
-int	__acl_set_fd(int _filedes, acl_type_t _type, struct acl *_aclp);
-int	__acl_set_file(const char *_path, acl_type_t _type, struct acl *_aclp);
-int	__acl_set_link(const char *_path, acl_type_t _type, struct acl *_aclp);
-__END_DECLS
-
-/*
- * Supported POSIX.1e ACL manipulation and assignment/retrieval API
- * _np calls are local extensions that reflect an environment capable of
- * opening file descriptors of directories, and allowing additional
- * ACL type for different filesystems (i.e., AFS).
- */
-__BEGIN_DECLS
-int	acl_add_perm(acl_permset_t _permset_d, acl_perm_t _perm);
-int	acl_calc_mask(acl_t *_acl_p);
-int	acl_clear_perms(acl_permset_t _permset_d);
-int	acl_copy_entry(acl_entry_t _dest_d, acl_entry_t _src_d);
-ssize_t	acl_copy_ext(void *_buf_p, acl_t _acl, ssize_t _size);
-acl_t	acl_copy_int(const void *_buf_p);
-int	acl_create_entry(acl_t *_acl_p, acl_entry_t *_entry_p);
-int	acl_delete_entry(acl_t _acl, acl_entry_t _entry_d);
-int	acl_delete_fd_np(int _filedes, acl_type_t _type);
-int	acl_delete_file_np(const char *_path_p, acl_type_t _type);
-int	acl_delete_link_np(const char *_path_p, acl_type_t _type);
-int	acl_delete_def_file(const char *_path_p);
-int	acl_delete_def_link_np(const char *_path_p);
-int	acl_delete_perm(acl_permset_t _permset_d, acl_perm_t _perm);
-acl_t	acl_dup(acl_t _acl);
-int	acl_free(void *_obj_p);
-acl_t	acl_from_text(const char *_buf_p);
-int	acl_get_entry(acl_t _acl, int _entry_id, acl_entry_t *_entry_p);
-acl_t	acl_get_fd(int _fd);
-acl_t	acl_get_fd_np(int fd, acl_type_t _type);
-acl_t	acl_get_file(const char *_path_p, acl_type_t _type);
-acl_t	acl_get_link_np(const char *_path_p, acl_type_t _type);
-void	*acl_get_qualifier(acl_entry_t _entry_d);
-int	acl_get_perm_np(acl_permset_t _permset_d, acl_perm_t _perm);
-int	acl_get_permset(acl_entry_t _entry_d, acl_permset_t *_permset_p);
-int	acl_get_tag_type(acl_entry_t _entry_d, acl_tag_t *_tag_type_p);
-acl_t	acl_init(int _count);
-int	acl_set_fd(int _fd, acl_t _acl);
-int	acl_set_fd_np(int _fd, acl_t _acl, acl_type_t _type);
-int	acl_set_file(const char *_path_p, acl_type_t _type, acl_t _acl);
-int	acl_set_link_np(const char *_path_p, acl_type_t _type, acl_t _acl);
-int	acl_set_permset(acl_entry_t _entry_d, acl_permset_t _permset_d);
-int	acl_set_qualifier(acl_entry_t _entry_d, const void *_tag_qualifier_p);
-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);
-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);
-int	acl_valid_link_np(const char *_path_p, acl_type_t _type, acl_t _acl);
-__END_DECLS
-
 #endif /* !_KERNEL */
 
 #endif /* !_SYS_ACL_POSIX1E_H_ */
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list