From: "Mike A. Harris" <mharris@redhat.com>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Process Accounting 32bit UID/GID support
Date: Wed, 3 Apr 2002 17:36:34 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.44.0204031734030.21723-200000@devserv.devel.redhat.com> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 974 bytes --]
(Apologies to anyone getting this as a dupe, my first mail
bounced)
After receiving a handful of bug reports about process accounting
not working properly with 32bit UID/GID's, and investigating the
problem, I discovered the reason was that it just was not
implemented yet. After briefly discussing this with Alan and
Arjan, I've created support for this feature, while maintaining
full binary backward compatibility with existing tools.
I've also hacked the userland acct package (psacct in Red Hat
Linux) to support the new feature as well, while also remaining
backward compatible with kernels that do not have the new 32bit
UID/GID patch.
Marcelo, could you add this to the 2.4.x queue?
TIA
--
Mike A. Harris Shipping/mailing address:
OS Systems Engineer 190 Pittsburgh Ave., Sault Ste. Marie,
XFree86 maintainer Ontario, Canada, P6C 5B3
Red Hat Inc.
http://www.redhat.com ftp://people.redhat.com/mharris
[-- Attachment #2: Type: TEXT/PLAIN, Size: 1968 bytes --]
--- ./kernel/acct.c.psacct-32bit-uid-gid Mon Apr 1 12:43:33 2002
+++ ./kernel/acct.c Wed Apr 3 10:17:43 2002
@@ -8,6 +8,9 @@
* Some code based on ideas and code from:
* Thomas K. Dyas <tdyas@eden.rutgers.edu>
*
+ * April 2, 2002 - Mike A. Harris <mharris@redhat.com>
+ * - added 32bit UID/GID support
+ *
* This file implements BSD-style process accounting. Whenever any
* process exits, an accounting record of type "struct acct" is
* written to the file specified with the acct() system call. It is
@@ -298,8 +301,10 @@
ac.ac_etime = encode_comp_t(jiffies - current->start_time);
ac.ac_utime = encode_comp_t(current->times.tms_utime);
ac.ac_stime = encode_comp_t(current->times.tms_stime);
- ac.ac_uid = current->uid;
- ac.ac_gid = current->gid;
+ ac.ac_uid = high2lowuid(current->uid);
+ ac.ac_gid = high2lowgid(current->gid);
+ ac.ac_uid32 = current->uid;
+ ac.ac_gid32 = current->gid;
ac.ac_tty = (current->tty) ? kdev_t_to_nr(current->tty->device) : 0;
ac.ac_flag = 0;
--- ./include/linux/acct.h.psacct-32bit-uid-gid Mon Apr 1 12:39:28 2002
+++ ./include/linux/acct.h Wed Apr 3 10:18:40 2002
@@ -3,6 +3,9 @@
*
* Author: Marco van Wieringen (mvw@planets.elm.net)
*
+ *
+ * April 2, 2002 - Mike A. Harris <mharris@redhat.com>
+ * - added 32bit UID/GID support
* This header file contains the definitions needed to implement
* BSD-style process accounting. The kernel accounting code and all
* user-level programs that try to do something useful with the
@@ -56,7 +59,9 @@
comp_t ac_swaps; /* Accounting Number of Swaps */
__u32 ac_exitcode; /* Accounting Exitcode */
char ac_comm[ACCT_COMM + 1]; /* Accounting Command Name */
- char ac_pad[10]; /* Accounting Padding Bytes */
+ __u32 ac_uid32; /* Accounting Real 32bit User ID */
+ __u32 ac_gid32; /* Accounting Real 32bit Group ID */
+ char ac_pad[2]; /* Accounting Padding Bytes */
};
/*
next reply other threads:[~2002-04-03 22:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-03 22:36 Mike A. Harris [this message]
2002-04-04 15:17 Christopher Allen Wing
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=Pine.LNX.4.44.0204031734030.21723-200000@devserv.devel.redhat.com \
--to=mharris@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/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
all inboxes | Powered by JetHome®