]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Use the RX_SECIDX_* enums in more places
authorBen Kaduk <kaduk@mit.edu>
Wed, 27 Nov 2013 22:01:39 +0000 (17:01 -0500)
committerD Brashear <shadow@your-file-system.com>
Mon, 9 Jun 2014 22:38:28 +0000 (18:38 -0400)
Add symbols for security indices 1 (rxvab, unused) and 3 (rxkad with
always-encrypt, maybe-used).

kauth and bubasics defined macros for RX_SCINDEX_*; replace those
with the common core rx enums as well.

Use the global symbols instead of custom defines like BULK_NULL and
SAMPLE_NULL, which can now be removed.

Reformat a comment to match current style, since we're changing it anyway.

Change-Id: I82bbb0016a5c3129dfd18ff7dc77ff7839501ad8
Reviewed-on: http://gerrit.openafs.org/10526
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
34 files changed:
src/afs/afs_conn.c
src/audit/audit.c
src/auth/authcon.c
src/auth/userok.c
src/bubasics/bubasics.h
src/butc/tcmain.c
src/butc/tcprocs.c
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/kaprocs.c
src/kauth/kaserver.c
src/kauth/kautils.p.h
src/kauth/test/test_badtix.c
src/ptserver/ptprocs.c
src/rx/bulk.example/bulk.xg
src/rx/bulk.example/bulk_client.c
src/rx/bulk.example/bulk_server.c
src/rx/bulktest/bulk.xg
src/rx/bulktest/bulk_client.c
src/rx/bulktest/bulk_server.c
src/rx/multi.example/sample.xg
src/rx/multi.example/sample_client.c
src/rx/multi.example/sample_server.c
src/rx/rx.h
src/rx/simple.example/sample.xg
src/rx/simple.example/sample_client.c
src/rx/simple.example/sample_server.c
src/rxdebug/rxdebug.c
src/rxkad/test/stress_s.c
src/sys/rmtsysc.c
src/sys/rmtsysd.c
src/sys/rmtsyss.c
src/update/server.c
src/viced/host.c

index de0fc6ecce58bafe113ca1008089cc13366bc57d..2a1aeee35e50603d3776e0df95bbdb8504321c5e 100644 (file)
@@ -461,7 +461,7 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
         * bad, but that's somewhat trickier, due to locking
         * constraints (though not impossible).
         */
