PERFORCE change 22501 for review
Robert Watson
rwatson at freebsd.org
Thu Dec 19 03:25:35 GMT 2002
http://perforce.freebsd.org/chv.cgi?CH=22501
Change 22501 by rwatson at rwatson_paprika on 2002/12/18 19:25:20
Implement ACL system calls for symlinks; mostly just wrapping.
Affected files ...
.. //depot/projects/trustedbsd/acl/sys/kern/kern_acl.c#2 edit
Differences ...
==== //depot/projects/trustedbsd/acl/sys/kern/kern_acl.c#2 (text+ko) ====
@@ -700,6 +700,28 @@
}
/*
+ * Given a file path, get an ACL for it; don't follow links.
+ *
+ * MPSAFE
+ */
+int
+__acl_get_link(struct thread *td, struct __acl_get_link_args *uap)
+{
+ struct nameidata nd;
+ int error;
+
+ mtx_lock(&Giant);
+ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
+ error = namei(&nd);
+ if (error == 0) {
+ error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp);
+ NDFREE(&nd, 0);
+ }
+ mtx_unlock(&Giant);
+ return (error);
+}
+
+/*
* Given a file path, set an ACL for it
*
* MPSAFE
@@ -722,6 +744,28 @@
}
/*
+ * Given a file path, set an ACL for it; don't follow links.
+ *
+ * MPSAFE
+ */
+int
+__acl_set_link(struct thread *td, struct __acl_set_link_args *uap)
+{
+ struct nameidata nd;
+ int error;
+
+ mtx_lock(&Giant);
+ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
+ error = namei(&nd);
+ if (error == 0) {
+ error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp);
+ NDFREE(&nd, 0);
+ }
+ mtx_unlock(&Giant);
+ return (error);
+}
+
+/*
* Given a file descriptor, get an ACL for it
*
* MPSAFE
@@ -788,6 +832,28 @@
}
/*
+ * Given a file path, delete an ACL from it; don't follow links.
+ *
+ * MPSAFE
+ */
+int
+__acl_delete_link(struct thread *td, struct __acl_delete_link_args *uap)
+{
+ struct nameidata nd;
+ int error;
+
+ mtx_lock(&Giant);
+ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
+ error = namei(&nd);
+ if (error == 0) {
+ error = vacl_delete(td, nd.ni_vp, uap->type);
+ NDFREE(&nd, 0);
+ }
+ mtx_unlock(&Giant);
+ return (error);
+}
+
+/*
* Given a file path, delete an ACL from it.
*
* MPSAFE
@@ -832,6 +898,28 @@
}
/*
+ * Given a file path, check an ACL for it; don't follow links.
+ *
+ * MPSAFE
+ */
+int
+__acl_aclcheck_link(struct thread *td, struct __acl_aclcheck_link_args *uap)
+{
+ struct nameidata nd;
+ int error;
+
+ mtx_lock(&Giant);
+ NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
+ error = namei(&nd);
+ if (error == 0) {
+ error = vacl_aclcheck(td, nd.ni_vp, uap->type, uap->aclp);
+ NDFREE(&nd, 0);
+ }
+ mtx_unlock(&Giant);
+ return (error);
+}
+
+/*
* Given a file descriptor, check an ACL for it
*
* MPSAFE
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