Re: accounting to appen only file

Sheldon Hearn <[email protected]>
Newsgroups gmane.os.freebsd.devel.audit
Message-ID <[email protected]>
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 [email protected]
with "unsubscribe freebsd-audit" in the body of the message
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.