Commit 4b731d50 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds
Browse files

bsdacct: fix uid/gid misreporting

commit d8e180dc "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.


Signed-off-by: default avatarAlexey Dobriyan <>
Reported-by: default avatarJuho K. Juopperi <>
Acked-by: default avatarSerge Hallyn <>
Acked-by: default avatarDavid Howells <>
Reviewed-by: default avatarMichal Schmidt <>
Cc: James Morris <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 54430407
......@@ -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;
ac.ac_ahz = AHZ;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment