> Okay, what really happens here is that every _second_ group (as showed by
> id) is being ignored. This is the result of copying an array of gid_t (ie,
> short) over an array of int...
>
> The following patch corrects this specific problem, but it could break
> other stuff which assumes that current->groups is an array of int.
[that's what happens when you send patches before actually trying to use
them :)]
This is the complete patch that takes care of the groups problem. I am
running a kernel with this patch compiled in, and everything seems to be
normal once again. The previous patch, as I suspected, broke other
stuff...
--- linux/kernel/sys.c.orig Sat Nov 16 06:11:18 1996
+++ linux/kernel/sys.c Tue Nov 19 18:42:40 1996
@@ -699,7 +699,7 @@
asmlinkage int sys_getgroups(int gidsetsize, gid_t *grouplist)
{
int i;
- int * groups;
+ gid_t * groups;
if (gidsetsize < 0)
return -EINVAL;
--- linux/include/linux/sched.h.orig Tue Nov 19 18:37:50 1996
+++ linux/include/linux/sched.h Tue Nov 19 18:46:58 1996
@@ -200,7 +200,7 @@
int session;
/* boolean value for session group leader */
int leader;
- int groups[NGROUPS];
+ gid_t groups[NGROUPS];
/*
* pointers to (original) parent process, youngest child, younger sibling,
* older sibling, respectively. (p->father can be replaced with
--- linux/include/asm-i386/param.h.orig Tue Aug 1 11:08:17 1995
+++ linux/include/asm-i386/param.h Tue Nov 19 18:46:23 1996
@@ -12,7 +12,7 @@
#endif
#ifndef NOGROUP
-#define NOGROUP (-1)
+#define NOGROUP (gid_t)(-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
--- linux/include/asm-alpha/param.h.orig Sun Mar 24 05:09:37 1996
+++ linux/include/asm-alpha/param.h Tue Nov 19 18:49:19 1996
@@ -12,7 +12,7 @@
#endif
#ifndef NOGROUP
-#define NOGROUP (-1)
+#define NOGROUP (gid_t)(-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
--- linux/include/asm-mips/param.h.orig Wed Jan 18 01:54:13 1995
+++ linux/include/asm-mips/param.h Tue Nov 19 18:50:19 1996
@@ -12,7 +12,7 @@
#endif
#ifndef NOGROUP
-#define NOGROUP (-1)
+#define NOGROUP (gid_t)(-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
--- linux/include/asm-m68k/param.h.orig Wed Dec 27 15:47:20 1995
+++ linux/include/asm-m68k/param.h Tue Nov 19 18:49:51 1996
@@ -12,7 +12,7 @@
#endif
#ifndef NOGROUP
-#define NOGROUP (-1)
+#define NOGROUP (gid_t)(-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
--- linux/include/asm-ppc/param.h.orig Sat Nov 25 12:49:06 1995
+++ linux/include/asm-ppc/param.h Tue Nov 19 18:50:48 1996
@@ -12,7 +12,7 @@
#endif
#ifndef NOGROUP
-#define NOGROUP (-1)
+#define NOGROUP (gid_t)(-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
--- linux/include/asm-sparc/param.h.orig Fri Nov 24 21:32:19 1995
+++ linux/include/asm-sparc/param.h Tue Nov 19 18:51:02 1996
@@ -13,7 +13,7 @@
#endif
#ifndef NOGROUP
-#define NOGROUP (-1)
+#define NOGROUP (gid_t)(-1)
#endif
#define MAXHOSTNAMELEN 64 /* max length of hostname */
Ionut
-- Ionut Badulescu - Columbia College '98 E-mail:ib42@columbia.edu Phone: (212)853-7875 Snail mail: 4A4 Wallach Hall Fax: (212)695-5560 1116 Amsterdam Ave PGP key available on request New York, NY 10027 It is better to keep your mouth shut and be thought a fool, than to open it and remove all doubt.