path: root/sys/sys/extattr.h
diff options
authorRobert Watson <rwatson@FreeBSD.org>2001-03-15 02:54:29 +0000
committerRobert Watson <rwatson@FreeBSD.org>2001-03-15 02:54:29 +0000
commit70f368510541308e762e29b6a936f6d26f0770b4 (patch)
tree1a2650bed4e2643e71609464406e13e707992215 /sys/sys/extattr.h
parentfff8dac495fde011c2d88115003beb67ba892b99 (diff)
o Change the API and ABI of the Extended Attribute kernel interfaces to
introduce a new argument, "namespace", rather than relying on a first- character namespace indicator. This is in line with more recent thinking on EA interfaces on various mailing lists, including the posix1e, Linux acl-devel, and trustedbsd-discuss forums. Two namespaces are defined by default, EXTATTR_NAMESPACE_SYSTEM and EXTATTR_NAMESPACE_USER, where the primary distinction lies in the access control model: user EAs are accessible based on the normal MAC and DAC file/directory protections, and system attributes are limited to kernel-originated or appropriately privileged userland requests. o These API changes occur at several levels: the namespace argument is introduced in the extattr_{get,set}_file() system call interfaces, at the vnode operation level in the vop_{get,set}extattr() interfaces, and in the UFS extended attribute implementation. Changes are also introduced in the VFS extattrctl() interface (system call, VFS, and UFS implementation), where the arguments are modified to include a namespace field, as well as modified to advoid direct access to userspace variables from below the VFS layer (in the style of recent changes to mount by adrian@FreeBSD.org). This required some cleanup and bug fixing regarding VFS locks and the VFS interface, as a vnode pointer may now be optionally submitted to the VFS_EXTATTRCTL() call. Updated documentation for the VFS interface will be committed shortly. o In the near future, the auto-starting feature will be updated to search two sub-directories to the ".attribute" directory in appropriate file systems: "user" and "system" to locate attributes intended for those namespaces, as the single filename is no longer sufficient to indicate what namespace the attribute is intended for. Until this is committed, all attributes auto-started by UFS will be placed in the EXTATTR_NAMESPACE_SYSTEM namespace. o The default POSIX.1e attribute names for ACLs and Capabilities have been updated to no longer include the '$' in their filename. As such, if you're using these features, you'll need to rename the attribute backing files to the same names without '$' symbols in front. o Note that these changes will require changes in userland, which will be committed shortly. These include modifications to the extended attribute utilities, as well as to libutil for new namespace string conversion routines. Once the matching userland changes are committed, a buildworld is recommended to update all the necessary include files and verify that the kernel and userland environments are in sync. Note: If you do not use extended attributes (most people won't), upgrading is not imperative although since the system call API has changed, the new userland extended attribute code will no longer compile with old include files. o Couple of minor cleanups while I'm there: make more code compilation conditional on FFS_EXTATTR, which should recover a bit of space on kernels running without EA's, as well as update copyright dates. Obtained from: TrustedBSD Project
Notes: svn path=/head/; revision=74273
Diffstat (limited to 'sys/sys/extattr.h')
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/sys/extattr.h b/sys/sys/extattr.h
index d03d4fb78537..4b545dafd74e 100644
--- a/sys/sys/extattr.h
+++ b/sys/sys/extattr.h
@@ -1,5 +1,5 @@
- * Copyright (c) 1999 Robert N. M. Watson
+ * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,12 @@
#ifndef _SYS_EXTATTR_H_
#define _SYS_EXTATTR_H_
+#define EXTATTR_NAMESPACE_USER 0x00000001
+#define EXTATTR_NAMESPACE_SYSTEM 0x00000002
#ifdef _KERNEL
@@ -51,12 +57,14 @@
struct iovec;
-int extattrctl(const char *path, int cmd, const char *attrname, char *arg);
-int extattr_delete_file(const char *path, const char *attrname);
-int extattr_get_file(const char *path, const char *attrname,
- struct iovec *iovp, unsigned iovcnt);
-int extattr_set_file(const char *path, const char *attrname,
- struct iovec *iovp, unsigned iovcnt);
+int extattrctl(const char *path, int cmd, const char *filename,
+ int namespace, const char *attrname);
+int extattr_delete_file(const char *path, int namespace,
+ const char *attrname);
+int extattr_get_file(const char *path, int namespace,
+ const char *attrname, struct iovec *iovp, unsigned iovcnt);
+int extattr_set_file(const char *path, int namespace,
+ const char *attrname, struct iovec *iovp, unsigned iovcnt);
#endif /* !_KERNEL */