From b69b382a745dde38bd04c83e5cdf585295c983de Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 20 Aug 2009 14:39:52 -0700 Subject: [PATCH] --- yaml --- r: 157335 b: refs/heads/master c: d8e180dcd5bbbab9cd3ff2e779efcf70692ef541 h: refs/heads/master i: 157333: 9a97d55c6fadd7e9fb93a05381bddd34f325658a 157331: 55206fa64461bdccec8efc720e2b636f090c2587 157327: b8fba86410dc61ca22649fd27a04eb2f5919973e v: v3 --- [refs] | 2 +- trunk/kernel/acct.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index bf115d980cb6..8d82157939ab 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 939a9421eb53d3ea83188ae13802779041caefdb +refs/heads/master: d8e180dcd5bbbab9cd3ff2e779efcf70692ef541 diff --git a/trunk/kernel/acct.c b/trunk/kernel/acct.c index 9f3391090b3e..9a4715a2f6bf 100644 --- a/trunk/kernel/acct.c +++ b/trunk/kernel/acct.c @@ -491,13 +491,17 @@ static void do_acct_process(struct bsd_acct_struct *acct, u64 run_time; struct timespec uptime; struct tty_struct *tty; + const struct cred *orig_cred; + + /* Perform file operations on behalf of whoever enabled accounting */ + orig_cred = override_creds(file->f_cred); /* * First check to see if there is enough free_space to continue * the process accounting system. */ if (!check_free_space(acct, file)) - return; + goto out; /* * Fill the accounting struct with the needed info as recorded @@ -578,6 +582,8 @@ static void do_acct_process(struct bsd_acct_struct *acct, sizeof(acct_t), &file->f_pos); current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim; set_fs(fs); +out: + revert_creds(orig_cred); } /**