cacheout: Use authenticated secClass for VLDB
authorAndrew Deason <adeason@sinenomine.net>
Tue, 16 Dec 2014 23:03:34 +0000 (17:03 -0600)
committerDaria Brashear <shadow@your-file-system.com>
Wed, 14 Jan 2015 15:34:39 +0000 (10:34 -0500)
Currently 'cacheout' will always utilize an unauthenticated connection
when talking to the VDLB, even if it uses an authenticated connection
when talking to fileservers. This is regardless of any tokens
retrieved or command-line parameters, etc.

Using an authenticated connection to the VLDB can be useful, since a
user may want to encrypt the VLDB communication, or require stronger
guarantees of data consistency. So, just use the same security class
information for our VLDB communication as for our fileserver
communication.

'scnull' is now not used anywhere after this commit, so get rid of it.

Change-Id: I1e8a440ea7427399a3b219246e4c3623a603c35e
Reviewed-on: http://gerrit.openafs.org/11637
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>

src/venus/cacheout.c

index 33f1861..f7b1d5a 100644 (file)
@@ -239,7 +239,6 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
     struct afsconf_cell info;
     struct rx_connection *serverconns[MAXSERVERS];
     afs_int32 code, i;
-    struct rx_securityClass *scnull;
     rxkad_level sclevel = rxkad_auth;
 
     sprintf(confdir, "%s", AFSDIR_CLIENT_ETC_DIRPATH);
@@ -258,7 +257,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
        return 1;
     }
 
-    scnull = sc = rxnull_NewClientSecurityObject();
+    sc = rxnull_NewClientSecurityObject();
     scindex = 0;
 
     tdir = afsconf_Open(confdir);
@@ -310,8 +309,8 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
     for (i = 0; i < info.numServers; ++i)
        serverconns[i] =
            rx_NewConnection(info.hostAddr[i].sin_addr.s_addr,
-                            info.hostAddr[i].sin_port, USER_SERVICE_ID, scnull,
-                            0);
+                            info.hostAddr[i].sin_port, USER_SERVICE_ID, sc,
+                            scindex);
     for (; i < MAXSERVERS; ++i) {
        serverconns[i] = (struct rx_connection *)0;
     }