From owner-freebsd-audit Mon Jul 1 23:58:48 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC2E737B400; Mon, 1 Jul 2002 23:58:45 -0700 (PDT) Received: from axl.seasidesoftware.co.za (axl.seasidesoftware.co.za [196.31.7.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id B056F43E0A; Mon, 1 Jul 2002 23:58:44 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh by axl.seasidesoftware.co.za with local (Exim 3.36 #1) id 17PHdf-000Nbf-00; Tue, 02 Jul 2002 08:59:51 +0200 Date: Tue, 2 Jul 2002 08:59:51 +0200 From: Sheldon Hearn To: Johan Karlsson Cc: freebsd-audit@freebsd.org Subject: Re: accounting to appen only file Message-ID: <20020702065951.GA90729@starjuice.net> Mail-Followup-To: Johan Karlsson , freebsd-audit@freebsd.org References: <20020701204140.A49191@numeri.campus.luth.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020701204140.A49191@numeri.campus.luth.se> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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