]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-reconvert-aklog-to-afs-com-err-20071108
authorDerrick Brashear <shadow@dementia.org>
Thu, 8 Nov 2007 14:28:04 +0000 (14:28 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 8 Nov 2007 14:28:04 +0000 (14:28 +0000)
make this match what we're shipping in 1.4

(cherry picked from commit 7f8f251c3f252e352096f972e71c93db5cd9d3d9)

src/aklog/aklog_main.c
src/aklog/klog.c

index d9f36000e1a4ce4b1e8d0acc61573d72d034b617..5e33097395cdaca18924475080747d045e48c257 100644 (file)
@@ -720,7 +720,7 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
            }
            fprintf(stderr, "%s: Couldn't get %s AFS tickets:\n",
                    progname, cell_to_use);
-               com_err(progname, status, "while getting AFS tickets");
+               afs_com_err(progname, status, "while getting AFS tickets");
            return(AKLOG_KERBEROS);
        }
 
@@ -774,7 +774,7 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
            status = krb5_524_convert_creds(context, v5cred, &cred);
 
            if (status) {
-               com_err(progname, status, "while converting tickets "
+               afs_com_err(progname, status, "while converting tickets "
                        "to Kerberos V4 format");
                return(AKLOG_KERBEROS);
            }
@@ -832,7 +832,7 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm)
            if ((status = get_user_realm(context, realm_of_user))) {
                fprintf(stderr, "%s: Couldn't determine realm of user:)",
                        progname);
-               com_err(progname, status, " while getting realm");
+               afs_com_err(progname, status, " while getting realm");
                return(AKLOG_KERBEROS);
            }
            if (strcmp(realm_of_user, realm_of_cell)) {
@@ -1744,9 +1744,9 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
     code = krb5_kt_resolve(context, keytab, &kt);
     if (code) {
         if (keytab)
-            com_err(progname, code, "while resolving keytab %s", keytab);
+            afs_com_err(progname, code, "while resolving keytab %s", keytab);
         else
-            com_err(progname, code, "while resolving default keytab");
+            afs_com_err(progname, code, "while resolving default keytab");
         goto cleanup;
     }
 
@@ -1765,7 +1765,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
            }
         }
         if (code) {
-           com_err(progname, code,"while scanning keytab entries");
+           afs_com_err(progname, code,"while scanning keytab entries");
            goto cleanup;
         }
     } else {
@@ -1773,7 +1773,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         int best = -1;
         memset(new, 0, sizeof *new);
         if ((code == krb5_kt_start_seq_get(context, kt, cursor))) {
-            com_err(progname, code, "while starting keytab scan");
+            afs_com_err(progname, code, "while starting keytab scan");
             goto cleanup;
         }
         while (!(code = krb5_kt_next_entry(context, kt, new, cursor))) {
@@ -1789,12 +1789,12 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
             } else krb5_free_keytab_entry_contents(context, new);
         }
         if ((i = krb5_kt_end_seq_get(context, kt, cursor))) {
-            com_err(progname, i, "while ending keytab scan");
+            afs_com_err(progname, i, "while ending keytab scan");
             code = i;
             goto cleanup;
         }
         if (best < 0) {
-            com_err(progname, code, "while scanning keytab");
+            afs_com_err(progname, code, "while scanning keytab");
             goto cleanup;
         }
         deref_keyblock_enctype(session_key) = deref_entry_enctype(entry);
@@ -1805,7 +1805,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
 #if USING_HEIMDAL
     if ((code = krb5_generate_random_keyblock(context,
                                              deref_keyblock_enctype(session_key), session_key))) {
-        com_err(progname, code, "while making session key");
+        afs_com_err(progname, code, "while making session key");
         goto cleanup;
     }
     enc_tkt_reply->flags.initial = 1;
@@ -1828,7 +1828,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
 #else
     if ((code = krb5_c_make_random_key(context,
                                       deref_keyblock_enctype(session_key), session_key))) {
-        com_err(progname, code, "while making session key");
+        afs_com_err(progname, code, "while making session key");
         goto cleanup;
     }
     enc_tkt_reply->magic = KV5M_ENC_TKT_PART;
