lkml.org 
[lkml]   [2009]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
Quoting Alexey Dobriyan (adobriyan@gmail.com):
> 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>

Yeah seems like it wouuld be needed, thanks.

Acked-by: Serge Hallyn <serue@us.ibm.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


\
 
 \ /
  Last update: 2009-12-01 15:45    [W:0.039 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site