svn commit: r243726 - in head/sys: kern security/audit
Konstantin Belousov
kostikbel at gmail.com
Sat Dec 1 03:02:58 UTC 2012
On Fri, Nov 30, 2012 at 11:18:49PM +0000, Pawel Jakub Dawidek wrote:
> Modified: head/sys/security/audit/audit_bsm_klib.c
> ==============================================================================
> --- head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:13:56 2012 (r243725)
> +++ head/sys/security/audit/audit_bsm_klib.c Fri Nov 30 23:18:49 2012 (r243726)
> @@ -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;
>
> 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 != '/') {
> - cvnp = fdp->fd_cdir;
> - vhold(cvnp);
> + if (dirfd == AT_FDCWD) {
> + cvnp = 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 = fgetvp(td, dirfd, 0, &cvnp);
> + if (error) {
> + cpath[0] = '\0';
> + if (rvnp != NULL)
> + vdrop(rvnp);
> + return;
> + }
> + vhold(cvnp);
> + vfslocked = VFS_LOCK_GIANT(cvnp->v_mount);
> + vrele(cvnp);
> + VFS_UNLOCK_GIANT(vfslocked);
And this cannot compile.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20121201/381cffe6/attachment.sig>
More information about the svn-src-all
mailing list