diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 63fd91f27d..08565f7ce9 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -1423,7 +1423,7 @@ afs_vop_rename(ap) * run mv as the user, thus: */ printf("su %d -c /bin/mv /afs/.:mount/%d:%d:%d:%d/%s /afs/.:mount/%d:%d:%d:%d/%s\n", - cr_uid(cn_cred(tcnp)), fvc->f.fid.Cell, fvc->f.fid.Fid.Volume, + afs_cr_uid(cn_cred(tcnp)), fvc->f.fid.Cell, fvc->f.fid.Fid.Volume, fvc->f.fid.Fid.Vnode, fvc->f.fid.Fid.Unique, fname, tvc->f.fid.Cell, tvc->f.fid.Fid.Volume, tvc->f.fid.Fid.Vnode, tvc->f.fid.Fid.Unique, tname); diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c index 6354de3bc6..ebb64a19d0 100644 --- a/src/afs/IRIX/osi_vnodeops.c +++ b/src/afs/IRIX/osi_vnodeops.c @@ -976,7 +976,7 @@ OSI_VC_DECL(avc); /* at least one daemon is idle, so ask it to do the store. * Also, note that we don't lock it any more... */ tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, - (afs_size_t) cr_uid(acred), 0L, (void *)0); + (afs_size_t) afs_cr_uid(acred), 0L, (void *)0); /* sleep waiting for the store to start, then retrieve error code */ while ((tb->flags & BUVALID) == 0) { tb->flags |= BUWAIT; diff --git a/src/afs/LINUX/osi_cred.c b/src/afs/LINUX/osi_cred.c index bbd4a73f46..76bc98d88f 100644 --- a/src/afs/LINUX/osi_cred.c +++ b/src/afs/LINUX/osi_cred.c @@ -54,10 +54,10 @@ crdup(cred_t * cr) { cred_t *tmp = crget(); - set_cr_uid(tmp, cr_uid(cr)); - set_cr_ruid(tmp, cr_ruid(cr)); - set_cr_gid(tmp, cr_gid(cr)); - set_cr_rgid(tmp, cr_rgid(cr)); + afs_set_cr_uid(tmp, afs_cr_uid(cr)); + afs_set_cr_ruid(tmp, afs_cr_ruid(cr)); + afs_set_cr_gid(tmp, afs_cr_gid(cr)); + afs_set_cr_rgid(tmp, afs_cr_rgid(cr)); get_group_info(cr_group_info(cr)); set_cr_group_info(tmp, cr_group_info(cr)); @@ -70,10 +70,10 @@ crref(void) { cred_t *cr = crget(); - set_cr_uid(cr, current_fsuid()); - set_cr_ruid(cr, current_uid()); - set_cr_gid(cr, current_fsgid()); - set_cr_rgid(cr, current_gid()); + afs_set_cr_uid(cr, current_fsuid()); + afs_set_cr_ruid(cr, current_uid()); + afs_set_cr_gid(cr, current_fsgid()); + afs_set_cr_rgid(cr, current_gid()); task_lock(current); get_group_info(current_group_info()); @@ -98,15 +98,15 @@ crset(cred_t * cr) if (current->cred != current->real_cred) return; new_creds = prepare_creds(); - new_creds->fsuid = cr_uid(cr); - new_creds->uid = cr_ruid(cr); - new_creds->fsgid = cr_gid(cr); - new_creds->gid = cr_rgid(cr); + new_creds->fsuid = afs_cr_uid(cr); + new_creds->uid = afs_cr_ruid(cr); + new_creds->fsgid = afs_cr_gid(cr); + new_creds->gid = afs_cr_rgid(cr); #else - current->fsuid = cr_uid(cr); - current->uid = cr_ruid(cr); - current->fsgid = cr_gid(cr); - current->gid = cr_rgid(cr); + current->fsuid = afs_cr_uid(cr); + current->uid = afs_cr_ruid(cr); + current->fsgid = afs_cr_gid(cr); + current->gid = afs_cr_rgid(cr); #endif /* using set_current_groups() will sort the groups */ diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index a034ce2fe6..d8dc83fe6f 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -209,7 +209,7 @@ setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, code = __setpag(cr, pagvalue, newpag, change_parent); #ifdef LINUX_KEYRING_SUPPORT - if (code == 0 && cr_rgid(*cr) != NFSXLATOR_CRED) { + if (code == 0 && afs_cr_rgid(*cr) != NFSXLATOR_CRED) { (void) install_session_keyring(NULL); if (current_session_keyring()) { diff --git a/src/afs/LINUX/osi_nfssrv.c b/src/afs/LINUX/osi_nfssrv.c index edfa61f375..f30ea1f700 100644 --- a/src/afs/LINUX/osi_nfssrv.c +++ b/src/afs/LINUX/osi_nfssrv.c @@ -120,8 +120,8 @@ svcauth_afs_accept(struct svc_rqst *rqstp, u32 *authp) ns->code = EACCES; ns->client_addr = *addr; ns->client_addrlen = rqstp->rq_addrlen; - ns->client_uid = cr_uid(&rqstp->rq_cred); - ns->client_gid = cr_gid(&rqstp->rq_cred); + ns->client_uid = afs_cr_uid(&rqstp->rq_cred); + ns->client_gid = afs_cr_gid(&rqstp->rq_cred); if (cr_group_info(&rqstp->rq_cred)->ngroups > 0) ns->client_g0 = GROUP_AT(cr_group_info(&rqstp->rq_cred), 0); else @@ -138,15 +138,15 @@ svcauth_afs_accept(struct svc_rqst *rqstp, u32 *authp) } credp = crget(); - set_cr_uid(credp, cr_uid(&rqstp->rq_cred)); - set_cr_gid(credp, cr_gid(&rqstp->rq_cred)); + afs_set_cr_uid(credp, afs_cr_uid(&rqstp->rq_cred)); + afs_set_cr_gid(credp, afs_cr_gid(&rqstp->rq_cred)); get_group_info(cr_group_info(&rqstp->rq_cred)); set_cr_group_info(credp, cr_group_info(&rqstp->rq_cred)); /* avoid creating wildcard entries by mapping anonymous * clients to afs_nobody */ - if (cr_uid(credp) == -1) - set_cr_uid(credp, -2); + if (afs_cr_uid(credp) == -1) + afs_set_cr_uid(credp, -2); code = afs_nfsclient_reqhandler(0, &credp, addr->sin_addr.s_addr, &ns->uid, &outexp); if (!code && outexp) EXP_RELE(outexp); @@ -191,7 +191,7 @@ int osi_linux_nfs_initreq(struct vrequest *av, afs_ucred_t *cr, int *code) *code = ns->code; if (!ns->code) { - cr_ruid(cr) = NFSXLATOR_CRED; + afs_cr_ruid(cr) = NFSXLATOR_CRED; av->uid = ns->uid; } return 1; diff --git a/src/afs/LINUX24/osi_cred.c b/src/afs/LINUX24/osi_cred.c index b760f976ec..5627a58de1 100644 --- a/src/afs/LINUX24/osi_cred.c +++ b/src/afs/LINUX24/osi_cred.c @@ -52,10 +52,10 @@ crdup(cred_t * cr) { cred_t *tmp = crget(); - set_cr_uid(tmp, cr_uid(cr)); - set_cr_ruid(tmp, cr_ruid(cr)); - set_cr_gid(tmp, cr_gid(cr)); - set_cr_rgid(tmp, cr_rgid(cr)); + afs_set_cr_uid(tmp, afs_cr_uid(cr)); + afs_set_cr_ruid(tmp, afs_cr_ruid(cr)); + afs_set_cr_gid(tmp, afs_cr_gid(cr)); + afs_set_cr_rgid(tmp, afs_cr_rgid(cr)); memcpy(tmp->cr_groups, cr->cr_groups, NGROUPS * sizeof(gid_t)); tmp->cr_ngroups = cr->cr_ngroups; @@ -68,10 +68,10 @@ crref(void) { cred_t *cr = crget(); - set_cr_uid(cr, current_fsuid()); - set_cr_ruid(cr, current_uid()); - set_cr_gid(cr, current_fsgid()); - set_cr_rgid(cr, current_gid()); + afs_set_cr_uid(cr, current_fsuid()); + afs_set_cr_ruid(cr, current_uid()); + afs_set_cr_gid(cr, current_fsgid()); + afs_set_cr_rgid(cr, current_gid()); memcpy(cr->cr_groups, current->groups, NGROUPS * sizeof(gid_t)); cr->cr_ngroups = current->ngroups; @@ -94,15 +94,15 @@ crset(cred_t * cr) if (current->cred != current->real_cred) return; new_creds = prepare_creds(); - new_creds->fsuid = cr_uid(cr); - new_creds->uid = cr_ruid(cr); - new_creds->fsgid = cr_gid(cr); - new_creds->gid = cr_rgid(cr); + new_creds->fsuid = afs_cr_uid(cr); + new_creds->uid = afs_cr_ruid(cr); + new_creds->fsgid = afs_cr_gid(cr); + new_creds->gid = afs_cr_rgid(cr); #else - current->fsuid = cr_uid(cr); - current->uid = cr_ruid(cr); - current->fsgid = cr_gid(cr); - current->gid = cr_rgid(cr); + current->fsuid = afs_cr_uid(cr); + current->uid = afs_cr_ruid(cr); + current->fsgid = afs_cr_gid(cr); + current->gid = afs_cr_rgid(cr); #endif memcpy(current->groups, cr->cr_groups, NGROUPS * sizeof(gid_t)); current->ngroups = cr->cr_ngroups; diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index 9d4a3535b8..663d481c15 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -1493,12 +1493,12 @@ uafs_Init(char *rn, char *mountDirParam, char *confDirParam, afs_osi_Alloc(sizeof(struct usr_ucred)); usr_assert(afs_global_ucredp != NULL); afs_global_ucredp->cr_ref = 1; - set_cr_uid(afs_global_ucredp, geteuid()); - set_cr_gid(afs_global_ucredp, getegid()); - set_cr_ruid(afs_global_ucredp, getuid()); - set_cr_rgid(afs_global_ucredp, getgid()); - afs_global_ucredp->cr_suid = cr_ruid(afs_global_ucredp); - afs_global_ucredp->cr_sgid = cr_rgid(afs_global_ucredp); + afs_set_cr_uid(afs_global_ucredp, geteuid()); + afs_set_cr_gid(afs_global_ucredp, getegid()); + afs_set_cr_ruid(afs_global_ucredp, getuid()); + afs_set_cr_rgid(afs_global_ucredp, getgid()); + afs_global_ucredp->cr_suid = afs_cr_ruid(afs_global_ucredp); + afs_global_ucredp->cr_sgid = afs_cr_rgid(afs_global_ucredp); st = getgroups(NGROUPS, &afs_global_ucredp->cr_groups[0]); usr_assert(st >= 0); afs_global_ucredp->cr_ngroups = (unsigned long)st; @@ -1983,8 +1983,8 @@ syscallThread(void *argp) */ u.u_viceid = getuid(); crp = u.u_cred; - set_cr_uid(crp, getuid()); - set_cr_ruid(crp, getuid()); + afs_set_cr_uid(crp, getuid()); + afs_set_cr_ruid(crp, getuid()); crp->cr_suid = getuid(); crp->cr_groups[0] = getgid(); crp->cr_ngroups = 1; @@ -2579,8 +2579,8 @@ uafs_mkdir_r(char *path, int mode) usr_vattr_null(&attrs); attrs.va_type = VREG; attrs.va_mode = mode; - attrs.va_uid = cr_uid(u.u_cred); - attrs.va_gid = cr_gid(u.u_cred); + attrs.va_uid = afs_cr_uid(u.u_cred); + attrs.va_gid = afs_cr_gid(u.u_cred); dirP = NULL; code = afs_mkdir(VTOAFS(parentP), nameP, &attrs, &dirP, u.u_cred); VN_RELE(parentP); @@ -2678,8 +2678,8 @@ uafs_open_r(char *path, int flags, int mode) usr_vattr_null(&attrs); attrs.va_type = VREG; attrs.va_mode = mode; - attrs.va_uid = cr_uid(u.u_cred); - attrs.va_gid = cr_gid(u.u_cred); + attrs.va_uid = afs_cr_uid(u.u_cred); + attrs.va_gid = afs_cr_gid(u.u_cred); if (flags & O_TRUNC) { attrs.va_size = 0; } @@ -3505,8 +3505,8 @@ uafs_symlink_r(char *target, char *source) usr_vattr_null(&attrs); attrs.va_type = VLNK; attrs.va_mode = 0777; - attrs.va_uid = cr_uid(u.u_cred); - attrs.va_gid = cr_gid(u.u_cred); + attrs.va_uid = afs_cr_uid(u.u_cred); + attrs.va_gid = afs_cr_gid(u.u_cred); code = afs_symlink(VTOAFS(dirP), nameP, &attrs, target, u.u_cred); VN_RELE(dirP); if (code != 0) { diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index fb6abc32d4..39c9dbf4e4 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -271,7 +271,7 @@ afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, } InStatus.Mask = AFS_SETMODTIME | AFS_SETMODE | AFS_SETGROUP; InStatus.ClientModTime = osi_Time(); - InStatus.Group = (afs_int32) cr_gid(acred); + InStatus.Group = (afs_int32) afs_cr_gid(acred); if (AFS_NFSXLATORREQ(acred)) { /* * XXX The following is mainly used to fix a bug in the HP-UX diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index 913de752f9..aaeaefd3f7 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -99,7 +99,7 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, InStatus.Mask = AFS_SETMODTIME | AFS_SETMODE | AFS_SETGROUP; InStatus.ClientModTime = osi_Time(); InStatus.UnixModeBits = attrs->va_mode & 0xffff; /* only care about protection bits */ - InStatus.Group = (afs_int32) cr_gid(acred); + InStatus.Group = (afs_int32) afs_cr_gid(acred); tdc = afs_GetDCache(adp, (afs_size_t) 0, &treq, &offset, &len, 1); ObtainWriteLock(&adp->lock, 153); diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 5e76c10186..33437d0567 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -745,7 +745,7 @@ afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred) /* at least one daemon is idle, so ask it to do the store. * Also, note that we don't lock it any more... */ tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred, - (afs_size_t) cr_uid(acred), (afs_size_t) 0, + (afs_size_t) afs_cr_uid(acred), (afs_size_t) 0, (void *)0); /* sleep waiting for the store to start, then retrieve error code */ while ((tb->flags & BUVALID) == 0) { diff --git a/src/afs/afs.h b/src/afs/afs.h index 677f918ba0..c03c9ca6a3 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -1400,25 +1400,25 @@ extern int afsd_dynamic_vcaches; #endif /* Wrappers for access to credentials structure members */ -#define cr_uid(cred) ((cred)->cr_uid) -#define cr_gid(cred) ((cred)->cr_gid) -#define cr_ruid(cred) ((cred)->cr_ruid) -#define cr_rgid(cred) ((cred)->cr_rgid) +#define afs_cr_uid(cred) ((cred)->cr_uid) +#define afs_cr_gid(cred) ((cred)->cr_gid) +#define afs_cr_ruid(cred) ((cred)->cr_ruid) +#define afs_cr_rgid(cred) ((cred)->cr_rgid) static_inline void -set_cr_uid(afs_ucred_t *cred, uid_t uid) { +afs_set_cr_uid(afs_ucred_t *cred, uid_t uid) { cred->cr_uid = uid; } static_inline void -set_cr_gid(afs_ucred_t *cred, gid_t gid) { +afs_set_cr_gid(afs_ucred_t *cred, gid_t gid) { cred->cr_gid = gid; } static_inline void -set_cr_ruid(afs_ucred_t *cred, uid_t uid) { +afs_set_cr_ruid(afs_ucred_t *cred, uid_t uid) { cred->cr_ruid = uid; } static_inline void -set_cr_rgid(afs_ucred_t *cred, gid_t gid) { +afs_set_cr_rgid(afs_ucred_t *cred, gid_t gid) { cred->cr_rgid = gid; } #endif /* _AFS_H_ */ diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c index 1289a2e00a..e61ea0697e 100644 --- a/src/afs/afs_disconnected.c +++ b/src/afs/afs_disconnected.c @@ -713,7 +713,7 @@ afs_ProcessOpCreate(struct vcache *avc, struct vrequest *areq, InStatus.Mask = AFS_SETMODTIME | AFS_SETMODE | AFS_SETGROUP; InStatus.ClientModTime = avc->f.m.Date; InStatus.Owner = avc->f.m.Owner; - InStatus.Group = (afs_int32) cr_gid(acred); + InStatus.Group = (afs_int32) afs_cr_gid(acred); /* Only care about protection bits. */ InStatus.UnixModeBits = avc->f.m.Mode & 0xffff; diff --git a/src/afs/afs_dynroot.c b/src/afs/afs_dynroot.c index 4edcf70f14..6661764420 100644 --- a/src/afs/afs_dynroot.c +++ b/src/afs/afs_dynroot.c @@ -798,7 +798,7 @@ afs_DynrootVOPRemove(struct vcache *avc, afs_ucred_t *acred, char *aname) #if defined(AFS_SUN510_ENV) if (crgetruid(acred)) #else - if (cr_uid(acred)) + if (afs_cr_uid(acred)) #endif return EPERM; @@ -838,7 +838,7 @@ afs_DynrootVOPSymlink(struct vcache *avc, afs_ucred_t *acred, { struct afs_dynSymlink *tps; - if (cr_uid(acred)) + if (afs_cr_uid(acred)) return EPERM; if (afs_CellOrAliasExists(aname)) return EEXIST; diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c index 98450323f0..b350907f06 100644 --- a/src/afs/afs_nfsclnt.c +++ b/src/afs/afs_nfsclnt.c @@ -203,10 +203,10 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, #if defined(AFS_SUN510_ENV) uid = crgetuid(*cred); #else - uid = cr_uid(*cred); + uid = afs_cr_uid(*cred); #endif /* Do this early, so pag management knows */ - set_cr_rgid(*cred, NFSXLATOR_CRED); /* Identify it as nfs xlator call */ + afs_set_cr_rgid(*cred, NFSXLATOR_CRED); /* Identify it as nfs xlator call */ if ((afs_nfsexporter->exp_states & EXP_CLIPAGS) && pag != NOPAG) { uid = pag; } else if (pag != NOPAG) { @@ -226,7 +226,7 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, } np = afs_FindNfsClientPag(uid, host, 0); afs_Trace4(afs_iclSetp, CM_TRACE_NFSREQH, ICL_TYPE_INT32, pag, - ICL_TYPE_LONG, cr_uid(*cred), ICL_TYPE_INT32, host, + ICL_TYPE_LONG, afs_cr_uid(*cred), ICL_TYPE_INT32, host, ICL_TYPE_POINTER, np); /* If remote-pags are enabled, we are no longer interested in what PAG * they claimed, and from here on we should behave as if they claimed @@ -253,7 +253,7 @@ afs_nfsclient_reqhandler(struct afs_exporter *exporter, } np = afs_GetNfsClientPag(uid, host); np->pag = pag; - np->client_uid = cr_uid(*cred); + np->client_uid = afs_cr_uid(*cred); } else { if (pag == NOPAG) { if ((code = setpag(cred, np->pag, &pag, 0))) { @@ -590,12 +590,12 @@ afs_iauth_verify(long id, fsid_t * fsidp, long host, int uid, if (code) { /* ensure anonymous cred. */ - set_cr_uid(credp, (uid_t) -2; /* anonymous */ - set_cr_ruid(credp, (uid_t) -2; + afs_set_cr_uid(credp, (uid_t) -2; /* anonymous */ + afs_set_cr_ruid(credp, (uid_t) -2; } /* Mark this thread as an NFS translator thread. */ - set_cr_rgid(credp, NFSXLATOR_CRED); + afs_set_cr_rgid(credp, NFSXLATOR_CRED); AFS_GUNLOCK(); return 0; diff --git a/src/afs/afs_osi_gcpags.c b/src/afs/afs_osi_gcpags.c index 1f8d0ab67e..6d8f3bae5c 100644 --- a/src/afs/afs_osi_gcpags.c +++ b/src/afs/afs_osi_gcpags.c @@ -424,7 +424,7 @@ afs_osi_proc2cred(afs_proc_t * pr) } pcred = proc_ucred(pr); cr.cr_ref = 1; - set_cr_uid(&cr, cr_uid(pcred)); + afs_set_cr_uid(&cr, afs_cr_uid(pcred)); cr.cr_ngroups = pcred->cr_ngroups; memcpy(cr.cr_groups, pcred->cr_groups, NGROUPS * sizeof(gid_t)); @@ -445,7 +445,7 @@ afs_osi_proc2cred(afs_proc_t * pr) || (pr->p_stat == SSTOP)) { pcred_readlock(pr); cr.cr_ref = 1; - set_cr_uid(&cr, cr_uid(pr->p_cred->pc_ucred)); + afs_set_cr_uid(&cr, afs_cr_uid(pr->p_cred->pc_ucred)); cr.cr_ngroups = pr->p_cred->pc_ucred->cr_ngroups; memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups, NGROUPS * sizeof(gid_t)); @@ -471,7 +471,7 @@ afs_osi_proc2cred(afs_proc_t * pr) || (pr->state == TASK_UNINTERRUPTIBLE) || (pr->state == TASK_STOPPED)) { cr.cr_ref = 1; - set_cr_uid(&cr, task_uid(pr)); + afs_set_cr_uid(&cr, task_uid(pr)); #if defined(AFS_LINUX26_ENV) #if defined(STRUCT_TASK_HAS_CRED) get_group_info(pr->cred->group_info); diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 424cdcf9ef..b1d715f15e 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -455,11 +455,11 @@ afs_InitReq(register struct vrequest *av, afs_ucred_t *acred) if (acred == NOCRED) av->uid = -2; /* XXX nobody... ? */ else - av->uid = cr_uid(acred); /* bsd creds don't have ruid */ + av->uid = afs_cr_uid(acred); /* bsd creds don't have ruid */ #elif defined(AFS_SUN510_ENV) av->uid = crgetruid(acred); #else - av->uid = cr_uid(acred); /* default when no pag is set */ + av->uid = afs_cr_uid(acred); /* default when no pag is set */ #endif } return 0; @@ -609,7 +609,7 @@ PagInCred(afs_ucred_t *cred) out: #endif #if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT) - if (pag == NOPAG && cr_rgid(cred) != NFSXLATOR_CRED) { + if (pag == NOPAG && afs_cr_rgid(cred) != NFSXLATOR_CRED) { struct key *key; afs_uint32 upag, newpag; diff --git a/src/afs/afs_pag_call.c b/src/afs/afs_pag_call.c index e5b8eaa897..cdb4c45543 100644 --- a/src/afs/afs_pag_call.c +++ b/src/afs/afs_pag_call.c @@ -425,7 +425,7 @@ afs_syscall_pioctl(path, com, cmarg, follow) /* Set up credentials */ memset(&ccred, 0, sizeof(ccred)); pag = PagInCred(credp); - ccred.uid = cr_uid(credp); + ccred.uid = afs_cr_uid(credp); if (pag != NOPAG) { afs_get_groups_from_pag(pag, &g0, &g1); ccred.group0 = g0; diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c index 79c4de3fe3..7e4a835dd9 100644 --- a/src/afs/afs_pag_cred.c +++ b/src/afs/afs_pag_cred.c @@ -99,7 +99,7 @@ int afspag_PUnlog(char *ain, afs_int32 ainSize, afs_ucred_t **acred) return EIO; /* Inappropriate ioctl for device */ pag = PagInCred(*acred); - uid = (pag == NOPAG) ? cr_uid(*acred) : pag; + uid = (pag == NOPAG) ? afs_cr_uid(*acred) : pag; i = UHash(uid); ObtainWriteLock(&afs_xuser, 823); for (tu = afs_users[i]; tu; tu = tu->next) { @@ -187,7 +187,7 @@ int afspag_PSetTokens(char *ain, afs_int32 ainSize, afs_ucred_t **acred) #endif } pag = PagInCred(*acred); - uid = (pag == NOPAG) ? cr_uid(*acred) : pag; + uid = (pag == NOPAG) ? afs_cr_uid(*acred) : pag; /* now we just set the tokens */ tu = afs_GetUser(uid, tcell->cellnum, WRITE_LOCK); if (!tu->cellinfo) diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 3a445008f4..a7585b106c 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -3237,9 +3237,9 @@ DECL_PIOCTL(PSetSysName) ain += t + 1; num = count; } - if (cr_gid(*acred) == RMTUSER_REQ || - cr_gid(*acred) == RMTUSER_REQ_PRIV) { /* Handles all exporters */ - if (allpags && cr_gid(*acred) != RMTUSER_REQ_PRIV) { + if (afs_cr_gid(*acred) == RMTUSER_REQ || + afs_cr_gid(*acred) == RMTUSER_REQ_PRIV) { /* Handles all exporters */ + if (allpags && afs_cr_gid(*acred) != RMTUSER_REQ_PRIV) { return EPERM; } pag = PagInCred(*acred); @@ -3977,7 +3977,7 @@ HandleClientContext(struct afs_ioctl *ablob, int *com, #ifdef AFS_AIX41_ENV setuerror(0); #endif - set_cr_gid(newcred, isroot ? RMTUSER_REQ_PRIV : RMTUSER_REQ); + afs_set_cr_gid(newcred, isroot ? RMTUSER_REQ_PRIV : RMTUSER_REQ); #ifdef AFS_AIX51_ENV newcred->cr_groupset.gs_union.un_groups[0] = g0; newcred->cr_groupset.gs_union.un_groups[1] = g1; @@ -4013,15 +4013,15 @@ HandleClientContext(struct afs_ioctl *ablob, int *com, return EINVAL; } if (exporter->exp_states & EXP_PWSYNC) { - if (uid != cr_uid(credp)) { + if (uid != afs_cr_uid(credp)) { crfree(newcred); return ENOEXEC; /* XXX Find a better errno XXX */ } } - set_cr_uid(newcred, uid); /* Only temporary */ + afs_set_cr_uid(newcred, uid); /* Only temporary */ code = EXP_REQHANDLER(exporter, &newcred, hostaddr, &pag, &outexporter); /* The client's pag is the only unique identifier for it */ - set_cr_uid(newcred, pag); + afs_set_cr_uid(newcred, pag); *acred = newcred; if (!code && *com == PSETPAG) { /* Special case for 'setpag' */ @@ -4709,7 +4709,7 @@ DECL_PIOCTL(PNFSNukeCreds) return EINVAL; memcpy(&addr, ain, sizeof(afs_int32)); - if (cr_gid(*acred) == RMTUSER_REQ_PRIV && !addr) { + if (afs_cr_gid(*acred) == RMTUSER_REQ_PRIV && !addr) { tu = afs_GetUser(areq->uid, -1, SHARED_LOCK); if (!tu->exporter || !(addr = EXP_GETHOST(tu->exporter))) { afs_PutUser(tu, SHARED_LOCK); diff --git a/src/afs/afs_user.c b/src/afs/afs_user.c index c7c68269c0..8fcb670f65 100644 --- a/src/afs/afs_user.c +++ b/src/afs/afs_user.c @@ -608,11 +608,11 @@ afs_GCPAGs_perproc_func(afs_proc_t * pproc) pag = PagInCred(pcred); #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV) || defined(AFS_LINUX22_ENV) - uid = (pag != NOPAG ? pag : cr_uid(pcred)); + uid = (pag != NOPAG ? pag : afs_cr_uid(pcred)); #elif defined(AFS_SUN510_ENV) uid = (pag != NOPAG ? pag : crgetruid(pcred)); #else - uid = (pag != NOPAG ? pag : cr_ruid(pcred); + uid = (pag != NOPAG ? pag : afs_cr_ruid(pcred); #endif hash = UHash(uid); diff --git a/src/afs/exporter.h b/src/afs/exporter.h index e38c0fc2fc..0e3ffe2729 100644 --- a/src/afs/exporter.h +++ b/src/afs/exporter.h @@ -43,7 +43,7 @@ #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_NFSXLATORREQ(cred) 0 #else -#define AFS_NFSXLATORREQ(cred) (cr_rgid(cred) == NFSXLATOR_CRED) +#define AFS_NFSXLATORREQ(cred) (afs_cr_rgid(cred) == NFSXLATOR_CRED) #endif struct afs_exporter;