PERFORCE change 79991 for review

Robert Watson rwatson at FreeBSD.org
Mon Jul 11 13:36:20 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=79991

Change 79991 by rwatson at 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);
 }
 
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