Date: Wed, 18 Dec 2002 19:25:35 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 22501 for review Message-ID: <200212190325.gBJ3PZdQ049022@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=22501 Change 22501 by rwatson@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@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212190325.gBJ3PZdQ049022>