#include "afs/sysincludes.h"
#include "afsincludes.h"
#include "afs/afs_stats.h" /* statistics */
+#include "afs/nfsclient.h"
#ifdef AFS_LINUX22_ENV
#include "h/smp_lock.h"
#endif
code = __setpag(cr, pagvalue, newpag, change_parent);
#ifdef LINUX_KEYRING_SUPPORT
- if (code == 0) {
-
+ if (code == 0 && (*cr)->cr_rgid != NFSXLATOR_CRED) {
(void) install_session_keyring(current, NULL);
if (current->signal->session_keyring) {
uid = crgetuid(*cred);
#else
uid = (*cred)->cr_uid;
+#endif
+ /* Do this early, so pag management knows */
+#ifdef AFS_OSF_ENV
+ (*cred)->cr_ruid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */
+#else
+ (*cred)->cr_rgid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */
#endif
if ((afs_nfsexporter->exp_states & EXP_CLIPAGS) && pag != NOPAG) {
uid = pag;
*pagparam = pag;
*outexporter = (struct afs_exporter *)np;
afs_PutUser(au, WRITE_LOCK);
-#ifdef AFS_OSF_ENV
- (*cred)->cr_ruid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */
-#else
- (*cred)->cr_rgid = NFSXLATOR_CRED; /* Identify it as nfs xlator call */
-#endif
/* ReleaseWriteLock(&afs_xnfsreq); */
return 0;
}
struct AFS_UCRED *newcred;
struct unixuser *au;
afs_uint32 comp = *com & 0xff00;
+ afs_uint32 h, l;
#if defined(AFS_SGIMP_ENV)
osi_Assert(ISAFS_GLOCK());
u.u_error = 0;
#endif
/* check for acceptable opcodes for normal folks, which are, so far,
- * set tokens and unlog.
+ * get/set tokens, sysname, and unlog.
*/
if (i != 9 && i != 3 && i != 38 && i != 8) {
osi_FreeLargeSpace(inData);
newcred->cr_groupset.gs_union.un_groups[0] = g0;
newcred->cr_groupset.gs_union.un_groups[1] = g1;
#elif defined(AFS_LINUX26_ENV)
+#ifdef AFS_LINUX26_ONEGROUP_ENV
+ newcred->cr_group_info = groups_alloc(1); /* not that anything sets this */
+ l = (((g0-0x3f00) & 0x3fff) << 14) | ((g1-0x3f00) & 0x3fff);
+ h = ((g0-0x3f00) >> 14);
+ h = ((g1-0x3f00) >> 14) + h + h + h;
+ GROUP_AT(newcred->cr_group_info, 0) = ((h << 28) | l);
+#else
newcred->cr_group_info = groups_alloc(2);
GROUP_AT(newcred->cr_group_info, 0) = g0;
GROUP_AT(newcred->cr_group_info, 1) = g1;
+#endif
#else
newcred->cr_groups[0] = g0;
newcred->cr_groups[1] = g1;
EXP_RELE(outexporter);
}
if (!code)
- *com = (*com) | comp;
+ *com = (*com) | comp;
return code;
}
#endif /* AFS_NEED_CLIENTCONTEXT */