Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jul 2005 13:36:20 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 79991 for review
Message-ID:  <200507111336.j6BDaKSk052347@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507111336.j6BDaKSk052347>