From owner-p4-projects@FreeBSD.ORG Mon Jul 11 13:36:22 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A897116A420; Mon, 11 Jul 2005 13:36:21 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 6570616A41C for ; Mon, 11 Jul 2005 13:36:21 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3256C43D46 for ; Mon, 11 Jul 2005 13:36:21 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6BDaLpJ052350 for ; Mon, 11 Jul 2005 13:36:21 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6BDaKSk052347 for perforce@freebsd.org; Mon, 11 Jul 2005 13:36:20 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 11 Jul 2005 13:36:20 GMT Message-Id: <200507111336.j6BDaKSk052347@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 To: Perforce Change Reviews Cc: Subject: PERFORCE change 79991 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2005 13:36:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=79991 Change 79991 by rwatson@rwatson_zoo on 2005/07/11 13:35:44 Let namei() do the copyin for the pathname in auditctl(2). Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#25 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#25 (text+ko) ==== @@ -1220,7 +1220,6 @@ int auditctl(struct thread *td, struct auditctl_args *uap) { - char *fn = NULL; struct nameidata nd; struct ucred *cred; struct vnode *vp; @@ -1242,13 +1241,8 @@ if (uap->path == NULL) return (EINVAL); - fn = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - error = copyinstr(uap->path, fn, MAXPATHLEN, NULL); - if (error != 0) - goto err_out; - mtx_lock(&Giant); - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fn, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, td); flags = audit_open_flags; error = vn_open(&nd, &flags, 0, -1); if (error) { @@ -1271,8 +1265,6 @@ audit_rotate_vnode(cred, vp); err_out: - if (fn) - free(fn, M_TEMP); return (error); }