Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2012 05:02:46 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Pawel Jakub Dawidek <pjd@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r243726 - in head/sys: kern security/audit
Message-ID:  <20121201030246.GB3013@kib.kiev.ua>
In-Reply-To: <201211302318.qAUNInIh074238@svn.freebsd.org>
References:  <201211302318.qAUNInIh074238@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--4zKt6bo/V7G+vDr7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Nov 30, 2012 at 11:18:49PM +0000, Pawel Jakub Dawidek wrote:
> Modified: head/sys/security/audit/audit_bsm_klib.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/security/audit/audit_bsm_klib.c	Fri Nov 30 23:13:56 2012	(r2=
43725)
> +++ head/sys/security/audit/audit_bsm_klib.c	Fri Nov 30 23:18:49 2012	(r2=
43726)
> @@ -462,13 +462,13 @@ auditon_command_event(int cmd)
>   * leave the filename starting with '/' in the audit log in this case.
>   */
>  void
> -audit_canon_path(struct thread *td, char *path, char *cpath)
> +audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath)
>  {
>  	struct vnode *cvnp, *rvnp;
>  	char *rbuf, *fbuf, *copy;
>  	struct filedesc *fdp;
>  	struct sbuf sbf;
> -	int error, cwir;
> +	int error, needslash, vfslocked;
> =20
>  	WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: at %s:%d",
>  	    __func__,  __FILE__, __LINE__);
> @@ -491,10 +491,27 @@ audit_canon_path(struct thread *td, char
>  	 * path.
>  	 */
>  	if (*path !=3D '/') {
> -		cvnp =3D fdp->fd_cdir;
> -		vhold(cvnp);
> +		if (dirfd =3D=3D AT_FDCWD) {
> +			cvnp =3D fdp->fd_cdir;
> +			vhold(cvnp);
> +		} else {
> +			/* XXX: fgetvp() that vhold()s vnode instead of vref()ing it would be=
 better */
This line is too long.
> +			error =3D fgetvp(td, dirfd, 0, &cvnp);
> +			if (error) {
> +				cpath[0] =3D '\0';
> +				if (rvnp !=3D NULL)
> +					vdrop(rvnp);
> +				return;
> +			}
> +			vhold(cvnp);
> +			vfslocked =3D VFS_LOCK_GIANT(cvnp->v_mount);
> +			vrele(cvnp);
> +			VFS_UNLOCK_GIANT(vfslocked);
And this cannot compile.

--4zKt6bo/V7G+vDr7
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQIcBAEBAgAGBQJQuXNVAAoJEJDCuSvBvK1Bgj8P+gJIDB0T09KV7mb1Nvf0L89j
D8AuwntTmYIkFb7LMyMlq268GrZaNAqiXE8kcPTlpI6aCegVHuGv5395fgdRjY+c
FG0kenH+nGLezyC5PYVwJXVgLmfIpmcaxWsArP3ukFSi3LiC8FSqmUfv9+/FQpw2
i7hzImg4eH0ogVyNm9iyiKla/niQHIt+wtX3bTpkclf3pW+fS20MBbgboCPN73QQ
Cn1JJzlyLj+d5M3rsFaIXGvR8eCvc1mdQixz3BM+VF/iA97AOxGvIMz0AQXP6Gzw
qvamP0A+PKSLMNbZda+Hix2XBz05LKKJfTCWwa+zNmmSe10M5Uxt97+g+n2EOV5v
eN+N3Ngj5nDObtOwQ8QqBV5Zkl9rO1KIgeBJzGNdw4PyKGzUGauChWL6GINVpT8U
MZTPpDVnR8zuutaYD5YLq1CuSUTPnA99QdSmQyNiMqUckHdJGqaqoL5+oPWZyS9g
gpeP1NXDuyb/Pj1ltMgdkb+5NJj2Vkj6WAe57+QqpBRrlO+13WotgwO3nXI+sWHY
E3tHMIFvmmvQF7duP9SukWf2WDZ3OEnI9wAwYsKPukTNrnMBXZh1qeHdE0dyrEcY
2vX5fCs7XpQwKHey4Szdexh5jiQPFCaPxYzK60Ac4oXpxIedlDA8O4L/HweTHWjM
fHD39fNonZcZRj/dLxdI
=9wZP
-----END PGP SIGNATURE-----

--4zKt6bo/V7G+vDr7--



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