public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bsdacct: fix uid/gid misreporting (#14676)
@ 2009-11-30 22:40 Alexey Dobriyan
  2009-12-01 14:43 ` Serge E. Hallyn
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2009-11-30 22:40 UTC (permalink / raw)
  To: akpm; +Cc: jkj, linux-kernel, mschmidt, dhowells, serue, jmorris

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-02  3:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30 22:40 [PATCH] bsdacct: fix uid/gid misreporting (#14676) Alexey Dobriyan
2009-12-01 14:43 ` Serge E. Hallyn
2009-12-01 15:38 ` David Howells
2009-12-01 17:49 ` Michal Schmidt
2009-12-02  3:49   ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox