public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 32-bit process accounting
@ 2004-04-23 14:04 Felipe W Damasio
  2004-04-23 16:57 ` Tim Schmielau
  0 siblings, 1 reply; 2+ messages in thread
From: Felipe W Damasio @ 2004-04-23 14:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: sisopiii-l

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

	Hi,

	According to Andrew's must-fix list:

"32bit uid support is *still* broken for process accounting."

	Ok, so I went and tried to see why we can't just use uid_t/gid_t for 
the uid, gid fields on struct acct.

	I saw the GNU acct source, and it uses unsigned int fields on the hash 
tabels and doesn't assume any 16-bit only fields on the acct structure.

	So, it seems to me that the only reason we still have broken 32-bit 
process accounting is so that old tools can behave nicely. Please tell 
me other reasons as I couldn't find them.

	There are 2 patches attached.

	The first, does the obvious uid_t/gid_t replacement..since it defines 
16/32-bits for UIDs on a per-architecture basis.

	The second, uses CONFIG_UID16 as a basis for forcing 16-bit UIDs.

	I'd like to request review of these patches and pointers on what I'm 
missing to get this problem fixed.

	Thanks,

Felipe

[-- Attachment #2: acct-32bit-config.patch --]
[-- Type: text/plain, Size: 646 bytes --]

--- linux-2.6.6-rc2/include/linux/acct.h.orig	Fri Apr 23 09:30:16 2004
+++ linux-2.6.6-rc2/include/linux/acct.h	Fri Apr 23 10:53:29 2004
@@ -41,8 +41,13 @@
  *	No binary format break with 2.0 - but when we hit 32bit uid we'll
  *	have to bite one
  */
+#ifdef CONFIG_UID16
 	__u16		ac_uid;			/* Accounting Real User ID */
 	__u16		ac_gid;			/* Accounting Real Group ID */
+#else
+	uid_t		ac_uid;			/* Accounting Real User ID */
+	gid_t		ac_gid;			/* Accounting Real Group ID */
+#endif
 	__u16		ac_tty;			/* Accounting Control Terminal */
 	__u32		ac_btime;		/* Accounting Process Creation Time */
 	comp_t		ac_utime;		/* Accounting User Time */

[-- Attachment #3: acct-32bit.patch --]
[-- Type: text/plain, Size: 609 bytes --]

--- linux-2.6.6-rc2/include/linux/acct.h.orig	Fri Apr 23 09:30:16 2004
+++ linux-2.6.6-rc2/include/linux/acct.h	Fri Apr 23 09:31:16 2004
@@ -41,8 +41,8 @@
  *	No binary format break with 2.0 - but when we hit 32bit uid we'll
  *	have to bite one
  */
-	__u16		ac_uid;			/* Accounting Real User ID */
-	__u16		ac_gid;			/* Accounting Real Group ID */
+	uid_t		ac_uid;			/* Accounting Real User ID */
+	gid_t		ac_gid;			/* Accounting Real Group ID */
 	__u16		ac_tty;			/* Accounting Control Terminal */
 	__u32		ac_btime;		/* Accounting Process Creation Time */
 	comp_t		ac_utime;		/* Accounting User Time */

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

end of thread, other threads:[~2004-04-23 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-23 14:04 [PATCH] 32-bit process accounting Felipe W Damasio
2004-04-23 16:57 ` Tim Schmielau

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