From owner-p4-projects Wed Dec 18 19:25:40 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F006637B404; Wed, 18 Dec 2002 19:25:36 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A66737B401 for ; Wed, 18 Dec 2002 19:25:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 218E443E4A for ; Wed, 18 Dec 2002 19:25:36 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBJ3PZmV049025 for ; Wed, 18 Dec 2002 19:25:35 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBJ3PZdQ049022 for perforce@freebsd.org; Wed, 18 Dec 2002 19:25:35 -0800 (PST) Date: Wed, 18 Dec 2002 19:25:35 -0800 (PST) Message-Id: <200212190325.gBJ3PZdQ049022@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 22501 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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