public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: akpm@linux-foundation.org
Cc: jkj@kapsi.fi, linux-kernel@vger.kernel.org, mschmidt@redhat.com,
	dhowells@redhat.com, serue@us.ibm.com, jmorris@namei.org
Subject: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
Date: Tue, 1 Dec 2009 01:40:32 +0300	[thread overview]
Message-ID: <20091130224032.GA5598@x200.malnet.ru> (raw)

commit d8e180dcd5bbbab9cd3ff2e779efcf70692ef541
"bsdacct: switch credentials for writing to the accounting file"
introduced credential switching during final acct data collecting.
However, uid/gid pair continued to be collected from current which
became credentials of who created acct file, not who exits.

Fix http://bugzilla.kernel.org/show_bug.cgi?id=14676

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 Juho, please, confirm.

 kernel/acct.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -536,7 +536,8 @@ static void do_acct_process(struct bsd_acct_struct *acct,
 	do_div(elapsed, AHZ);
 	ac.ac_btime = get_seconds() - elapsed;
 	/* we really need to bite the bullet and change layout */
-	current_uid_gid(&ac.ac_uid, &ac.ac_gid);
+	ac.ac_uid = orig_cred->uid;
+	ac.ac_gid = orig_cred->gid;
 #if ACCT_VERSION==2
 	ac.ac_ahz = AHZ;
 #endif

             reply	other threads:[~2009-11-30 22:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 22:40 Alexey Dobriyan [this message]
2009-12-01 14:43 ` [PATCH] bsdacct: fix uid/gid misreporting (#14676) Serge E. Hallyn
2009-12-01 15:38 ` David Howells
2009-12-01 17:49 ` Michal Schmidt
2009-12-02  3:49   ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091130224032.GA5598@x200.malnet.ru \
    --to=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=jkj@kapsi.fi \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mschmidt@redhat.com \
    --cc=serue@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox