return code;
}
-#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_LINUX24_ENV)
+#if defined(AFS_LINUX24_ENV)
+/* Intercept the standard uid32 system call. */
+extern int (*sys_setgroups32p)(int gidsetsize, gid_t *grouplist);
+asmlinkage int afs_xsetgroups32(int gidsetsize, gid_t *grouplist)
+{
+ int code;
+ cred_t *cr = crref();
+ afs_uint32 junk;
+ int old_pag;
+
+ lock_kernel();
+ old_pag = PagInCred(cr);
+ crfree(cr);
+ unlock_kernel();
+
+ code = (*sys_setgroups32p)(gidsetsize, grouplist);
+ if (code) {
+ return code;
+ }
+
+ lock_kernel();
+ cr = crref();
+ if (old_pag != NOPAG && PagInCred(cr) == NOPAG) {
+ /* re-install old pag if there's room. */
+ code = setpag(&cr, old_pag, &junk, 0);
+ }
+ crfree(cr);
+ unlock_kernel();
+
+ return code;
+}
+#endif
#if defined(AFS_SPARC64_LINUX20_ENV)
asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
-#else
-asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid32_t *grouplist)
-#endif
{
gid_t gl[NGROUPS];
int ret, i;
#endif
#if defined(AFS_LINUX24_ENV)
-asmlinkage int (*sys_setgroupsp32)(int gidsetsize, __kernel_gid32_t *grouplist);
+asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist);
#endif
#ifdef AFS_SPARC64_LINUX20_ENV
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups32;
#endif
#if defined(AFS_LINUX24_ENV)
- sys_setgroupsp32 = SYSCALL2POINTER sys_call_table[__NR_setgroups32];
+ sys_setgroups32p = SYSCALL2POINTER sys_call_table[__NR_setgroups32];
sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32;
#endif
sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
#endif
#if defined(AFS_LINUX24_ENV)
- sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroupsp32;
+ sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroups32p;
#endif
unregister_filesystem(&afs_file_system);