From: Greg Hudson Date: Fri, 19 Jan 2001 09:49:57 +0000 (+0000) Subject: STABLE10-export-pioctl-cryptall-interface-20010115 X-Git-Tag: openafs-stable-1_0_2~15 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=885e8d47f72675746d7a936657b32f433ce9b921;p=packages%2Fo%2Fopenafs.git STABLE10-export-pioctl-cryptall-interface-20010115 Export pioctl interface to cryptall (cherry picked from commit 4a8f7153d2e60cb997c185de7dd1659a9e5a98c3) --- diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 1526f2f5f..51cb65e88 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -44,6 +44,7 @@ extern afs_rwlock_t afs_xcbhash; extern afs_int32 afs_mariner, afs_marinerHost; extern struct srvAddr *afs_srvAddrs[NSERVERS]; extern int afs_resourceinit_flag; +extern afs_int32 cryptall; static int PBogus(), PSetAcl(), PGetAcl(), PSetTokens(), PGetVolumeStatus(); static int PSetVolumeStatus(), PFlush(), PNewStatMount(), PGetTokens(), PUnlog(); @@ -3132,6 +3133,46 @@ static cred_t *crget(void) return cr; } #endif + +static int +PGetRxkcrypt(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) +struct vcache *avc; +int afun; +struct vrequest *areq; +char *ain, *aout; +afs_int32 ainSize; +afs_int32 *aoutSize; +struct AFS_UCRED *acred; +{ + bcopy((char *)&cryptall, aout, sizeof(int32)); + *aoutSize=sizeof(afs_int32); + return 0; +} + +static int +PSetRxkcrypt(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) +struct vcache *avc; +int afun; +struct vrequest *areq; +char *ain, *aout; +afs_int32 ainSize; +afs_int32 *aoutSize; +struct AFS_UCRED *acred; +{ + afs_int32 tmpval; + + if (!afs_osi_suser(acred)) + return EPERM; + if (ainSize != sizeof(afs_int32) || ain == NULL) + return EINVAL; + bcopy(ain, (char *)&tmpval, sizeof(afs_int32)); + /* if new mappings added later this will need to be changed */ + if (tmpval != 0 && tmpval != 1) + return EINVAL; + cryptall = tmpval; + return 0; +} + /* * Create new credentials to correspond to a remote user with given * . This allows a server running as root to