]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE10-export-pioctl-cryptall-interface-20010115
authorGreg Hudson <ghudson@mit.edu>
Fri, 19 Jan 2001 09:49:57 +0000 (09:49 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 19 Jan 2001 09:49:57 +0000 (09:49 +0000)
Export pioctl interface to cryptall

(cherry picked from commit 4a8f7153d2e60cb997c185de7dd1659a9e5a98c3)

src/afs/afs_pioctl.c

index 1526f2f5fa3648fff028a1f2d03a8b9cbd60ed99..51cb65e88de610048ef4955ff5222e574f104cf2 100644 (file)
@@ -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
  * <hostaddr, uid, g0, g1>.  This allows a server running as root to