Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jul 2002 08:59:51 +0200
From:      Sheldon Hearn <sheldonh@starjuice.net>
To:        Johan Karlsson <johan@freebsd.org>
Cc:        freebsd-audit@freebsd.org
Subject:   Re: accounting to appen only file
Message-ID:  <20020702065951.GA90729@starjuice.net>
In-Reply-To: <20020701204140.A49191@numeri.campus.luth.se>
References:  <20020701204140.A49191@numeri.campus.luth.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On (2002/07/01 20:41), Johan Karlsson wrote:

> +	/* Open file for append writing only */
> +	flags = FWRITE | FAPPEND;
> +
>  	/* Make sure that the caller is root. */
>  	error = suser(td);
>  	if (error)
> @@ -126,20 +129,19 @@
>  
>  	mtx_lock(&Giant);
>  	/*
> -	 * If accounting is to be started to a file, open that file for
> -	 * writing and make sure it's a 'normal'.
> +	 * If accounting is to be started to a file, open that file
> +	 * and make sure it's a 'normal'.
>  	 */
>  	if (SCARG(uap, path) != NULL) {
>  		NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, SCARG(uap, path),
>  		       td);
> -		flags = FWRITE;

Am I right in thinking that it's okay to move the setting of flags
outside Giant because flags is allocated on the stack?

I'm no kernel guy, but that was the only thing that worried me.  If
nobody with more clue says otherwise in the next couple of days, I'd say
go ahead.

Ciao,
Sheldon.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




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