@@ -1891,12 +1891,12 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         ASN1_MALLOC_ENCODE(EncTicketPart, buf, buf_size,
                           enc_tkt_reply, &buf_len, code);
         if(code) {
-            com_err(progname, code, "while encoding ticket");
+            afs_com_err(progname, code, "while encoding ticket");
             goto cleanup;
         }
 
         if(buf_len != buf_size) {
-            com_err(progname, code,
+            afs_com_err(progname, code,
                    "%d != %d while encoding ticket (internal ASN.1 encoder error",
                    buf_len, buf_size);
             goto cleanup;
@@ -1914,7 +1914,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         if (buf) free(buf);
         if (crypto) krb5_crypto_destroy(context, crypto);
         if(code) {
-            com_err(progname, code, "while %s", what);
+            afs_com_err(progname, code, "while %s", what);
             goto cleanup;
         }
     } /* crypto block */
@@ -1926,7 +1926,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
     ticket_reply->server = service_principal;
     ticket_reply->enc_part2 = enc_tkt_reply;
     if ((code = krb5_encrypt_tkt_part(context, &deref_entry_keyblock(entry), ticket_reply))) {
-        com_err(progname, code, "while making ticket");
+        afs_com_err(progname, code, "while making ticket");
         goto cleanup;
     }
     ticket_reply->enc_part.kvno = entry->vno;
@@ -1936,17 +1936,17 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
 
     if ((code = krb5_copy_principal(context, service_principal,
                                    &creds->server))) {
-        com_err(progname, code, "while copying service principal");
+        afs_com_err(progname, code, "while copying service principal");
         goto cleanup;
     }
     if ((code = krb5_copy_principal(context, client_principal,
                                    &creds->client))) {
-        com_err(progname, code, "while copying client principal");
+        afs_com_err(progname, code, "while copying client principal");
         goto cleanup;
     }
     if ((code = krb5_copy_keyblock_contents(context, session_key,
                                            &deref_session_key(creds)))) {
-        com_err(progname, code, "while copying session key");
+        afs_com_err(progname, code, "while copying session key");
         goto cleanup;
     }
 
@@ -1964,7 +1964,7 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
         ;
     else if ((code = krb5_copy_addresses(context,
                                         deref_enc_tkt_addrs(enc_tkt_reply), &creds->addresses))) {
-        com_err(progname, code, "while copying addresses");
+        afs_com_err(progname, code, "while copying addresses");
         goto cleanup;
     }
 
@@ -1974,13 +1974,13 @@ static krb5_error_code get_credv5_akimpersonate(krb5_context context,
        ASN1_MALLOC_ENCODE(Ticket, creds->ticket.data, creds->ticket.length,
                           ticket_reply, &creds_tkt_len, code);
        if(code) {
-           com_err(progname, code, "while encoding ticket");
+           afs_com_err(progname, code, "while encoding ticket");
            goto cleanup;
        }
     }
 #else
     if ((code = encode_krb5_ticket(ticket_reply, &temp))) {
-       com_err(progname, code, "while encoding ticket");
+       afs_com_err(progname, code, "while encoding ticket");
        goto cleanup;
     }
     creds->ticket = *temp;
index c7aa5bee657b467efaa840d32503cc12f11fd829..e0c78be0f2ab1ee47d45f0e27e5e9daec85d174d 100644 (file)
@@ -396,15 +396,15 @@ CommandProc(struct cmd_syndesc *as, char *arock)
     Silent = (as->parms[aSILENT].items ? 1 : 0);
 
     if (Silent) {
-       set_com_err_hook(silent_errors);
+       afs_set_com_err_hook(silent_errors);
     }
 
     if ((code = krb5_init_context(&k5context))) {
-       com_err(rn, code, "while initializing Kerberos 5 library");
+       afs_com_err(rn, code, "while initializing Kerberos 5 library");
        KLOGEXIT(code);
     }
     if ((code = rx_Init(0))) {
-       com_err(rn, code, "while initializing rx");
+       afs_com_err(rn, code, "while initializing rx");
        KLOGEXIT(code);
     }
     initialize_U_error_table();
@@ -414,7 +414,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
     initialize_ACFG_error_table();
     /* initialize_rx_error_table(); */
     if (!(tdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
-       com_err(rn, 0, "can't get afs configuration (afsconf_Open(%s))",
+       afs_com_err(rn, 0, "can't get afs configuration (afsconf_Open(%s))",
            rn, AFSDIR_CLIENT_ETC_DIRPATH);
        KLOGEXIT(1);
     }
@@ -440,9 +440,9 @@ CommandProc(struct cmd_syndesc *as, char *arock)
     cell = as->parms[aCELL].items ? cell = as->parms[aCELL].items->data : 0;
     if ((code = afsconf_GetCellInfo(tdir, cell, "afsprot", cellconfig))) {
        if (cell)
-           com_err(rn, code, "Can't get cell information for '%s'", cell);
+           afs_com_err(rn, code, "Can't get cell information for '%s'", cell);
        else
-           com_err(rn, code, "Can't get determine local cell!");
+           afs_com_err(rn, code, "Can't get determine local cell!");
        KLOGEXIT(code);
     }
 
@@ -450,13 +450,13 @@ CommandProc(struct cmd_syndesc *as, char *arock)
        code = krb5_set_default_realm(k5context,
                (const char *) as->parms[aKRBREALM].items);
        if (code) {
-           com_err(rn, code, "Can't make <%s> the default realm",
+           afs_com_err(rn, code, "Can't make <%s> the default realm",
                as->parms[aKRBREALM].items);
            KLOGEXIT(code);
        }
     }
     else if ((code = krb5_get_host_realm(k5context, cellconfig->hostName[0], &hrealms))) {
-       com_err(rn, code, "Can't get realm for host <%s> in cell <%s>\n",
+       afs_com_err(rn, code, "Can't get realm for host <%s> in cell <%s>\n",
                cellconfig->hostName[0], cellconfig->name);
        KLOGEXIT(code);
     } else {
@@ -464,7 +464,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            code = krb5_set_default_realm(k5context,
                    *hrealms);
            if (code) {
-               com_err(rn, code, "Can't make <%s> the default realm",
+               afs_com_err(rn, code, "Can't make <%s> the default realm",
                    *hrealms);
                KLOGEXIT(code);
            }
@@ -480,7 +480,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
        struct passwd *pw;
        pw = getpwuid(id);
        if (pw == 0) {
-           com_err(rn, 0,
+           afs_com_err(rn, 0,
                "Can't figure out your name from your user id (%d).", id);
            if (!Silent)
                fprintf(stderr, "%s: Try providing the user name.\n", rn);
@@ -490,7 +490,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
     }
     code = krb5_parse_name(k5context, pname, &princ);
     if (code) {
-       com_err(rn, code, "Can't parse principal <%s>", pname);
+       afs_com_err(rn, code, "Can't parse principal <%s>", pname);
        KLOGEXIT(code);
     }
 
@@ -586,11 +586,11 @@ CommandProc(struct cmd_syndesc *as, char *arock)
        if (krb5_get_default_realm(k5context, &r))
            r = 0;
        if (service)
-           com_err(rn, code, "Unable to authenticate to use %s", service);
+           afs_com_err(rn, code, "Unable to authenticate to use %s", service);
        else if (r)
-           com_err(rn, code, "Unable to authenticate in realm %s", r);
+           afs_com_err(rn, code, "Unable to authenticate in realm %s", r);
        else
-           com_err(rn, code, "Unable to authenticate to use cell %s",
+           afs_com_err(rn, code, "Unable to authenticate to use cell %s",
                cellconfig->name);
        if (r) free(r);
        KLOGEXIT(code);
@@ -624,7 +624,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            break;
        Failed:
            if (code)
-               com_err(rn, code, what);
+               afs_com_err(rn, code, what);
            if (writeTicketFile) {
                if (cc) {
                    krb5_cc_close(k5context, cc);
@@ -640,7 +640,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            mcred->client = princ;
            code = krb5_parse_name(k5context, service, &mcred->server);
            if (code) {
-               com_err(rn, code, "Unable to parse service <%s>\n", service);
+               afs_com_err(rn, code, "Unable to parse service <%s>\n", service);
                KLOGEXIT(code);
            }
            if (tofree) { free(tofree); tofree = 0; }
@@ -657,7 +657,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
        afscred = outcred;
     }
     if (code) {
-       com_err(rn, code, "Unable to get credentials to use %s", outname);
+       afs_com_err(rn, code, "Unable to get credentials to use %s", outname);
        KLOGEXIT(code);
     }
 
@@ -670,7 +670,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
        strncpy(aserver->cell, cellconfig->name, MAXKTCREALMLEN-1);
        code = ktc_SetK5Token(k5context, aserver, afscred, viceid, dosetpag);
        if (code) {
-           com_err(rn, code, "Unable to store tokens for cell %s\n",
+           afs_com_err(rn, code, "Unable to store tokens for cell %s\n",
                cellconfig->name);
            KLOGEXIT(1);
        }
@@ -686,7 +686,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            if (afs_krb5_skip_ticket_wrapper(afscred->ticket.data,
                        afscred->ticket.length, &enc_part->data,
                        &enc_part->length)) {
-               com_err(rn, 0, "Can't unwrap %s AFS credential",
+               afs_com_err(rn, 0, "Can't unwrap %s AFS credential",
                    cellconfig->name);
                KLOGEXIT(1);
            }
@@ -712,7 +712,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            k5_to_k4_name(k5context, afscred->client, aclient);
            code = whoami(atoken, cellconfig, aclient, &viceid);
            if (code) {
-               com_err(rn, code, "Can't get your viceid", cellconfig->name);
+               afs_com_err(rn, code, "Can't get your viceid", cellconfig->name);
                *aclient->name = 0;
            } else
                snprintf(aclient->name, MAXKTCNAMELEN-1, "AFS ID %d", viceid);
@@ -721,7 +721,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            k5_to_k4_name(k5context, afscred->client, aclient);
        code = ktc_SetToken(aserver, atoken, aclient, dosetpag);
        if (code) {
-           com_err(rn, code, "Unable to store tokens for cell %s\n",
+           afs_com_err(rn, code, "Unable to store tokens for cell %s\n",
                cellconfig->name);
            KLOGEXIT(1);
        }