Deleted Added
full compact
kern_acct.c (117673) kern_acct.c (118094)
1/*-
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * Copyright (c) 1982, 1986, 1989, 1993
4 * The Regents of the University of California. All rights reserved.
5 * (c) UNIX System Laboratories, Inc.
6 * All or some portions of this file are derived from material licensed
7 * to the University of California by American Telephone and Telegraph
8 * Co. or Unix System Laboratories, Inc. and are reproduced herein with

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93
40 */
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * Copyright (c) 1982, 1986, 1989, 1993
4 * The Regents of the University of California. All rights reserved.
5 * (c) UNIX System Laboratories, Inc.
6 * All or some portions of this file are derived from material licensed
7 * to the University of California by American Telephone and Telegraph
8 * Co. or Unix System Laboratories, Inc. and are reproduced herein with

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/kern/kern_acct.c 117673 2003-07-16 13:20:10Z bmilekic $");
43__FBSDID("$FreeBSD: head/sys/kern/kern_acct.c 118094 2003-07-27 17:04:56Z phk $");
44
45#include "opt_mac.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/lock.h>
50#include <sys/mutex.h>
51#include <sys/sysproto.h>

--- 87 unchanged lines hidden (view full) ---

139 mtx_lock(&Giant);
140 /*
141 * If accounting is to be started to a file, open that file for
142 * appending and make sure it's a 'normal'.
143 */
144 if (uap->path != NULL) {
145 NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
146 flags = FWRITE | O_APPEND;
44
45#include "opt_mac.h"
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/lock.h>
50#include <sys/mutex.h>
51#include <sys/sysproto.h>

--- 87 unchanged lines hidden (view full) ---

139 mtx_lock(&Giant);
140 /*
141 * If accounting is to be started to a file, open that file for
142 * appending and make sure it's a 'normal'.
143 */
144 if (uap->path != NULL) {
145 NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td);
146 flags = FWRITE | O_APPEND;
147 error = vn_open(&nd, &flags, 0);
147 error = vn_open(&nd, &flags, 0, -1);
148 if (error)
149 goto done2;
150 NDFREE(&nd, NDF_ONLY_PNBUF);
151#ifdef MAC
152 error = mac_check_system_acct(td->td_ucred, nd.ni_vp);
153 if (error) {
154 vn_close(nd.ni_vp, flags, td->td_ucred, td);
155 goto done2;

--- 265 unchanged lines hidden ---
148 if (error)
149 goto done2;
150 NDFREE(&nd, NDF_ONLY_PNBUF);
151#ifdef MAC
152 error = mac_check_system_acct(td->td_ucred, nd.ni_vp);
153 if (error) {
154 vn_close(nd.ni_vp, flags, td->td_ucred, td);
155 goto done2;

--- 265 unchanged lines hidden ---