-       if (tc->id && (rx_SecurityClassOf(tc->id) != 0)) {
+       if (tc->id && (rx_SecurityClassOf(tc->id) != RX_SECIDX_NULL)) {
            tc->forceConnectFS = 1;     /* force recreation of connection */
        }
        tu->states &= ~UHasTokens;      /* remove the authentication info */
index 32978432b651a0e26706ded6b1923443837d338d..b2e6672ce0ab08a4185260720b0c0e051f4b498a 100644 (file)
@@ -416,10 +416,10 @@ osi_auditU(struct rx_call *call, char *audEvent, int errCode, ...)
        conn = rx_ConnectionOf(call);   /* call -> conn) */
        if (conn) {
             secClass = rx_SecurityClassOf(conn);       /* conn -> securityIndex */
-           if (secClass == 0) {        /* unauthenticated */
+           if (secClass == RX_SECIDX_NULL) {   /* unauthenticated */
                osi_audit("AFS_Aud_Unauth", (-1), AUD_STR, audEvent, AUD_END);
                strcpy(afsName, "--UnAuth--");
-           } else if (secClass == 2) { /* authenticated */
+           } else if (secClass == RX_SECIDX_KAD) {     /* authenticated */
                 char tcell[MAXKTCREALMLEN];
                 char name[MAXKTCNAMELEN];
                 char inst[MAXKTCNAMELEN];
index fe54bfd7de9e82b3843af321e04405fcdc3be6c7..9000fe39d02d249824c24868e82aff2e046592bc 100644 (file)
@@ -317,18 +317,16 @@ afsconf_BuildServerSecurityObjects(void *rock,
 
     *classes = calloc(*numClasses, sizeof(**classes));
 
-    (*classes)[0] = rxnull_NewServerSecurityObject();
-    (*classes)[1] = NULL;
-    (*classes)[2] = rxkad_NewKrb5ServerSecurityObject(0, dir,
-                                                     afsconf_GetKey,
-                                                     _afsconf_GetRxkadKrb5Key,
-                                                     NULL);
+    (*classes)[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    (*classes)[RX_SECIDX_VAB] = NULL;
+    (*classes)[RX_SECIDX_KAD] =
+       rxkad_NewKrb5ServerSecurityObject(0, dir, afsconf_GetKey,
+                                         _afsconf_GetRxkadKrb5Key, NULL);
 
     if (dir->securityFlags & AFSCONF_SECOPTS_ALWAYSENCRYPT)
-       (*classes)[3] = rxkad_NewKrb5ServerSecurityObject(rxkad_crypt, dir,
-                                                         afsconf_GetKey,
-                                                         _afsconf_GetRxkadKrb5Key,
-                                                         NULL);
+       (*classes)[RX_SECIDX_KAE] =
+           rxkad_NewKrb5ServerSecurityObject(rxkad_crypt, dir, afsconf_GetKey,
+                                             _afsconf_GetRxkadKrb5Key, NULL);
 }
 #endif
 
index d0f68d2fbc1d0eb1a3974cd2c055cebb780a6f87..2a258df3df99b23c87603067f09106d63dc31fb3 100644 (file)
@@ -744,14 +744,14 @@ afsconf_SuperIdentity(struct afsconf_dir *adir, struct rx_call *acall,
 
     tconn = rx_ConnectionOf(acall);
     code = rx_SecurityClassOf(tconn);
-    if (code == 0) {
+    if (code == RX_SECIDX_NULL) {
        UNLOCK_GLOBAL_MUTEX;
        return 0;               /* not authenticated at all, answer is no */
-    } else if (code == 1) {
+    } else if (code == RX_SECIDX_VAB) {
        /* bcrypt tokens */
        UNLOCK_GLOBAL_MUTEX;
        return 0;               /* not supported any longer */
-    } else if (code == 2) {
+    } else if (code == RX_SECIDX_KAD) {
        flag = rxkadSuperUser(adir, acall, identity);
        UNLOCK_GLOBAL_MUTEX;
        return flag;
index 628d4b082c4229cc3be5e59dc4033cd1c9e1c56e..05897bbd08b796d5a82e1e8d2bd03a6265284c4e 100644 (file)
 #endif
 #define BUDB_SERVICE 22314     /* service id */
 
-#define RX_SCINDEX_NULL        0       /* No security */
-#define RX_SCINDEX_VAB         1       /* vice tokens, with bcrypt */
-#define RX_SCINDEX_KAD 2       /* Kerberos/DES */
-
 /* maximums for various text strings
  * DON'T alter these values until all disk/tape structures can be handled
  * correctly. In particular, volume names are 64.
index f5f1e944751feef876d28c5b402978cd232a7dfa..c6d1bbc6e47d8f7ec069287dc8b2fcfea0d9dac9 100644 (file)
@@ -1081,8 +1081,8 @@ WorkerBee(struct cmd_syndesc *as, void *arock)
      * security on connections made to this server
      */
 
-    securityObjects[0] = rxnull_NewServerSecurityObject();
-    if (!securityObjects[0]) {
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (!securityObjects[RX_SECIDX_NULL]) {
        TLog(0, "rxnull_NewServerSecurityObject");
        exit(1);
     }
index fc96302732073473df436e206a4b5621827e88a6..d41112a806f558f34f26e9438147065783d3882c 100644 (file)
@@ -41,9 +41,12 @@ static int CopyTapeSetDesc(struct tc_tapeSet *, struct tc_tapeSet *);
 int
 callPermitted(struct rx_call *call)
 {
-    /* before this code can be used, the rx connection, on the bucoord side, must */
-    /* be changed so that it will set up for token passing instead of using  a    */
-    /* simple rx connection that, below, returns a value of 0 from rx_SecurityClassOf */
+    /*
+     * Before this code can be used, the rx connection, on the bucoord side,
+     * must be changed so that it will set up for token passing instead of
+     * using a simple rx connection that, below, returns a value of
+     * RX_SECIDX_NULL from rx_SecurityClassOf.
+     */
     return 1;
 }
 
index b7899a1b8cf6e8f8e9ec5127b576890a847cf21a..b139315fae48efe68097eae0c9e71b46acd9eaee 100644 (file)
@@ -1037,7 +1037,7 @@ GetPassword(struct cmd_syndesc *as, void *arock)
        if (code)
            goto abort;
        sc = rxnull_NewClientSecurityObject();
-       si = RX_SCINDEX_NULL;
+       si = RX_SECIDX_NULL;
        conns[0] =
            rx_NewConnection(htonl(INADDR_LOOPBACK), htons(AFSCONF_KAUTHPORT),
                             KA_MAINTENANCE_SERVICE, sc, si);
index 10bef97e2436a21c03701bd4f04b088d65150d5f..9507cbd734b53fc11a4a0588abe8d173b3e97214 100644 (file)
@@ -136,7 +136,7 @@ ka_GetSecurity(int service, struct ktc_token * token,
     case KA_TICKET_GRANTING_SERVICE:
       no_security:
        *scP = rxnull_NewClientSecurityObject();
-       *siP = RX_SCINDEX_NULL;
+       *siP = RX_SECIDX_NULL;
        break;
     case KA_MAINTENANCE_SERVICE:
        if (!token)
@@ -145,7 +145,7 @@ ka_GetSecurity(int service, struct ktc_token * token,
            rxkad_NewClientSecurityObject(rxkad_crypt, &token->sessionKey,
                                          token->kvno, token->ticketLen,
                                          token->ticket);
-       *siP = RX_SCINDEX_KAD;
+       *siP = RX_SECIDX_KAD;
        break;
     default:
        UNLOCK_GLOBAL_MUTEX;
index f3f1ead67e0c176d726420203471a502c147c43e..a0197564a30ea927d573a5e84cd3139bb353b349 100644 (file)
@@ -371,13 +371,13 @@ check_auth(struct rx_call *call,
        noAuthenticationRequired = afsconf_GetNoAuthFlag(KA_conf);
 
     si = rx_SecurityClassOf(rx_ConnectionOf(call));
-    if (si == RX_SCINDEX_VAB) {
+    if (si == RX_SECIDX_VAB) {
        printf("No support for VAB security module yet.\n");
        return -1;
-    } else if (si == RX_SCINDEX_NULL) {
+    } else if (si == RX_SECIDX_NULL) {
        code = KANOAUTH;
        goto no_auth;
-    } else if (si != RX_SCINDEX_KAD) {
+    } else if (si != RX_SECIDX_KAD) {
        es_Report("Unknown security index %d\n", si);
        return -1;
     }
index dea4ec8bb96dc5ccf21e44cd7a81e6d6c80496bb..daa7b57f64d858a1b27d75f469673578aef1e54b 100644 (file)
@@ -419,7 +419,7 @@ main(int argc, char *argv[])
        exit(2);
     }
 
-    sca[RX_SCINDEX_NULL] = rxnull_NewServerSecurityObject();
+    sca[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
 
     tservice =
        rx_NewServiceHost(host, 0, KA_AUTHENTICATION_SERVICE,
@@ -442,9 +442,9 @@ main(int argc, char *argv[])
     rx_SetMinProcs(tservice, 1);
     rx_SetMaxProcs(tservice, 1);
 
-    scm[RX_SCINDEX_NULL] = sca[RX_SCINDEX_NULL];
-    scm[RX_SCINDEX_VAB] = 0;
-    scm[RX_SCINDEX_KAD] =
+    scm[RX_SECIDX_NULL] = sca[RX_SECIDX_NULL];
+    scm[RX_SECIDX_VAB] = 0;
+    scm[RX_SECIDX_KAD] =
        rxkad_NewServerSecurityObject(rxkad_crypt, 0, kvno_admin_key, 0);
     tservice =
        rx_NewServiceHost(host, 0, KA_MAINTENANCE_SERVICE, "Maintenance", scm, 3,
index b15c226017f29086a2e839cf22bf416ea620be61..02ed5bd6b2e62ca0c4634d2385d9fa67fed0f11f 100644 (file)
@@ -196,10 +196,6 @@ extern afs_int32 ka_VerifyUserPassword(afs_int32 version, char *name,
 #define KA_TICKET_GRANTING_SERVICE 732
 #define KA_MAINTENANCE_SERVICE 733
 
-#define RX_SCINDEX_NULL        0       /* No security */
-#define RX_SCINDEX_VAB         1       /* vice tokens, with bcrypt */
-#define RX_SCINDEX_KAD 2       /* Kerberos/DES */
-
 #define KA_TGS_NAME "krbtgt"
        /* realm is TGS instance */
 #define KA_ADMIN_NAME "AuthServer"
index 107984e64db8440bc66fbd8972f513ea17b158f6..a157d89b2de68bf8ec3f50222f8c1bd268424a95 100644 (file)
@@ -470,7 +470,7 @@ main(argc, argv)
        int si;                 /* security class index */
 
        sc = rxnull_NewClientSecurityObject();
-       si = RX_SCINDEX_NULL;
+       si = RX_SECIDX_NULL;
        conns[0] =
            rx_NewConnection(htonl(INADDR_LOOPBACK), htons(AFSCONF_KAUTHPORT),
                             KA_MAINTENANCE_SERVICE, sc, si);
index 06fbdb30f72b9ff645649ec794bc371d005de011..462c5afd849702b29b119520306983fb56343c9c 100644 (file)
@@ -2010,11 +2010,11 @@ WhoIsThisWithName(struct rx_call *acall, struct ubik_trans *at, afs_int32 *aid,
     *aid = ANONYMOUSID;
     tconn = rx_ConnectionOf(acall);
     code = rx_SecurityClassOf(tconn);
-    if (code == 0)
+    if (code == RX_SECIDX_NULL)
        return 0;
-    else if (code == 1) {      /* vab class */
+    else if (code == RX_SECIDX_VAB) {
        goto done;              /* no longer supported */
-    } else if (code == 2) {    /* kad class */
+    } else if (code == RX_SECIDX_KAD) {
        if ((code = rxkad_GetServerInfo(rx_ConnectionOf(acall), NULL, NULL,
                                        name, inst, tcell, NULL)))
            goto done;
index 59ee80c1d93a810670f8bb38f2d047a1d7c80a2b..fa819f2108ffb44de41ba424f5183251ab8c454b 100644 (file)
@@ -23,8 +23,6 @@ package BULK_
 %#define       BULK_MIN        1
 
 %#define       BULK_NAME_MAX 1024
-/* Index of the "null" security class in the BULK service.  This must be 0 (there are N classes, numbered from 0.  In this case, N is 1) */
-%#define       BULK_NULL       0
 
 %#define BULK_ERROR    1               /* Error used to abort a bulk transfer */
 
index 96f45d860b0501e1abb26e9e4a00e406c3ffada2..b5d33504b9ea3a65fea11f3990e0a1806b03d961 100644 (file)
@@ -90,7 +90,7 @@ main(int argc, char **argv)
     null_securityObject = rxnull_NewClientSecurityObject();
     conn =
        rx_NewConnection(host, BULK_SERVER_PORT, BULK_SERVICE_ID,
-                        null_securityObject, BULK_NULL);
+                        null_securityObject, RX_SECIDX_NULL);
 
     clock_NewTime();
     clock_GetTime(&startTime);
index 21e283b2a1deb892d82372b30efc1c911d3563ef..7742ff27f0940a3f2c9a1771f8cf807a554bc2d9 100644 (file)
@@ -35,8 +35,8 @@ main(int argc, char **argv)
        Quit("rx_init");
 
     /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
-    securityObjects[BULK_NULL] = rxnull_NewServerSecurityObject();
-    if (securityObjects[BULK_NULL] == (struct rx_securityClass *)0)
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
        Quit("rxnull_NewServerSecurityObject");
 
     /* Instantiate a single BULK service.  The rxgen-generated procedure which is called to decode requests is passed in here (BULK_ExecuteRequest). */
index 5226c3b943b16d3178ba4d5857a87bda1f7214b9..520f4a37ee41333049babd5a90ca174a48a3cdc1 100644 (file)
@@ -22,9 +22,6 @@ package BULK_
 /* Minimum number of requests that are guaranteed to be handled immediately */
 %#define BULK_MIN      1
 
-/* Index of the "null" security class in the BULK service.  This must be 0 (there are N classes, numbered from 0.  In this case, N is 1) */
-%#define BULK_NULL     0
-
 %#define BULK_ERROR    1               /* Error used to abort a bulk transfer */
 
 
index 5ede9021c30794771807a7a177883e75c6e0537e..e2edc93d8b711294153b9dcf5540132cef72f7e1 100644 (file)
@@ -211,7 +211,7 @@ main(argc, argv)
                host = GetIpAddress(hostname);
                conn =
                    rx_NewConnection(host, BULK_SERVER_PORT, BULK_SERVICE_ID,
-                                    null_securityObject, BULK_NULL);
+                                    null_securityObject, RX_SECIDX_NULL);
            } else if (strcmp(*argv, "-f") == 0)
                store = 0;
            else if (strcmp(*argv, "-s") == 0)
index 2bdedbf6c07ba8ba5ed833273d701f133bae4bf6..f4177a8c7c58740f0b3f588c5d56aedb8ce8c65d 100644 (file)
@@ -42,8 +42,8 @@ main()
        Quit("rx_init");
 
     /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
-    securityObjects[BULK_NULL] = rxnull_NewServerSecurityObject();
-    if (securityObjects[BULK_NULL] == (struct rx_securityClass *)0)
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
        Quit("rxnull_NewServerSecurityObject");
 
     /* Instantiate a single BULK service.  The rxgen-generated procedure which is called to decode requests is passed in here (BULK_ExecuteRequest). */
index f11915e7c533d9203d8ae3ccaf81e0b9700f16a0..ab2ed2ef657f1f46eb0d84f840e4df92ffec92e7 100644 (file)
@@ -22,9 +22,6 @@ package TEST_
 /* Minimum number of requests that are guaranteed to be handled immediately */
 #define        SAMPLE_MIN      1
 
-/* Index of the "null" security class in the sample service.  This must be 0 (there are N classes, numbered from 0.  In this case, N is 1) */
-#define        SAMPLE_NULL     0
-
 /* The "multi" flag, below, tells rxgen to create appropriate stubs for multi rx */
 Add(IN int verbose, int a, int b, OUT int *result) multi = 1;
 Sub(IN int verbose, int a, int b, OUT int *result) multi = 2;
index 316e25f517eaa1d4718e333a2fc675fd9476c9bc..6582daced6a199e6488f9648774e346f0fa0c858 100644 (file)
@@ -88,7 +88,7 @@ main(argc, argv)
        conns[i] =
            rx_NewConnection(host[i].ipaddr, SAMPLE_SERVER_PORT,
                             SAMPLE_SERVICE_ID, null_securityObject,
-                            SAMPLE_NULL);
+                            RX_SECIDX_NULL);
     }
 
     clock_NewTime();
index c13161327bfcfe2a91a3edbb0fc1f171b70ad6c9..5f5989df56b9e4cb2ce3be28b7fbee754ad1eddc 100644 (file)
@@ -31,8 +31,8 @@ main()
        Quit("rx_init");
 
     /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
-    securityObjects[SAMPLE_NULL] = rxnull_NewServerSecurityObject();
-    if (securityObjects[SAMPLE_NULL] == (struct rx_securityClass *)0)
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
        Quit("rxnull_NewServerSecurityObject");
 
     /* Instantiate a single sample service.  The rxgen-generated procedure which is called to decode requests is passed in here (TEST_ExecuteRequest). */
index d1a4836bcb79eac3aa63339749f5cc8265bcf638..8e671f05115b66e4217413fdf71057063ced5fc5 100644 (file)
@@ -515,10 +515,12 @@ struct rx_ackPacket {
 #define RX_RESTARTING              (-100)
 
 typedef enum {
-    RX_SECIDX_NULL = 0,
-    RX_SECIDX_KAD  = 2,
-    RX_SECIDX_GK   = 4,
-    RX_SECIDX_K5   = 5,
+    RX_SECIDX_NULL = 0,                /** rxnull, no security. */
+    RX_SECIDX_VAB  = 1,                /** vice tokens with bcrypt.  Unused. */
+    RX_SECIDX_KAD  = 2,                /** kerberos/DES. */
+    RX_SECIDX_KAE  = 3,                /** rxkad, but always encrypt. */
+    RX_SECIDX_GK   = 4,                /** rxgk, RFC 3961 crypto. */
+    RX_SECIDX_K5   = 5,                /** kerberos 5 tickets as tokens. */
 } rx_securityIndex;
 
 struct rx_securityObjectStats {
index 63e048fd37a7d28b44f5294fd6683d85f391c685..5b556ee6ff8631a70c55c9655e55c233a0d4c9c6 100644 (file)
@@ -23,9 +23,5 @@ prefix S
 /* Minimum number of requests that are guaranteed to be handled immediately */
 %#define       SAMPLE_MIN      1
 
-/* Index of the "null" security class in the sample service.  This must be 0 (there are N classes, numbered from 0.  In this case, N is 1) */
-%#define       SAMPLE_NULL     0
-
-
 Add(IN int a, int b, OUT int *result) = 1;
 Sub(IN int a, int b, OUT int *result) = 2;
index 819153cc8e8f7bec88c87c710d71125ad288f88b..06d329befc2134582b52542a73d8e1718918cf14 100644 (file)
@@ -48,7 +48,7 @@ main(int argc, char **argv)
     null_securityObject = rxnull_NewClientSecurityObject();
     conn =
        rx_NewConnection(host, SAMPLE_SERVER_PORT, SAMPLE_SERVICE_ID,
-                        null_securityObject, SAMPLE_NULL);
+                        null_securityObject, RX_SECIDX_NULL);
     for (i = 1; i < 10; i++) {
        int error, result;
        printf("add(%d,%d)", i, i * 2);
index 6aa8cc6cd6a9387e1ace712fd63bb43049abb31a..6a00d7c7419c38dc9f595989615a25da27a2cb01 100644 (file)
@@ -31,8 +31,8 @@ main(int argc, char **argv)
        Quit("rx_init");
 
     /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
-    securityObjects[SAMPLE_NULL] = rxnull_NewServerSecurityObject();
-    if (securityObjects[SAMPLE_NULL] == (struct rx_securityClass *)0)
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
        Quit("rxnull_NewServerSecurityObject");
 
     /* Instantiate a single sample service.  The rxgen-generated procedure which is called to decode requests is passed in here (TEST_ExecuteRequest). */
index 29c7f4a5c700223f00192775e1ffcba008b001ee..15f91e24c6639bbc3cc684ad14851ed74fe45e53 100644 (file)
@@ -362,10 +362,10 @@ MainCommand(struct cmd_syndesc *as, void *arock)
                continue;
            if (onlyAuth != 999) {
                if (onlyAuth == -1) {
-                   if (tconn.securityIndex != 0)
+                   if (tconn.securityIndex != RX_SECIDX_NULL)
                        continue;
                } else {
-                   if (tconn.securityIndex != 2)
+                   if (tconn.securityIndex != RX_SECIDX_KAD)
                        continue;
                    if (withSecStats && (tconn.secStats.type == 3)
                        && (tconn.secStats.level != onlyAuth))
@@ -414,7 +414,7 @@ MainCommand(struct cmd_syndesc *as, void *arock)
            if (withSecStats) {
                switch ((int)tconn.secStats.type) {
                case 0:
-                   if (tconn.securityIndex == 2)
+                   if (tconn.securityIndex == RX_SECIDX_KAD)
                        printf
                            ("  no GetStats procedure for security object\n");
                    break;
index 219f7ec912fbf40057efd0286cf040007a858597..17939f2c493a20006d504adbb4fcc312bfff82c5 100644 (file)
@@ -126,15 +126,15 @@ CheckAuth(struct rx_call *call)
     unsigned int expiration;           /* checked by Security Module */
 
     si = rx_SecurityClassOf(rx_ConnectionOf(call));
-    if (si == 1) {
+    if (si == RX_SECIDX_VAB) {
        printf("No support for VAB security module.\n");
        return -1;
-    } else if (si == 0) {
+    } else if (si == RX_SECIDX_NULL) {
        if (minAuth > -1)
            return RXKST_UNAUTH;
        else
            return 0;
-    } else if (si != 2) {
+    } else if (si != RX_SECIDX_KAD) {
        fprintf(stderr, "Unknown security index %d\n", si);
        return -1;
     }
index 2b16e22274497eec1ab18a8c01fd76d2c55afe1b..3e22aa720c117b2320dff04113853fa660dda380 100644 (file)
@@ -125,7 +125,7 @@ rx_connection(afs_int32 * errorcode, char *syscall)
     null_securityObject = rxnull_NewClientSecurityObject();
     conn =
        rx_NewConnection(host, htons(AFSCONF_RMTSYSPORT), RMTSYS_SERVICEID,
-                        null_securityObject, 0);
+                        null_securityObject, RX_SECIDX_NULL);
     if (!conn) {
        printf("Unable to make a new connection\n");
        *errorcode = -1;
index 78ff5e491acd02d0c8c9530e162fd3b4f7959c56..1df1644379deea3209654093beddf9836ef4a70a 100644 (file)
@@ -52,8 +52,8 @@ main(int argc, char *argv[])
     /* Initialize the rx-based RMTSYS server */
     if (rx_Init(htons(AFSCONF_RMTSYSPORT)) < 0)
        rmt_Quit("rx_init");
-    securityObjects[0] = rxnull_NewServerSecurityObject();
-    if (securityObjects[0] == (struct rx_securityClass *)0)
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
        rmt_Quit("rxnull_NewServerSecurityObject");
     service =
        rx_NewService(0, RMTSYS_SERVICEID, AFSCONF_RMTSYSSERVICE,
index eeecc847856865dd7c27ece7a03057338d1cb6c0..9537f2864c41e0add1a5e328d2ad31e49c30ec7a 100644 (file)
@@ -59,8 +59,8 @@ rmtsysd(void)
     /* Initialize the rx-based RMTSYS server */
     if (rx_Init(htons(AFSCONF_RMTSYSPORT)) < 0)
        rmt_Quit("rx_init");
-    securityObjects[0] = rxnull_NewServerSecurityObject();
-    if (securityObjects[0] == (struct rx_securityClass *)0)
+    securityObjects[RX_SECIDX_NULL] = rxnull_NewServerSecurityObject();
+    if (securityObjects[RX_SECIDX_NULL] == (struct rx_securityClass *)0)
        rmt_Quit("rxnull_NewServerSecurityObject");
     service =
        rx_NewService(0, RMTSYS_SERVICEID, AFSCONF_RMTSYSSERVICE,
index b4257c06ae900d1f09280e0601d92ab308fc4d86..03f928423dcbda9fb90580a5d6f29bcbd4aa80b2 100644 (file)
@@ -128,7 +128,7 @@ AuthOkay(struct rx_call *call, char *name)
     if (!afsconf_SuperUser(cdir, call, NULL))
        return 0;
 
-    if (rx_SecurityClassOf(rx_ConnectionOf(call)) == 2) {
+    if (rx_SecurityClassOf(rx_ConnectionOf(call)) == RX_SECIDX_KAD) {
        code = rxkad_GetServerInfo(rx_ConnectionOf(call), &level, 0, 0, 0, 0, 0);
        if (code)
            return 0;
index 1eee62517631bab72ee6c9ce4194becbc776ecc4..6eafa8ae869295f58cd7e01955443310d30e4924 100644 (file)
@@ -2546,13 +2546,13 @@ getPeerDetails(struct rx_connection *conn,
     ViceLog(5,
            ("FindClient: authenticating connection: authClass=%d\n",
             authClass));
-    if (authClass == 1) {
+    if (authClass == RX_SECIDX_VAB) {
        /* A bcrypt tickets, no longer supported */
        ViceLog(1, ("FindClient: bcrypt ticket, using AnonymousID\n"));
        return 0;
     }
 
-    if (authClass == 2) {
+    if (authClass == RX_SECIDX_KAD) {
        /* an rxkad ticket */
        afs_int32 kvno;
        afs_int32 islocal;