From e0fa8ff72fb4f50a4f8e48b8f18d6846c7f5e4f6 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 10 Apr 2007 19:58:13 +0000 Subject: [PATCH] comerr-rename-20070410 nag nag nag --- src/JAVA/libjafs/File.c | 6 +- src/WINNT/afsd/cklog.c | 2 +- src/WINNT/afsd/fs.c | 2 +- src/WINNT/afsd/sample/token.c | 2 +- src/WINNT/afsd/symlink.c | 2 +- src/WINNT/afsreg/test/regman.c | 26 ++-- src/WINNT/aklog/NTMakefile | 6 +- src/WINNT/aklog/asetkey.c | 5 +- src/aklog/aklog_main.c | 17 --- src/aklog/asetkey.c | 4 +- src/bozo/bos.c | 16 +-- src/bucoord/bc_status.c | 6 +- src/bucoord/commands.c | 216 ++++++++++++++++----------------- src/bucoord/dump.c | 22 ++-- src/bucoord/dump_sched.c | 48 ++++---- src/bucoord/main.c | 24 ++-- src/bucoord/restore.c | 28 ++--- src/bucoord/tape_hosts.c | 20 +-- src/bucoord/ubik_db_if.c | 57 ++++----- src/bucoord/vol_sets.c | 68 +++++------ src/bucoord/volstub.c | 5 +- src/budb/server.c | 10 +- src/butc/lwps.c | 10 +- src/butm/butm_test.c | 4 +- src/butm/file_tm.c | 6 +- src/butm/test_ftm.c | 60 ++++----- src/cmd/test/itest.c | 4 +- src/comerr/com_err.c | 12 +- src/comerr/com_err.h | 26 ++-- src/comerr/compile_et.c | 2 +- src/comerr/error_msg.c | 8 +- src/comerr/error_table.h | 12 +- src/comerr/et_name.c | 2 +- src/comerr/internal.h | 2 +- src/comerr/test/test.c | 46 +++---- src/finale/translate_et.c | 4 +- src/kauth/admin_tools.c | 88 +++++++------- src/kauth/decode_ticket.c | 8 +- src/kauth/kaprocs.c | 3 +- src/kauth/kas.c | 2 +- src/kauth/kaserver.c | 7 +- src/kauth/kautils.p.h | 2 +- src/kauth/klog.c | 8 +- src/kauth/kpasswd.c | 22 ++-- src/kauth/krb_udp.c | 6 +- src/kauth/manyklog.c | 6 +- src/kauth/rebuild.c | 10 +- src/kauth/test/multiklog.c | 8 +- src/kauth/test/test_badtix.c | 36 +++--- src/kauth/test/test_getticket.c | 34 +++--- src/kauth/test/test_interim_ktc.c | 64 +++++----- src/kauth/test/test_rxkad_free.c | 14 +-- src/kauth/user.c | 8 +- src/libadmin/adminutil/afs_utilAdmin.c | 2 +- src/libafsrpc/afsrpc.def | 4 +- src/libafsrpc/afsrpc.exp | 4 +- src/ptserver/db_verify.c | 27 +++-- src/ptserver/pt_util.c | 12 +- src/ptserver/ptclient.c | 12 +- src/ptserver/ptclient.h | 2 +- src/ptserver/pts.c | 75 ++++++------ src/ptserver/ptserver.c | 7 +- src/ptserver/ptuser.c | 7 +- src/ptserver/ptutils.c | 14 +-- src/ptserver/readgroup.c | 1 + src/ptserver/readpwd.c | 1 + src/ptserver/testpt.c | 63 +++++----- src/rx/test/generator.c | 8 +- src/rxkad/test/stress.c | 16 +-- src/rxkad/test/stress_c.c | 44 +++---- src/shlibafsrpc/libafsrpc.exp | 4 +- src/shlibafsrpc/libafsrpc.map | 6 +- src/tests/afscp.c | 24 ++-- src/tests/afsdump_dirlist.c | 6 +- src/tests/afsdump_extract.c | 8 +- src/tests/afsdump_scan.c | 10 +- src/tests/afsdump_xsed.c | 10 +- src/tests/null-search.c | 8 +- src/update/client.c | 42 +++---- src/update/server.c | 9 +- src/uss/uss_acl.c | 6 +- src/uss/uss_kauth.c | 16 +-- src/uss/uss_ptserver.c | 10 +- src/uss/uss_vol.c | 2 +- src/venus/cmdebug.c | 10 +- src/venus/dedebug.c | 2 +- src/venus/fs.c | 2 +- src/venus/livesys.c | 2 +- src/venus/twiddle.c | 2 +- src/venus/whatfid.c | 2 +- src/viced/host.c | 3 +- src/volser/common.c | 2 +- src/volser/vsprocs.c | 4 +- 93 files changed, 808 insertions(+), 797 deletions(-) diff --git a/src/JAVA/libjafs/File.c b/src/JAVA/libjafs/File.c index c6c8338..a2eb8ae 100644 --- a/src/JAVA/libjafs/File.c +++ b/src/JAVA/libjafs/File.c @@ -168,7 +168,7 @@ JNIEXPORT jboolean JNICALL Java_org_openafs_jafs_File_setAttributes return JNI_TRUE; /* not really an error */ } else { fprintf(stderr, "File::setAttributes(): uafs_statmountpoint failed " - "for %s (%s)\n", dirName, error_message(errno)); + "for %s (%s)\n", dirName, afs_error_message(errno)); return JNI_FALSE; } } @@ -208,7 +208,7 @@ JNIEXPORT jboolean JNICALL Java_org_openafs_jafs_File_setAttributes } fprintf(stderr, "File::setAttributes(): uafs_stat failed for %s (%s)\n", - dirName, error_message(errno)); + dirName, afs_error_message(errno)); return JNI_FALSE; } } @@ -427,7 +427,7 @@ JNIEXPORT jlong JNICALL Java_org_openafs_jafs_File_listNative dirp = uafs_opendir(dirName); if(dirp == NULL) { fprintf(stderr, "File::listNative(): uafs_opendir(%s) failed(%s)\n", - dirName, error_message(errno)); + dirName, afs_error_message(errno)); setError(env, &obj, errno); //throwAFSSecurityException( env, errno ); return 0; diff --git a/src/WINNT/afsd/cklog.c b/src/WINNT/afsd/cklog.c index 54688fb..acbcf61 100644 --- a/src/WINNT/afsd/cklog.c +++ b/src/WINNT/afsd/cklog.c @@ -311,7 +311,7 @@ bad_lifetime: code = krb_write_ticket_file (realm); if (!Silent) { if (code) - com_err (rn, code, "writing Kerberos ticket file"); + afs_com_err (rn, code, "writing Kerberos ticket file"); else fprintf (stderr, "Wrote ticket file to /tmp\n"); } } diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index 34f25f2..5b86724 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -4645,7 +4645,7 @@ Die(int code, char *filename) #ifdef WIN32 fprintf(stderr, ": code 0x%x\n", code); #else /* not WIN32 */ - fprintf(stderr,": %s\n", error_message(code)); + fprintf(stderr,": %s\n", afs_error_message(code)); #endif /* not WIN32 */ } } /*Die*/ diff --git a/src/WINNT/afsd/sample/token.c b/src/WINNT/afsd/sample/token.c index f3f1810..ae384ca 100644 --- a/src/WINNT/afsd/sample/token.c +++ b/src/WINNT/afsd/sample/token.c @@ -276,7 +276,7 @@ bad_lifetime: code = krb_write_ticket_file (realm); if (!Silent) { if (code) - com_err (rn, code, "writing Kerberos ticket file"); + afs_com_err (rn, code, "writing Kerberos ticket file"); else fprintf (stderr, "Wrote ticket file to /tmp\n"); } } diff --git a/src/WINNT/afsd/symlink.c b/src/WINNT/afsd/symlink.c index 179efd4..b27d747 100644 --- a/src/WINNT/afsd/symlink.c +++ b/src/WINNT/afsd/symlink.c @@ -652,7 +652,7 @@ void Die(code, filename) #ifdef WIN32 fprintf(stderr, ": code 0x%x\n", code); #else /* not WIN32 */ - fprintf(stderr,": %s\n", error_message(code)); + fprintf(stderr,": %s\n", afs_error_message(code)); #endif /* not WIN32 */ } } /*Die*/ diff --git a/src/WINNT/afsreg/test/regman.c b/src/WINNT/afsreg/test/regman.c index a02b96e..4541288 100644 --- a/src/WINNT/afsreg/test/regman.c +++ b/src/WINNT/afsreg/test/regman.c @@ -60,12 +60,12 @@ static int DoVptAdd(struct cmd_syndesc *as, char *arock) vpDev = as->parms[1].items->data; if (!vpt_PartitionNameValid(vpName)) { - com_err(whoami, 0, "Partition name invalid"); + afs_com_err(whoami, 0, "Partition name invalid"); return 1; } if (!vpt_DeviceNameValid(vpDev)) { - com_err(whoami, 0, "Device name invalid"); + afs_com_err(whoami, 0, "Device name invalid"); return 1; } @@ -73,7 +73,7 @@ static int DoVptAdd(struct cmd_syndesc *as, char *arock) strcpy(vpentry.vp_dev, vpDev); if (vpt_AddEntry(&vpentry)) { - com_err(whoami, 0, "Unable to create vice partition table entry"); + afs_com_err(whoami, 0, "Unable to create vice partition table entry"); return 1; } return 0; @@ -86,12 +86,12 @@ static int DoVptDel(struct cmd_syndesc *as, char *arock) vpName = as->parms[0].items->data; if (!vpt_PartitionNameValid(vpName)) { - com_err(whoami, 0, "Partition name invalid"); + afs_com_err(whoami, 0, "Partition name invalid"); return 1; } if (vpt_RemoveEntry(vpName) && errno != ENOENT) { - com_err(whoami, 0, "Unable to remove vice partition table entry"); + afs_com_err(whoami, 0, "Unable to remove vice partition table entry"); return 1; } return 0; @@ -103,7 +103,7 @@ static int DoDirGet(struct cmd_syndesc *as, char *arock) char *buf; if (afssw_GetServerInstallDir(&buf)) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Failed reading AFS install dir entry (or does not exist)"); return 1; } @@ -136,7 +136,7 @@ static int DoDirSet(struct cmd_syndesc *as, char *arock) } if (status) { - com_err(whoami, 0, "Unable to set AFS installation directory entry"); + afs_com_err(whoami, 0, "Unable to set AFS installation directory entry"); } return (status ? 1 : 0); @@ -157,7 +157,7 @@ static int DoBosCfg(struct cmd_syndesc *as, char *arock) char *dirBuf; if (afssw_GetServerInstallDir(&dirBuf)) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "binary path not specified and AFS server installation directory not set"); return 1; } @@ -177,7 +177,7 @@ static int DoBosCfg(struct cmd_syndesc *as, char *arock) if (status == ERROR_ACCESS_DENIED) { reason = "(insufficient privilege)"; } - com_err(whoami, 0, "unable to connect to the SCM %s", reason); + afs_com_err(whoami, 0, "unable to connect to the SCM %s", reason); return 1; } @@ -202,7 +202,7 @@ static int DoBosCfg(struct cmd_syndesc *as, char *arock) if (status == ERROR_SERVICE_EXISTS || status == ERROR_DUP_NAME) { reason = "(service or display name already exists)"; } - com_err(whoami, 0, "unable to create service %s", reason); + afs_com_err(whoami, 0, "unable to create service %s", reason); CloseServiceHandle(scmHandle); return 1; } @@ -227,7 +227,7 @@ static int DoBosDel(struct cmd_syndesc *as, char *arock) if (status == ERROR_ACCESS_DENIED) { reason = "(insufficient privilege)"; } - com_err(whoami, 0, "unable to connect to the SCM %s", reason); + afs_com_err(whoami, 0, "unable to connect to the SCM %s", reason); return 1; } @@ -238,7 +238,7 @@ static int DoBosDel(struct cmd_syndesc *as, char *arock) DWORD status = GetLastError(); if (status != ERROR_SERVICE_DOES_NOT_EXIST) { - com_err(whoami, 0, "unable to open service"); + afs_com_err(whoami, 0, "unable to open service"); rc = 1; } CloseServiceHandle(scmHandle); @@ -249,7 +249,7 @@ static int DoBosDel(struct cmd_syndesc *as, char *arock) DWORD status = GetLastError(); if (status != ERROR_SERVICE_MARKED_FOR_DELETE) { - com_err(whoami, 0, "service delete failed"); + afs_com_err(whoami, 0, "service delete failed"); rc = 1; } } diff --git a/src/WINNT/aklog/NTMakefile b/src/WINNT/aklog/NTMakefile index 4c5532c..95ab603 100644 --- a/src/WINNT/aklog/NTMakefile +++ b/src/WINNT/aklog/NTMakefile @@ -28,8 +28,10 @@ ASETKEYOBJS = \ EXELIBS = \ $(DESTDIR)\lib\afs\afspioctl.lib \ - $(DESTDIR)\lib\afsauthent.lib \ - $(DESTDIR)\lib\afs\afskauth.lib + $(DESTDIR)\lib\afsauthent.lib \ + $(DESTDIR)\lib\afs\afskauth.lib \ + $(DESTDIR)\lib\afs\afscom_err.lib \ + $(DESTDIR)\lib\afs\afsutil.lib !IF "$(CPU)" == "IA64" || "$(CPU)" == "AMD64" || "$(CPU)" == "ALPHA64" OTHERLIBS = \ diff --git a/src/WINNT/aklog/asetkey.c b/src/WINNT/aklog/asetkey.c index 4e2479c..7f99770 100644 --- a/src/WINNT/aklog/asetkey.c +++ b/src/WINNT/aklog/asetkey.c @@ -17,6 +17,7 @@ #ifndef PRE_AFS35 #include #endif /* !PRE_AFS35 */ +#include int main(int argc, char **argv) @@ -61,13 +62,13 @@ main(int argc, char **argv) kvno = atoi(argv[2]); retval = krb5_parse_name(context, argv[4], &principal); if (retval != 0) { - com_err(argv[0], retval, "while parsing AFS principal"); + afs_com_err(argv[0], retval, "while parsing AFS principal"); exit(1); } retval = krb5_kt_read_service_key(context, argv[3], principal, kvno, ENCTYPE_DES_CBC_CRC, &key); if (retval != 0) { - com_err(argv[0], retval, "while extracting AFS service key"); + afs_com_err(argv[0], retval, "while extracting AFS service key"); exit(1); } diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c index bc78c48..bef2418 100644 --- a/src/aklog/aklog_main.c +++ b/src/aklog/aklog_main.c @@ -1546,23 +1546,6 @@ void aklog(int argc, char *argv[]) exit(status); } -#ifndef HAVE_ADD_TO_ERROR_TABLE - -#define error_table error_table_compat -#include -#undef error_table - -#ifndef HAVE_ADD_ERROR_TABLE -void add_error_table (const struct error_table *); -#endif /* !HAVE_ADD_ERROR_TABLE */ - -void -add_to_error_table(struct et_list *new_table) -{ - add_error_table((struct error_table *) new_table->table); -} -#endif /* HAVE_ADD_TO_ERROR_TABLE */ - static int isdir(char *path, unsigned char *val) { struct stat statbuf; diff --git a/src/aklog/asetkey.c b/src/aklog/asetkey.c index 2e88fbc..0cb0374 100644 --- a/src/aklog/asetkey.c +++ b/src/aklog/asetkey.c @@ -87,13 +87,13 @@ main(int argc, char *argv[]) kvno = atoi(argv[2]); retval = krb5_parse_name(context, argv[4], &principal); if (retval != 0) { - com_err(argv[0], retval, "while parsing AFS principal"); + afs_com_err(argv[0], retval, "while parsing AFS principal"); exit(1); } retval = krb5_kt_read_service_key(context, argv[3], principal, kvno, ENCTYPE_DES_CBC_CRC, &key); if (retval != 0) { - com_err(argv[0], retval, "while extracting AFS service key"); + afs_com_err(argv[0], retval, "while extracting AFS service key"); exit(1); } diff --git a/src/bozo/bos.c b/src/bozo/bos.c index 6b9bb43..4ff921c 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -94,7 +94,7 @@ em(acode) else if (acode == -3) return "communications timeout (-3)"; else - return (char *)error_message(acode); + return (char *)afs_error_message(acode); } /* get partition id from a name */ @@ -205,7 +205,7 @@ GetConn(as, aencrypt) * local cell */ code = afsconf_GetCellInfo(tdir, tname, NULL, &info); if (code) { - com_err("bos", code, "(can't find cell '%s' in cell database)", + afs_com_err("bos", code, "(can't find cell '%s' in cell database)", (tname ? tname : "")); exit(1); } else @@ -225,14 +225,14 @@ GetConn(as, aencrypt) if (as->parms[ADDPARMOFFSET + 2].items) { /* -localauth */ code = afsconf_GetLatestKey(tdir, 0, 0); if (code) - com_err("bos", code, "(getting key from local KeyFile)"); + afs_com_err("bos", code, "(getting key from local KeyFile)"); else { if (aencrypt) code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex); else code = afsconf_ClientAuth(tdir, &sc[2], &scIndex); if (code) - com_err("bos", code, "(calling ClientAuth)"); + afs_com_err("bos", code, "(calling ClientAuth)"); else if (scIndex != 2) /* this shouldn't happen */ sc[scIndex] = sc[2]; } @@ -259,7 +259,7 @@ GetConn(as, aencrypt) ttoken.ticket); scIndex = 2; } else - com_err("bos", code, "(getting tickets)"); + afs_com_err("bos", code, "(getting tickets)"); } if ((scIndex == 0) || (sc[scIndex] == 0)) { fprintf(stderr, "bos: running unauthenticated\n"); @@ -301,7 +301,7 @@ SetAuth(as) } code = BOZO_SetNoAuthFlag(tconn, flag); if (code) - com_err("bos", code, "(failed to set authentication flag)"); + afs_com_err("bos", code, "(failed to set authentication flag)"); return 0; } @@ -369,7 +369,7 @@ Prune(as) flags |= 0xff; code = BOZO_Prune(tconn, flags); if (code) - com_err("bos", code, "(failed to prune server files)"); + afs_com_err("bos", code, "(failed to prune server files)"); return code; } @@ -1493,7 +1493,7 @@ GetLogCmd(as) done: if (code) - com_err("bos", code, "(while reading log)"); + afs_com_err("bos", code, "(while reading log)"); return code; } diff --git a/src/bucoord/bc_status.c b/src/bucoord/bc_status.c index 4f6ebfc..56e4a7a 100644 --- a/src/bucoord/bc_status.c +++ b/src/bucoord/bc_status.c @@ -118,7 +118,7 @@ cmdDispatch() code = cmd_ParseLine(internalCmdLine, targv, &targc, MAXV); if (code) { - printf("Couldn't parse line: '%s'", error_message(code)); + printf("Couldn't parse line: '%s'", afs_error_message(code)); return (1); } free(internalCmdLine); @@ -266,8 +266,8 @@ statusWatcher() if (localTaskFlags & ABORT_REQUEST) { code = TC_RequestAbort(tconn, taskId); if (code) { - com_err("statusWatcher", code, "; Can't post abort request"); - com_err("statusWatcher", 0, "...Deleting job"); + afs_com_err("statusWatcher", code, "; Can't post abort request"); + afs_com_err("statusWatcher", 0, "...Deleting job"); if (localTaskFlags & NOREMOVE) { curPollPtr->flags |= (STARTING | TASK_ERROR); curPollPtr->scheduledDump = 0; diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index 844f24b..02a4624 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -119,7 +119,7 @@ getSPEntries(server, partition, serverlist, ss, ps) if (!(*ss)) { *ss = (struct serversort *)malloc(sizeof(struct serversort)); if (!(*ss)) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); *ss = 0; return (BC_NOMEM); } @@ -140,7 +140,7 @@ getSPEntries(server, partition, serverlist, ss, ps) if (!(*ps)) { *ps = (struct partitionsort *)malloc(sizeof(struct partitionsort)); if (!(*ps)) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); free(*ss); *ps = 0; *ss = 0; @@ -287,7 +287,7 @@ EvalVolumeSet2(aconfig, avs, avols, uclient) entries[e].serverPartition[ei], &servers, &ss, &ps); if (tcode) { - com_err(whoami, tcode, ""); + afs_com_err(whoami, tcode, ""); ERROR(tcode); } @@ -319,14 +319,14 @@ EvalVolumeSet2(aconfig, avs, avols, uclient) tvd = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump)); if (!tvd) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(tvd, 0, sizeof(*tvd)); tvd->name = (char *)malloc(strlen(entries[e].name) + 10); if (!(tvd->name)) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); free(tvd); ERROR(BC_NOMEM); } @@ -489,7 +489,7 @@ EvalVolumeSet1(aconfig, avs, avols, uclient) sprintf(patt, "^%s$", tve->name); errm = (char *)re_comp(patt); if (errm) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't compile regular expression '%s': %s", patt, errm); return (-1); @@ -543,7 +543,7 @@ EvalVolumeSet1(aconfig, avs, avols, uclient) } if (code < 0) - com_err(whoami, 0, "Internal error in regex package"); + afs_com_err(whoami, 0, "Internal error in regex package"); } /*s */ /* If found a match, then create a new volume dump entry */ @@ -554,7 +554,7 @@ EvalVolumeSet1(aconfig, avs, avols, uclient) entry.serverPartition[foundentry], &servers, &ss, &ps); if (code) { - com_err(whoami, code, ""); + afs_com_err(whoami, code, ""); return (code); } @@ -562,14 +562,14 @@ EvalVolumeSet1(aconfig, avs, avols, uclient) tvd = (struct bc_volumeDump *) malloc(sizeof(struct bc_volumeDump)); if (!tvd) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (BC_NOMEM); } memset(tvd, 0, sizeof(*tvd)); tvd->name = (char *)malloc(strlen(entry.name) + 10); if (!(tvd->name)) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); free(tvd); return (BC_NOMEM); } @@ -712,7 +712,7 @@ bc_CopyString(astring) tlen = strlen(astring); tp = (char *)malloc(tlen + 1); /* don't forget the terminating null */ if (!tp) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (tp); } strcpy(tp, astring); @@ -740,13 +740,13 @@ concatParams(itemPtr) } if (length == 0) { /* no string (0 length) */ - com_err(whoami, 0, "Can't have zero length date and time string"); + afs_com_err(whoami, 0, "Can't have zero length date and time string"); return (NULL); } string = (char *)malloc(length); /* allocate the string */ if (!string) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (NULL); } string[0] = 0; @@ -809,10 +809,10 @@ getPortOffset(port) portOffset = bc_SafeATOI(port); if (portOffset < 0) { - com_err(whoami, 0, "Can't decode port offset '%s'", port); + afs_com_err(whoami, 0, "Can't decode port offset '%s'", port); return (-1); } else if (portOffset > BC_MAXPORTOFFSET) { - com_err(whoami, 0, "%u exceeds max port offset %u", portOffset, + afs_com_err(whoami, 0, "%u exceeds max port offset %u", portOffset, BC_MAXPORTOFFSET); return (-1); } @@ -838,7 +838,7 @@ bc_GetTapeStatusCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -861,7 +861,7 @@ bc_GetTapeStatusCmd(as, arock) if (code) { if (code == TC_NOTASKS) break; - com_err(whoami, code, "; Can't get status from butc"); + afs_com_err(whoami, code, "; Can't get status from butc"); return (-1); } if ((flags & TSK_STAT_NOTFOUND)) @@ -897,7 +897,7 @@ bc_WaitForNoJobs() extern dlqlinkT statusHead; - com_err(whoami, 0, "waiting for job termination"); + afs_com_err(whoami, 0, "waiting for job termination"); while (usefulJobRunning) { usefulJobRunning = (dlqEmpty(&statusHead) ? 0 : 1); @@ -1058,7 +1058,7 @@ bc_KillCmd(as, arock) if (strchr(tp, '.') == 0) { slot = bc_SafeATOI(tp); if (slot == -1) { - com_err(whoami, 0, "Bad syntax for number '%s'", tp); + afs_com_err(whoami, 0, "Bad syntax for number '%s'", tp); return -1; } @@ -1091,7 +1091,7 @@ bc_KillCmd(as, arock) } } if (i >= BC_MAXSIMDUMPS) { - com_err(whoami, 0, "Can't find job %s", tp); + afs_com_err(whoami, 0, "Can't find job %s", tp); return -1; } @@ -1099,7 +1099,7 @@ bc_KillCmd(as, arock) statusPtr = findStatus(td->dumpID); if (statusPtr == 0) { - com_err(whoami, 0, "Can't locate status - internal error"); + afs_com_err(whoami, 0, "Can't locate status - internal error"); unlock_Status(); return (-1); } @@ -1147,7 +1147,7 @@ bc_VolRestoreCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -1155,7 +1155,7 @@ bc_VolRestoreCmd(as, arock) if (as->parms[0].items) { tp = as->parms[0].items->data; if (bc_ParseHost(tp, &destServ)) { - com_err(whoami, 0, "Failed to locate destination host '%s'", tp); + afs_com_err(whoami, 0, "Failed to locate destination host '%s'", tp); return -1; } } @@ -1164,7 +1164,7 @@ bc_VolRestoreCmd(as, arock) if (as->parms[1].items) { tp = as->parms[1].items->data; if (bc_GetPartitionID(tp, &destPartition)) { - com_err(whoami, 0, "Can't parse destination partition '%s'", tp); + afs_com_err(whoami, 0, "Can't parse destination partition '%s'", tp); return -1; } } @@ -1173,14 +1173,14 @@ bc_VolRestoreCmd(as, arock) /* build list of volume items */ tvol = (struct bc_volumeDump *)malloc(sizeof(struct bc_volumeDump)); if (!tvol) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } memset(tvol, 0, sizeof(struct bc_volumeDump)); tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1); if (!tvol->name) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } strncpy(tvol->name, ti->data, VOLSER_OLDMAXVOLNAME); @@ -1201,8 +1201,8 @@ bc_VolRestoreCmd(as, arock) code = ktime_DateToLong(timeString, &fromDate); free(timeString); if (code) { - com_err(whoami, 0, "Can't parse restore date and time"); - com_err(whoami, 0, "%s", ktime_GetDateUsage()); + afs_com_err(whoami, 0, "Can't parse restore date and time"); + afs_com_err(whoami, 0, "%s", ktime_GetDateUsage()); return code; } } else { @@ -1220,7 +1220,7 @@ bc_VolRestoreCmd(as, arock) portCount++; ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32)); if (!ports) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } @@ -1243,7 +1243,7 @@ bc_VolRestoreCmd(as, arock) bc_Restorer, ports, portCount, /*dumpSched */ NULL, /*append */ 0, dontExecute); if (code) - com_err(whoami, code, "; Failed to queue restore"); + afs_com_err(whoami, code, "; Failed to queue restore"); return (code); } @@ -1289,12 +1289,12 @@ bc_DiskRestoreCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -1307,13 +1307,13 @@ bc_DiskRestoreCmd(as, arock) tvolumeEntry.partname = as->parms[1].items->data; if (bc_GetPartitionID(tvolumeEntry.partname, &tvolumeEntry.partition)) { - com_err(whoami, 0, "Can't parse partition '%s'", + afs_com_err(whoami, 0, "Can't parse partition '%s'", tvolumeEntry.partname); return -1; } if (bc_ParseHost(tvolumeEntry.serverName, &tvolumeEntry.server)) { - com_err(whoami, 0, "Can't locate host '%s'", tvolumeEntry.serverName); + afs_com_err(whoami, 0, "Can't locate host '%s'", tvolumeEntry.serverName); return -1; } @@ -1321,7 +1321,7 @@ bc_DiskRestoreCmd(as, arock) if (as->parms[8].items) { tp = as->parms[8].items->data; if (bc_ParseHost(tp, &destServ)) { - com_err(whoami, 0, "Can't locate destination host '%s'", tp); + afs_com_err(whoami, 0, "Can't locate destination host '%s'", tp); return -1; } } else /* use destination host == original host */ @@ -1331,7 +1331,7 @@ bc_DiskRestoreCmd(as, arock) if (as->parms[9].items) { tp = as->parms[9].items->data; if (bc_GetPartitionID(tp, &destPartition)) { - com_err(whoami, 0, "Can't parse destination partition '%s'", tp); + afs_com_err(whoami, 0, "Can't parse destination partition '%s'", tp); return -1; } } else /* use original partition */ @@ -1344,7 +1344,7 @@ bc_DiskRestoreCmd(as, arock) portCount++; ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32)); if (!ports) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } @@ -1365,7 +1365,7 @@ bc_DiskRestoreCmd(as, arock) bc_EvalVolumeSet(bc_globalConfig, &tvolumeSet, &volsToRestore, cstruct); if (code) { - com_err(whoami, code, "; Failed to evaluate volume set"); + afs_com_err(whoami, code, "; Failed to evaluate volume set"); return (-1); } @@ -1406,7 +1406,7 @@ bc_DiskRestoreCmd(as, arock) bc_Restorer, ports, portCount, /*dumpSched */ NULL, /*append */ 0, dontExecute); if (code) - com_err(whoami, code, "; Failed to queue restore"); + afs_com_err(whoami, code, "; Failed to queue restore"); return (code); } @@ -1439,25 +1439,25 @@ bc_VolsetRestoreCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } if (as->parms[0].items) { if (as->parms[1].items) { - com_err(whoami, 0, "Can't have both -name and -file options"); + afs_com_err(whoami, 0, "Can't have both -name and -file options"); return (-1); } volsetName = as->parms[0].items->data; volsetPtr = bc_FindVolumeSet(bc_globalConfig, volsetName); if (!volsetPtr) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't find volume set '%s' in backup database", volsetName); return (-1); @@ -1468,7 +1468,7 @@ bc_VolsetRestoreCmd(as, arock) bc_EvalVolumeSet(bc_globalConfig, volsetPtr, &volsToRestore, cstruct); if (code) { - com_err(whoami, code, "; Failed to evaluate volume set"); + afs_com_err(whoami, code, "; Failed to evaluate volume set"); return (-1); } } else if (as->parms[1].items) { @@ -1480,7 +1480,7 @@ bc_VolsetRestoreCmd(as, arock) fd = fopen(as->parms[1].items->data, "r"); if (!fd) { - com_err(whoami, errno, "; Cannot open file '%s'", + afs_com_err(whoami, errno, "; Cannot open file '%s'", as->parms[1].items->data); return (-1); } @@ -1499,12 +1499,12 @@ bc_VolsetRestoreCmd(as, arock) } if (bc_ParseHost(server, &destServer)) { - com_err(whoami, 0, "Failed to locate host '%s'", server); + afs_com_err(whoami, 0, "Failed to locate host '%s'", server); continue; } if (bc_GetPartitionID(partition, &destPartition)) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Failed to parse destination partition '%s'", partition); continue; @@ -1517,7 +1517,7 @@ bc_VolsetRestoreCmd(as, arock) tvol->name = (char *)malloc(VOLSER_MAXVOLNAME + 1); if (!tvol->name) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } strncpy(tvol->name, volume, VOLSER_OLDMAXVOLNAME); @@ -1532,7 +1532,7 @@ bc_VolsetRestoreCmd(as, arock) } fclose(fd); } else { - com_err(whoami, 0, "-name or -file option required"); + afs_com_err(whoami, 0, "-name or -file option required"); return (-1); } @@ -1543,7 +1543,7 @@ bc_VolsetRestoreCmd(as, arock) portCount++; ports = (afs_int32 *) malloc(portCount * sizeof(afs_int32)); if (!ports) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } @@ -1568,7 +1568,7 @@ bc_VolsetRestoreCmd(as, arock) bc_Restorer, ports, portCount, /*dumpSched */ NULL, /*append */ 0, dontExecute); if (code) - com_err(whoami, code, "; Failed to queue restore"); + afs_com_err(whoami, code, "; Failed to queue restore"); return code; } @@ -1631,17 +1631,17 @@ bc_DumpCmd(as, arock) code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); + afs_com_err(whoami, code, "; Can't retrieve dump schedule"); return (code); } code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -1654,13 +1654,13 @@ bc_DumpCmd(as, arock) loadfile = 1; if (as->parms[0].items || as->parms[1].items || as->parms[2].items || as->parms[4].items) { - com_err(whoami, 0, "Invalid option specified with -file option"); + afs_com_err(whoami, 0, "Invalid option specified with -file option"); return -1; } } else { loadfile = 0; if (!as->parms[0].items || !as->parms[1].items) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Must specify volume set name and dump level name"); return -1; } @@ -1682,8 +1682,8 @@ bc_DumpCmd(as, arock) code = ktime_DateToLong(timeString, &atTime); free(timeString); if (code) { - com_err(whoami, 0, "Can't parse dump start date and time"); - com_err(whoami, 0, "%s", ktime_GetDateUsage()); + afs_com_err(whoami, 0, "Can't parse dump start date and time"); + afs_com_err(whoami, 0, "%s", ktime_GetDateUsage()); return (1); } } else @@ -1703,7 +1703,7 @@ bc_DumpCmd(as, arock) portCount = 1; portp = (afs_int32 *) malloc(sizeof(afs_int32)); if (!portp) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } @@ -1719,13 +1719,13 @@ bc_DumpCmd(as, arock) */ tvs = bc_FindVolumeSet(bc_globalConfig, vsName); if (!tvs) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't find volume set '%s' in backup database", vsName); return (-1); } baseds = bc_FindDumpSchedule(bc_globalConfig, dumpPath); if (!baseds) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't find dump schedule '%s' in backup database", dumpPath); return (-1); @@ -1745,7 +1745,7 @@ bc_DumpCmd(as, arock) */ if (doAt) { if (atTime < time(0)) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Time of dump is earlier then current time - not added"); } else { statusPtr = createStatusNode(); @@ -1784,7 +1784,7 @@ bc_DumpCmd(as, arock) statusPtr->scheduledDump = atTime; statusPtr->cmdLine = (char *)malloc(length); if (!statusPtr->cmdLine) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } @@ -1818,7 +1818,7 @@ bc_DumpCmd(as, arock) printf("Add scheduled dump as job %d\n", statusPtr->jobNumber); if ((atTime > ttoken.endTime) && (ttoken.endTime != NEVERDATE)) - com_err(whoami, 0, + afs_com_err(whoami, 0, "Warning: job %d starts after expiration of AFS token", statusPtr->jobNumber); @@ -1836,7 +1836,7 @@ bc_DumpCmd(as, arock) if (loadfile) { loadFile = (char *)malloc(strlen(as->parms[6].items->data) + 1); if (!loadFile) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return BC_NOMEM; } strcpy(loadFile, as->parms[6].items->data); @@ -1898,7 +1898,7 @@ bc_DumpCmd(as, arock) * dump at the level we requested it be done at. */ if (problemFindingDump) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Warning: Doing level %d dump due to missing higher-level dumps", level); if (parent) { @@ -1911,7 +1911,7 @@ bc_DumpCmd(as, arock) /* Expand out the volume set into its component list of volumes. */ code = bc_EvalVolumeSet(bc_globalConfig, tvs, &volsToDump, cstruct); if (code) { - com_err(whoami, code, "; Failed to evaluate volume set"); + afs_com_err(whoami, code, "; Failed to evaluate volume set"); return (-1); } if (!volsToDump) { @@ -1941,7 +1941,7 @@ bc_DumpCmd(as, arock) tve->cloneDate = 0; if (tve->cloneDate && (tve->cloneDate == tve->date)) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Warning: Timestamp on volume %s unchanged from previous dump", tve->name); } @@ -1966,7 +1966,7 @@ bc_DumpCmd(as, arock) parent, level, bc_Dumper, portp, /*portCount */ 1, baseds, doAppend, dontExecute); if (code) - com_err(whoami, code, "; Failed to queue dump"); + afs_com_err(whoami, code, "; Failed to queue dump"); return (code); } /*bc_DumpCmd */ @@ -1996,9 +1996,9 @@ bc_QuitCmd(as, arock) statusPtr = (statusP) ptr; if (!(statusPtr->flags & ABORT_REQUEST)) { unlock_Status(); - com_err(whoami, 0, "Job %d still running (and not aborted)", + afs_com_err(whoami, 0, "Job %d still running (and not aborted)", statusPtr->jobNumber); - com_err(whoami, 0, + afs_com_err(whoami, 0, "You must at least 'kill' all running jobs before quitting"); return -1; } @@ -2010,8 +2010,8 @@ bc_QuitCmd(as, arock) */ for (td = bc_dumpTasks, i = 0; i < BC_MAXSIMDUMPS; i++, td++) { if (td->flags & BC_DI_INUSE) { - com_err(whoami, 0, "A job is still running"); - com_err(whoami, 0, + afs_com_err(whoami, 0, "A job is still running"); + afs_com_err(whoami, 0, "You must at least 'kill' all running jobs before quitting"); return -1; } @@ -2042,26 +2042,26 @@ bc_LabelTapeCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } if (as->parms[0].items) { /* -name */ tapename = as->parms[0].items->data; if (strlen(tapename) >= TC_MAXTAPELEN) { - com_err(whoami, 0, "AFS tape name '%s' is too long", tapename); + afs_com_err(whoami, 0, "AFS tape name '%s' is too long", tapename); return -1; } } if (as->parms[3].items) { /* -pname */ if (tapename) { - com_err(whoami, 0, "Can only specify -name or -pname"); + afs_com_err(whoami, 0, "Can only specify -name or -pname"); return -1; } pname = as->parms[3].items->data; if (strlen(pname) >= TC_MAXTAPELEN) { - com_err(whoami, 0, "Permanent tape name '%s' is too long", pname); + afs_com_err(whoami, 0, "Permanent tape name '%s' is too long", pname); return -1; } } @@ -2069,7 +2069,7 @@ bc_LabelTapeCmd(as, arock) if (as->parms[1].items) { size = bc_FloatATOI(as->parms[1].items->data); if (size == -1) { - com_err(whoami, 0, "Bad syntax for tape size '%s'", + afs_com_err(whoami, 0, "Bad syntax for tape size '%s'", as->parms[1].items->data); return -1; } @@ -2103,7 +2103,7 @@ bc_ReadLabelCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -2134,7 +2134,7 @@ bc_ScanDumpsCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -2275,7 +2275,7 @@ bc_dbVerifyCmd(as, arock) &host); if (code) { - com_err(whoami, code, "; Unable to verify database"); + afs_com_err(whoami, code, "; Unable to verify database"); return (-1); } @@ -2284,7 +2284,7 @@ bc_dbVerifyCmd(as, arock) if (status == 0) printf("Database OK\n"); else - com_err(whoami, status, "; Database is NOT_OK"); + afs_com_err(whoami, status, "; Database is NOT_OK"); if (detail) { printf("Orphan blocks %d\n", orphans); @@ -2324,14 +2324,14 @@ deleteDump(dumpid, port, force) if (port >= 0) { tcode = bc_UpdateHosts(); if (tcode) { - com_err(whoami, tcode, "; Can't retrieve tape hosts"); + afs_com_err(whoami, tcode, "; Can't retrieve tape hosts"); ERROR(tcode); } /* Find the dump in the backup database */ tcode = bcdb_FindDumpByID(dumpid, &dumpEntry); if (tcode) { - com_err(whoami, tcode, "; Unable to locate dumpID %u in database", + afs_com_err(whoami, tcode, "; Unable to locate dumpID %u in database", dumpid); ERROR(tcode); } @@ -2351,7 +2351,7 @@ deleteDump(dumpid, port, force) if (tcode) { if (tcode == RXGEN_OPCODE) tcode = BC_VERSIONFAIL; - com_err(whoami, tcode, + afs_com_err(whoami, tcode, "; Unable to delete dumpID %u via butc", dumpid); ERROR(tcode); } @@ -2369,7 +2369,7 @@ deleteDump(dumpid, port, force) /* Wait for task to finish */ taskflag = waitForTask(taskId); if (taskflag & (TASK_ERROR | ABORT_DONE)) { - com_err(whoami, BUTX_DELETEOBJFAIL, + afs_com_err(whoami, BUTX_DELETEOBJFAIL, "; Unable to delete dumpID %u via butc", dumpid); ERROR(BUTX_DELETEOBJFAIL); /* the task failed */ } @@ -2389,7 +2389,7 @@ deleteDump(dumpid, port, force) tcode = bcdb_deleteDump(dumpid, 0, 0, &dumps); if (tcode) { - com_err(whoami, tcode, + afs_com_err(whoami, tcode, "; Unable to delete dumpID %u from database", dumpid); dumps.budb_dumpsList_len = 0; if (!code) @@ -2431,13 +2431,13 @@ bc_deleteDumpCmd(as, arock) /* Must specify at least one of -dumpid, -from, or -to */ if (!as->parms[0].items && !as->parms[1].items && !as->parms[2].items && !as->parms[4].items) { - com_err(whoami, 0, "Must specify at least one field"); + afs_com_err(whoami, 0, "Must specify at least one field"); return (-1); } /* Must have -to option with -from option */ if (as->parms[1].items && !as->parms[2].items) { - com_err(whoami, 0, "Must specify '-to' field with '-from' field"); + afs_com_err(whoami, 0, "Must specify '-to' field with '-from' field"); return (-1); } @@ -2453,8 +2453,8 @@ bc_deleteDumpCmd(as, arock) code = ktime_DateToLong(timeString, &fromTime); free(timeString); if (code) { - com_err(whoami, 0, "Can't parse 'from' date and time"); - com_err(whoami, 0, "%s", ktime_GetDateUsage()); + afs_com_err(whoami, 0, "Can't parse 'from' date and time"); + afs_com_err(whoami, 0, "%s", ktime_GetDateUsage()); return (-1); } havetime = 1; @@ -2485,8 +2485,8 @@ bc_deleteDumpCmd(as, arock) code = ktime_DateToLong(timeString, &toTime); free(timeString); if (code) { - com_err(whoami, 0, "Can't parse 'to' date and time"); - com_err(whoami, 0, "%s", ktime_GetDateUsage()); + afs_com_err(whoami, 0, "Can't parse 'to' date and time"); + afs_com_err(whoami, 0, "%s", ktime_GetDateUsage()); return (-1); } toTime += 59; @@ -2494,7 +2494,7 @@ bc_deleteDumpCmd(as, arock) } if (fromTime > toTime) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "'-from' date/time cannot be later than '-to' date/time"); return (-1); } @@ -2528,7 +2528,7 @@ bc_deleteDumpCmd(as, arock) code = bcdb_listDumps(sflags, groupId, fromTime, toTime, &dumps, &flags); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Error while deleting dumps from %u to %u", fromTime, toTime); rcode = -1; @@ -2582,7 +2582,7 @@ bc_saveDbCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -2605,8 +2605,8 @@ bc_saveDbCmd(as, arock) code = ktime_DateToLong(timeString, &toTime); free(timeString); if (code) { - com_err(whoami, 0, "Can't parse '-archive' date and time"); - com_err(whoami, 0, "%s", ktime_GetDateUsage()); + afs_com_err(whoami, 0, "Can't parse '-archive' date and time"); + afs_com_err(whoami, 0, "%s", ktime_GetDateUsage()); return (-1); } toTime += 59; @@ -2619,7 +2619,7 @@ bc_saveDbCmd(as, arock) code = TC_SaveDb(tconn, toTime, &taskId); if (code) { - com_err(whoami, code, "; Failed to save database"); + afs_com_err(whoami, code, "; Failed to save database"); goto exit; } @@ -2650,7 +2650,7 @@ bc_restoreDbCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -2666,7 +2666,7 @@ bc_restoreDbCmd(as, arock) code = TC_RestoreDb(tconn, &taskId); if (code) { - com_err(whoami, code, "; Failed to restore database"); + afs_com_err(whoami, code, "; Failed to restore database"); goto exit; } @@ -2833,7 +2833,7 @@ DBLookupByVolume(volumeName) } if (code) - com_err(whoami, code, ""); + afs_com_err(whoami, code, ""); return (code); } @@ -2923,7 +2923,7 @@ dumpInfo(dumpid, detailFlag) for (tapeNumber = dumpEntry.tapes.b; tapeNumber <= dumpEntry.tapes.maxTapes; tapeNumber++) { /*f */ tapeLinkPtr = (struct tapeLink *)malloc(sizeof(struct tapeLink)); if (!tapeLinkPtr) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } @@ -2975,7 +2975,7 @@ dumpInfo(dumpid, detailFlag) volumeLinkPtr = (struct volumeLink *)malloc(sizeof(struct volumeLink)); if (!volumeLinkPtr) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(volumeLinkPtr, 0, sizeof(*volumeLinkPtr)); @@ -3044,7 +3044,7 @@ dumpInfo(dumpid, detailFlag) error_exit: if (code) - com_err("dumpInfo", code, "; Can't get dump information"); + afs_com_err("dumpInfo", code, "; Can't get dump information"); /* free all allocated structures */ tapeLinkPtr = head; @@ -3103,7 +3103,7 @@ printRecentDumps(ndumps) if (code) { if (code == BUDB_ENDOFLIST) return 0; - com_err("dumpInfo", code, "; Can't get dump information"); + afs_com_err("dumpInfo", code, "; Can't get dump information"); return (code); } @@ -3156,13 +3156,13 @@ bc_dumpInfoCmd(as, arock) if (as->parms[0].items) { if (as->parms[1].items) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "These options are exclusive - select only one"); return (BC_BADARG); } ndumps = atoi(as->parms[0].items->data); if (ndumps <= 0) { - com_err(whoami, 0, "Must provide a positive number"); + afs_com_err(whoami, 0, "Must provide a positive number"); return -1; } diff --git a/src/bucoord/dump.c b/src/bucoord/dump.c index 350d5cd..2e45b7f 100644 --- a/src/bucoord/dump.c +++ b/src/bucoord/dump.c @@ -94,7 +94,7 @@ bc_Dumper(aindex) volDesc = (struct tc_dumpDesc *)malloc(count * sizeof(struct tc_dumpDesc)); if (!volDesc) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } @@ -144,11 +144,11 @@ bc_Dumper(aindex) printf("Starting dump\n"); code = TC_PerformDump(tconn, tcdiPtr, &volArray, &dumpTaskPtr->dumpID); if (code) { - com_err(whoami, code, "; Failed to start dump"); + afs_com_err(whoami, code, "; Failed to start dump"); ERROR(code); } - com_err(whoami, 0, "Task %u: Dump (%s)", dumpTaskPtr->dumpID, + afs_com_err(whoami, 0, "Task %u: Dump (%s)", dumpTaskPtr->dumpID, tcdiPtr->dumpName); /* create status monitor block */ @@ -266,7 +266,7 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, break; if (i >= BC_MAXSIMDUMPS) { - com_err(whoami, BC_NOTLOCKED, + afs_com_err(whoami, BC_NOTLOCKED, "All of the dump/restore slots are in use, try again later"); return (BC_NOTLOCKED); } @@ -305,7 +305,7 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer, (void *)i, "helper", &junk); if (code) { bc_HandleMisc(code); - com_err(whoami, code, "; Can't start thread"); + afs_com_err(whoami, code, "; Can't start thread"); /* Cleanup allocated data structures */ freeDumpTaskVolumeList(bc_dumpTasks[i].volumes); @@ -384,7 +384,7 @@ bc_LabelTape(afsname, pname, size, config, port) code = TC_LabelTape(tconn, &label, &taskId); if (code) { - com_err(whoami, code, "; Failed to start labeltape"); + afs_com_err(whoami, code, "; Failed to start labeltape"); return (code); } @@ -430,7 +430,7 @@ bc_ReadLabel(config, port) printf("Tape read was unlabelled\n"); return 0; } - com_err(whoami, code, "; Failed to start readlabel"); + afs_com_err(whoami, code, "; Failed to start readlabel"); return (code); } @@ -468,7 +468,7 @@ bc_ScanDumps(config, dbAddFlag, port) code = TC_ScanDumps(tconn, dbAddFlag, &taskId); if (code) { - com_err(whoami, code, "; Failed to start scantape"); + afs_com_err(whoami, code, "; Failed to start scantape"); return (code); } @@ -559,7 +559,7 @@ ConnectButc(config, port, tconn) code = bc_GetConn(config, port, tconn); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't connect to tape coordinator at port %d", port); return (code); } @@ -569,10 +569,10 @@ ConnectButc(config, port, tconn) rx_DestroyConnection(*tconn); if (code == BC_VERSIONFAIL) - com_err(whoami, code, + afs_com_err(whoami, code, "; Backup and butc are not the same version"); else - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't access tape coordinator at port %d", port); return (code); diff --git a/src/bucoord/dump_sched.c b/src/bucoord/dump_sched.c index 5fe77ac..e721ea0 100644 --- a/src/bucoord/dump_sched.c +++ b/src/bucoord/dump_sched.c @@ -91,7 +91,7 @@ bc_AddDumpCmd(as, arock) code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); + afs_com_err(whoami, code, "; Can't retrieve dump schedule"); return (code); } @@ -102,9 +102,9 @@ bc_AddDumpCmd(as, arock) /* validate the name dump name length */ if (strlen(dname) >= BU_MAX_DUMP_PATH) { - com_err(whoami, 0, "Dump names must be < %d characters", + afs_com_err(whoami, 0, "Dump names must be < %d characters", BU_MAX_DUMP_PATH); - com_err(whoami, 0, "Dump %s not added", dname); + afs_com_err(whoami, 0, "Dump %s not added", dname); code = -1; continue; } @@ -113,26 +113,26 @@ bc_AddDumpCmd(as, arock) bc_CreateDumpSchedule(bc_globalConfig, dname, expDate, expType); if (code) { if (code == -1) - com_err(whoami, 0, "Dump already exists"); + afs_com_err(whoami, 0, "Dump already exists"); else if (code == -2) - com_err(whoami, 0, "Invalid path name '%s'", dname); + afs_com_err(whoami, 0, "Invalid path name '%s'", dname); else if (code == -3) - com_err(whoami, 0, "Name specification error"); + afs_com_err(whoami, 0, "Name specification error"); else - com_err(whoami, code, "; Failed to create dump schedule"); + afs_com_err(whoami, code, "; Failed to create dump schedule"); continue; } /* save the new schedule item */ code = bc_SaveDumpSchedule(); if (code) { - com_err(whoami, code, "Cannot save dump schedule"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save dump schedule"); + afs_com_err(whoami, 0, "Changes are temporary - for this session only"); break; } - com_err(whoami, 0, "Created new dump schedule %s", dname); + afs_com_err(whoami, 0, "Created new dump schedule %s", dname); } error_exit: @@ -167,7 +167,7 @@ bc_DeleteDumpCmd(as, arock) code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); + afs_com_err(whoami, code, "; Can't retrieve dump schedule"); return (code); } @@ -176,9 +176,9 @@ bc_DeleteDumpCmd(as, arock) code = bc_DeleteDumpSchedule(bc_globalConfig, dname); if (code) { if (code == -1) - com_err(whoami, 0, "No such dump as %s", dname); + afs_com_err(whoami, 0, "No such dump as %s", dname); else - com_err(whoami, code, "; Failed to delete dump schedule"); + afs_com_err(whoami, code, "; Failed to delete dump schedule"); goto error_exit; } @@ -186,8 +186,8 @@ bc_DeleteDumpCmd(as, arock) if (code == 0) printf("backup: deleted dump schedule %s\n", dname); else { - com_err(whoami, code, "Cannot save dump schedule file"); - com_err(whoami, 0, "Deletion is temporary - for this session only"); + afs_com_err(whoami, code, "Cannot save dump schedule file"); + afs_com_err(whoami, 0, "Deletion is temporary - for this session only"); } error_exit: @@ -275,7 +275,7 @@ bc_ListDumpScheduleCmd(struct cmd_syndesc *as, char *arock) /* first check to see if schedules must be updated */ code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); + afs_com_err(whoami, code, "; Can't retrieve dump schedule"); return (code); } @@ -334,7 +334,7 @@ bc_SetExpCmd(as, arock) code = bc_UpdateDumpSchedule(); if (code) { - com_err(whoami, code, "; Can't retrieve dump schedule"); + afs_com_err(whoami, code, "; Can't retrieve dump schedule"); return (code); } @@ -346,15 +346,15 @@ bc_SetExpCmd(as, arock) /* validate the name dump name length */ if (strlen(dname) >= BU_MAX_DUMP_PATH) { code = -1; - com_err(whoami, 0, "Dump names must be < %d characters", + afs_com_err(whoami, 0, "Dump names must be < %d characters", BU_MAX_DUMP_PATH); - com_err(whoami, 0, "Dump %s not added", dname); + afs_com_err(whoami, 0, "Dump %s not added", dname); continue; } code = FindDump(bc_globalConfig, dname, &parent, &node); if (code) { - com_err(whoami, 0, "Dump level %s not found", dname); + afs_com_err(whoami, 0, "Dump level %s not found", dname); continue; } @@ -364,8 +364,8 @@ bc_SetExpCmd(as, arock) code = bc_SaveDumpSchedule(); if (code) { - com_err(whoami, code, "Cannot save dump schedule"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save dump schedule"); + afs_com_err(whoami, 0, "Expiration changes effective for this session only"); } @@ -423,7 +423,7 @@ bc_ParseDumpSchedule() || (dsversion != BC_SCHEDULE_VERSION) ) { /* invalid or unexpected header - error */ - com_err(whoami, 0, "Unable to understand dump schedule file"); + afs_com_err(whoami, 0, "Unable to understand dump schedule file"); return (BC_INTERNALERROR); } } @@ -437,7 +437,7 @@ bc_ParseDumpSchedule() sscanf(tbuffer, "%s %s %d %d", dsname, period, &expDate, &expType); if (code != 4) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Syntax error in dump schedule file, line is: %s", tbuffer); return (BC_INTERNALERROR); diff --git a/src/bucoord/main.c b/src/bucoord/main.c index 3b9ed95..1aa62a2 100644 --- a/src/bucoord/main.c +++ b/src/bucoord/main.c @@ -251,14 +251,14 @@ backupInit() /* don't run more than once */ if (initd) { - com_err(whoami, 0, "Backup already initialized."); + afs_com_err(whoami, 0, "Backup already initialized."); return 0; } initd = 1; code = bc_InitConfig(DefaultConfDir); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "Can't initialize from config files in directory '%s'", DefaultConfDir); return (code); @@ -269,13 +269,13 @@ backupInit() */ code = LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid); if (code) { - com_err(whoami, code, "; Can't initialize LWP"); + afs_com_err(whoami, code, "; Can't initialize LWP"); return (code); } code = rx_Init(htons(0)); if (code) { - com_err(whoami, code, "; Can't initialize Rx"); + afs_com_err(whoami, code, "; Can't initialize Rx"); return (code); } @@ -297,7 +297,7 @@ backupInit() LWP_CreateProcess(statusWatcher, 20480, LWP_NORMAL_PRIORITY, (void *)2, "statusWatcher", &watcherPid); if (code) { - com_err(whoami, code, "; Can't create status monitor task"); + afs_com_err(whoami, code, "; Can't create status monitor task"); return (code); } @@ -341,14 +341,14 @@ MyBeforeProc(as) code = backupInit(); if (code) { - com_err(whoami, code, "; Can't initialize backup"); + afs_com_err(whoami, code, "; Can't initialize backup"); exit(1); } /* Get initial information from the database */ code = bc_InitTextConfig(); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't obtain configuration text from backup database"); exit(1); } @@ -409,7 +409,7 @@ doDispatch(targc, targv, dispatchCount) if (internalLoadFile) { /* Load a file in */ if (dispatchCount > MAXRECURSION) { /* Beware recursive loops. */ - com_err(whoami, 0, "Potential recursion: will not load file %s", + afs_com_err(whoami, 0, "Potential recursion: will not load file %s", internalLoadFile); code = -1; goto done; @@ -417,7 +417,7 @@ doDispatch(targc, targv, dispatchCount) fd = fopen(internalLoadFile, "r"); /* Open the load file */ if (!fd) { - com_err(whoami, errno, "; Cannot open file %s", internalLoadFile); + afs_com_err(whoami, errno, "; Cannot open file %s", internalLoadFile); code = -1; goto done; } @@ -444,7 +444,7 @@ doDispatch(targc, targv, dispatchCount) (!noExecute)) { /* or no execute */ c = cmd_ParseLine(lineBuffer, sargv, &sargc, MAXV); if (c) { - com_err(whoami, c, "; Can't parse line"); + afs_com_err(whoami, c, "; Can't parse line"); } else { doDispatch(sargc, sargv, dispatchCount + 1); /* Recursive - ignore error */ cmd_FreeArgv(sargv); /* Free up arguments */ @@ -796,8 +796,8 @@ main(argc, argv) if (!LineIsBlank(lineBuffer)) { code = cmd_ParseLine(lineBuffer, targv, &targc, MAXV); if (code) - com_err(whoami, code, "; Can't parse line: '%s'", - error_message(code)); + afs_com_err(whoami, code, "; Can't parse line: '%s'", + afs_error_message(code)); else { doDispatch(targc, targv, 1); cmd_FreeArgv(targv); diff --git a/src/bucoord/restore.c b/src/bucoord/restore.c index b6b6784..24a3042 100644 --- a/src/bucoord/restore.c +++ b/src/bucoord/restore.c @@ -203,7 +203,7 @@ bc_Restorer(aindex) volumeEntries = (struct budb_volumeEntry *) malloc(MAXTAPESATONCE * sizeof(struct budb_volumeEntry)); if (!volumeEntries) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } @@ -236,7 +236,7 @@ bc_Restorer(aindex) } if (code) { /* If FindDump took an error */ - com_err(whoami, code, "; Can't find any dump for volume %s", + afs_com_err(whoami, code, "; Can't find any dump for volume %s", tvol->name); continue; } @@ -255,7 +255,7 @@ bc_Restorer(aindex) if (!di) { di = (struct dumpinfo *)malloc(sizeof(struct dumpinfo)); if (!di) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(di, 0, sizeof(struct dumpinfo)); @@ -277,7 +277,7 @@ bc_Restorer(aindex) /* Create one and thread into list */ vi = (struct volinfo *)malloc(sizeof(struct volinfo)); if (!vi) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(vi, 0, sizeof(struct volinfo)); @@ -285,7 +285,7 @@ bc_Restorer(aindex) vi->volname = (char *)malloc(strlen(vname) + 1); if (!vi->volname) { free(vi); - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } @@ -317,7 +317,7 @@ bc_Restorer(aindex) code = bcdb_FindDumpByID(parent, &dumpDescr1); if (code) { for (vi = di->volinfolist; vi; vi = vi->next) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't find parent DumpID %u for volume %s", parent, vi->volname); } @@ -369,7 +369,7 @@ bc_Restorer(aindex) break; } - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't find volume %s in DumpID %u", vi->volname, dlevels[lv].DumpId); ERROR(code); @@ -450,7 +450,7 @@ bc_Restorer(aindex) tle = (struct bc_tapeList *) malloc(sizeof(struct bc_tapeList)); if (!tle) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (BC_NOMEM); } memset(tle, 0, sizeof(struct bc_tapeList)); @@ -460,7 +460,7 @@ bc_Restorer(aindex) + 1); if (!tle->tapeName) { free(tle); - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (BC_NOMEM); } @@ -505,7 +505,7 @@ bc_Restorer(aindex) ti = (struct bc_tapeItem *) malloc(sizeof(struct bc_tapeItem)); if (!ti) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (BC_NOMEM); } memset(ti, 0, sizeof(struct bc_tapeItem)); @@ -515,7 +515,7 @@ bc_Restorer(aindex) + 1); if (!ti->volumeName) { free(ti); - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); return (BC_NOMEM); } @@ -548,7 +548,7 @@ bc_Restorer(aindex) } /* di: For each dump */ if (!nentries) { - com_err(whoami, 0, "No volumes to restore"); + afs_com_err(whoami, 0, "No volumes to restore"); ERROR(0); } @@ -605,7 +605,7 @@ bc_Restorer(aindex) (struct tc_restoreDesc *)malloc(nentries * sizeof(struct tc_restoreDesc)); if (!tcarray) { - com_err(whoami, BC_NOMEM, ""); + afs_com_err(whoami, BC_NOMEM, ""); ERROR(BC_NOMEM); } memset(tcarray, 0, nentries * sizeof(struct tc_restoreDesc)); @@ -687,7 +687,7 @@ bc_Restorer(aindex) TC_PerformRestore(aconn, "DumpSetName", &rpcArray, &dumpTaskPtr->dumpID); if (code) { - com_err(whoami, code, "; Failed to start restore"); + afs_com_err(whoami, code, "; Failed to start restore"); break; } diff --git a/src/bucoord/tape_hosts.c b/src/bucoord/tape_hosts.c index 479a931..6318968 100644 --- a/src/bucoord/tape_hosts.c +++ b/src/bucoord/tape_hosts.c @@ -66,7 +66,7 @@ bc_AddHostCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -85,14 +85,14 @@ bc_AddHostCmd(as, arock) printf("failed\n"); fflush(stdout); if (code == EEXIST) - com_err(whoami, 0, "Port offset already in tape database"); + afs_com_err(whoami, 0, "Port offset already in tape database"); ERROR(code); } code = bc_SaveHosts(); if (code) { - com_err(whoami, code, "Cannot save tape hosts"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save tape hosts"); + afs_com_err(whoami, 0, "Changes are temporary - for this session only"); ERROR(code); } @@ -124,7 +124,7 @@ bc_DeleteHostCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -150,8 +150,8 @@ bc_DeleteHostCmd(as, arock) code = bc_SaveHosts(); if (code) { - com_err(whoami, code, "Cannot save tape hosts"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save tape hosts"); + afs_com_err(whoami, 0, "Changes are temporary - for this session only"); ERROR(code); } @@ -184,7 +184,7 @@ bc_ListHostsCmd(as, arock) code = bc_UpdateHosts(); if (code) { - com_err(whoami, code, "; Can't retrieve tape hosts"); + afs_com_err(whoami, code, "; Can't retrieve tape hosts"); return (code); } @@ -264,7 +264,7 @@ bc_ParseHosts() sscanf(tbuffer, "%s %u", hostName, &port); th = gethostbyname(hostName); if (th == 0) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "can't get host info for %s from nameserver or /etc/hosts.", hostName); } @@ -378,7 +378,7 @@ bc_UpdateHosts() } if (ctPtr->textVersion != -1) { - com_err(whoami, 0, "obsolete tapehosts - updating"); + afs_com_err(whoami, 0, "obsolete tapehosts - updating"); bc_ClearHosts(); } diff --git a/src/bucoord/ubik_db_if.c b/src/bucoord/ubik_db_if.c index 121796e..aead815 100644 --- a/src/bucoord/ubik_db_if.c +++ b/src/bucoord/ubik_db_if.c @@ -32,6 +32,7 @@ RCSID #include #include #include +#include #include #include "bc.h" @@ -727,7 +728,7 @@ bc_LockText(ctPtr) /* Mention something every 30 seconds */ if (++j >= 30) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Waiting for db configuration text unlock"); j = 0; } @@ -823,7 +824,7 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH)); if (!acdir) { - com_err(whoami, 0, "Can't open configuration directory '%s'", + afs_com_err(whoami, 0, "Can't open configuration directory '%s'", (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH)); ERROR(BC_NOCELLCONFIG); @@ -834,7 +835,7 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) code = afsconf_GetLocalCell(acdir, cname, sizeof(cname)); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't get the local cell name - check %s/%s", (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE); @@ -845,7 +846,7 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) code = afsconf_GetCellInfo(acdir, cellName, AFSCONF_VLDBSERVICE, &info); if (code) { - com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s", + afs_com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s", cellName, (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE); @@ -859,12 +860,12 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) if (localauth) { code = afsconf_GetLatestKey(acdir, 0, 0); if (code) { - com_err(whoami, code, "; Can't get key from local key file"); + afs_com_err(whoami, code, "; Can't get key from local key file"); ERROR(code); } else { code = afsconf_ClientAuth(acdir, &sc, &scIndex); if (code) { - com_err(whoami, code, "; Calling ClientAuth"); + afs_com_err(whoami, code, "; Calling ClientAuth"); ERROR(code); } @@ -879,11 +880,11 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) code = ktc_GetToken(&sname, ttoken, sizeof(struct ktc_token), NULL); if (code) { - com_err(whoami, code, 0, + afs_com_err(whoami, code, 0, "; Can't get AFS tokens - running unauthenticated"); } else { if ((ttoken->kvno < 0) || (ttoken->kvno > 255)) - com_err(whoami, 0, + afs_com_err(whoami, 0, "Funny kvno (%d) in ticket, proceeding", ttoken->kvno); @@ -903,14 +904,14 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) ttoken->ticket); break; default: - com_err(whoami, 0, "Unsupported authentication type %d", scIndex); + afs_com_err(whoami, 0, "Unsupported authentication type %d", scIndex); ERROR(-1); break; } } if (!sc) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't create a security object with security index %d", scIndex); ERROR(-1); @@ -920,7 +921,7 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) UV_SetSecurity(sc, scIndex); if (info.numServers > VLDB_MAXSERVERS) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Warning: %d VLDB servers exist for cell '%s', can only remember the first %d", info.numServers, cellName, VLDB_MAXSERVERS); info.numServers = VLDB_MAXSERVERS; @@ -936,7 +937,7 @@ vldbClientInit(noAuthFlag, localauth, cellName, cstruct, ttoken) *cstruct = 0; code = ubik_ClientInit(serverconns, cstruct); if (code) { - com_err(whoami, code, "; Can't initialize ubik connection to vldb"); + afs_com_err(whoami, code, "; Can't initialize ubik connection to vldb"); ERROR(code); } @@ -967,7 +968,7 @@ udbClientInit(noAuthFlag, localauth, cellName) afsconf_Open((localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH)); if (!acdir) { - com_err(whoami, 0, "Can't open configuration directory '%s'", + afs_com_err(whoami, 0, "Can't open configuration directory '%s'", (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH)); ERROR(BC_NOCELLCONFIG); @@ -978,7 +979,7 @@ udbClientInit(noAuthFlag, localauth, cellName) code = afsconf_GetLocalCell(acdir, cname, sizeof(cname)); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't get the local cell name - check %s/%s", (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_THISCELL_FILE); @@ -989,7 +990,7 @@ udbClientInit(noAuthFlag, localauth, cellName) code = afsconf_GetCellInfo(acdir, cellName, 0, &info); if (code) { - com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s", + afs_com_err(whoami, code, "; Can't find cell %s's hosts in %s/%s", cellName, (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH), AFSDIR_CELLSERVDB_FILE); @@ -1001,14 +1002,14 @@ udbClientInit(noAuthFlag, localauth, cellName) if (localauth) { code = afsconf_GetLatestKey(acdir, 0, 0); if (code) { - com_err(whoami, code, "; Can't get key from local key file"); + afs_com_err(whoami, code, "; Can't get key from local key file"); ERROR(-1); } else { code = afsconf_ClientAuth(acdir, &udbHandle.uh_secobj, &udbHandle.uh_scIndex); if (code) { - com_err(whoami, code, "; Calling ClientAuth"); + afs_com_err(whoami, code, "; Calling ClientAuth"); ERROR(-1); } } @@ -1022,11 +1023,11 @@ udbClientInit(noAuthFlag, localauth, cellName) /* get token */ code = ktc_GetToken(&principal, &token, sizeof(token), NULL); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't get tokens - running unauthenticated"); } else { if ((token.kvno < 0) || (token.kvno > 255)) - com_err(whoami, 0, + afs_com_err(whoami, 0, "Unexpected kvno (%d) in ticket - proceeding", token.kvno); udbHandle.uh_scIndex = RX_SCINDEX_KAD; /* Kerberos */ @@ -1046,7 +1047,7 @@ udbClientInit(noAuthFlag, localauth, cellName) break; default: - com_err(whoami, 0, "Unsupported authentication type %d", + afs_com_err(whoami, 0, "Unsupported authentication type %d", udbHandle.uh_scIndex); ERROR(-1); break; @@ -1054,14 +1055,14 @@ udbClientInit(noAuthFlag, localauth, cellName) } if (!udbHandle.uh_secobj) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't create a security object with security index %d", udbHandle.uh_secobj); ERROR(-1); } if (info.numServers > MAXSERVERS) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Warning: %d BDB servers exist for cell '%s', can only remember the first %d", info.numServers, cellName, MAXSERVERS); info.numServers = MAXSERVERS; @@ -1078,7 +1079,7 @@ udbClientInit(noAuthFlag, localauth, cellName) code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; Can't initialize ubik connection to backup database"); ERROR(code); } @@ -1100,7 +1101,7 @@ udbClientInit(noAuthFlag, localauth, cellName) ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, &udbHandle.uh_instanceId); if (code) { - com_err(whoami, code, "; Can't access backup database"); + afs_com_err(whoami, code, "; Can't access backup database"); ERROR(code); } @@ -1313,7 +1314,7 @@ udbLocalInit() code = ubik_ParseClientList(3, args, serverList); if (code) { - com_err(whoami, code, "; udbLocalInit: parsing ubik server list"); + afs_com_err(whoami, code, "; udbLocalInit: parsing ubik server list"); return (-1); } @@ -1327,14 +1328,14 @@ udbLocalInit() BUDB_SERVICE, udbHandle.uh_secobj, udbHandle.uh_scIndex); if (udbHandle.uh_serverConn[i] == 0) { - com_err(whoami, 0, "connection %d failed", i); + afs_com_err(whoami, 0, "connection %d failed", i); continue; } } udbHandle.uh_serverConn[i] = 0; code = ubik_ClientInit(udbHandle.uh_serverConn, &udbHandle.uh_client); if (code) { - com_err(whoami, code, "; in ubik_ClientInit"); + afs_com_err(whoami, code, "; in ubik_ClientInit"); return (code); } @@ -1342,7 +1343,7 @@ udbLocalInit() ubik_Call(BUDB_GetInstanceId, udbHandle.uh_client, 0, &udbHandle.uh_instanceId); if (code) { - com_err(whoami, code, "; Can't estblish instance Id"); + afs_com_err(whoami, code, "; Can't estblish instance Id"); return (code); } diff --git a/src/bucoord/vol_sets.c b/src/bucoord/vol_sets.c index 791c4be..6190d6e 100644 --- a/src/bucoord/vol_sets.c +++ b/src/bucoord/vol_sets.c @@ -73,7 +73,7 @@ bc_AddVolEntryCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } @@ -81,7 +81,7 @@ bc_AddVolEntryCmd(as, arock) tset = bc_FindVolumeSet(bc_globalConfig, volSetName); if (!tset) { - com_err(whoami, code, "; Volume entry not added"); + afs_com_err(whoami, code, "; Volume entry not added"); ERROR(code); } @@ -93,7 +93,7 @@ bc_AddVolEntryCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } @@ -101,15 +101,15 @@ bc_AddVolEntryCmd(as, arock) bc_AddVolumeItem(bc_globalConfig, volSetName, serverName, partitionName, volRegExp); if (code) { - com_err(whoami, code, "; Volume entry not added"); + afs_com_err(whoami, code, "; Volume entry not added"); ERROR(code); } if (!(tset->flags & VSFLAG_TEMPORARY)) { code = bc_SaveVolumeSet(); if (code) { - com_err(whoami, code, "Cannot save volume set file"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save volume set file"); + afs_com_err(whoami, 0, "Changes are temporary - for this session only"); } } @@ -154,7 +154,7 @@ bc_AddVolSetCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } @@ -164,14 +164,14 @@ bc_AddVolSetCmd(as, arock) flags); if (code) { if (code == -1) - com_err(whoami, 0, "Volume set '%s' already exists", ti->data); + afs_com_err(whoami, 0, "Volume set '%s' already exists", ti->data); else - com_err(whoami, 0, "Unknown problem"); + afs_com_err(whoami, 0, "Unknown problem"); } else if (!(flags & VSFLAG_TEMPORARY)) { code = bc_SaveVolumeSet(); if (code) { - com_err(whoami, code, "Cannot save new volume set file"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save new volume set file"); + afs_com_err(whoami, 0, "Changes are temporary - for this session only"); } } @@ -205,7 +205,7 @@ bc_DeleteVolEntryCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } @@ -214,7 +214,7 @@ bc_DeleteVolEntryCmd(as, arock) tset = bc_FindVolumeSet(bc_globalConfig, vsname); if (!tset) { - com_err(whoami, 0, "No such volume set as '%s'", vsname); + afs_com_err(whoami, 0, "No such volume set as '%s'", vsname); ERROR(code); } @@ -226,13 +226,13 @@ bc_DeleteVolEntryCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } entry = bc_SafeATOI(as->parms[1].items->data); if (entry < 0) { - com_err(whoami, 0, "Can't parse entry number '%s' as decimal integer", + afs_com_err(whoami, 0, "Can't parse entry number '%s' as decimal integer", as->parms[1].items->data); ERROR(BC_BADARG); } @@ -240,12 +240,12 @@ bc_DeleteVolEntryCmd(as, arock) code = bc_DeleteVolumeItem(bc_globalConfig, vsname, entry); if (code) { if (code == -1) { - com_err(whoami, 0, "No such volume set as '%s'", vsname); + afs_com_err(whoami, 0, "No such volume set as '%s'", vsname); } else if (code == -2) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "There aren't %d volume items for this volume set", entry); - com_err(whoami, 0, + afs_com_err(whoami, 0, "Use the 'listvolsets' command to examine the volume set"); } ERROR(code); @@ -257,8 +257,8 @@ bc_DeleteVolEntryCmd(as, arock) printf("backup: deleted volume entry %d from volume set %s\n", entry, vsname); } else { - com_err(whoami, code, "Cannot save volume set file"); - com_err(whoami, 0, + afs_com_err(whoami, code, "Cannot save volume set file"); + afs_com_err(whoami, 0, "Deletion is temporary - for this session only"); } } @@ -300,7 +300,7 @@ bc_DeleteVolSetCmd(as, arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } @@ -308,9 +308,9 @@ bc_DeleteVolSetCmd(as, arock) code = bc_DeleteVolumeSet(bc_globalConfig, ti->data, &flags); if (code) { if (code == -1) - com_err(whoami, 0, "Can't find volume set '%s'", ti->data); + afs_com_err(whoami, 0, "Can't find volume set '%s'", ti->data); else - com_err(whoami, code, + afs_com_err(whoami, code, "; Unknown problem deleting volume set '%s'", ti->data); } else { @@ -326,8 +326,8 @@ bc_DeleteVolSetCmd(as, arock) if (c) { if (!code) code = c; - com_err(whoami, c, "Cannot save updated volume set file"); - com_err(whoami, 0, "Deletion effective for this session only"); + afs_com_err(whoami, c, "Cannot save updated volume set file"); + afs_com_err(whoami, 0, "Deletion effective for this session only"); } } @@ -374,7 +374,7 @@ bc_ListVolSetCmd(struct cmd_syndesc *as, char *arock) code = bc_UpdateVolumeSet(); if (code) { - com_err(whoami, code, "; Can't retrieve volume sets"); + afs_com_err(whoami, code, "; Can't retrieve volume sets"); return (code); } @@ -387,7 +387,7 @@ bc_ListVolSetCmd(struct cmd_syndesc *as, char *arock) ListVolSet(tset); printf("\n"); } else { - com_err(whoami, 0, "Can't find volume set '%s'", ti->data); + afs_com_err(whoami, 0, "Can't find volume set '%s'", ti->data); code = 1; } } @@ -495,7 +495,7 @@ bc_ParseVolumeSet() if ((code != 2) || (strcmp(serverName, "volumeset") != 0) ) { - com_err(whoami, 0, "Bad volume header line: '%s'", tbuffer); + afs_com_err(whoami, 0, "Bad volume header line: '%s'", tbuffer); return (-1); } @@ -534,13 +534,13 @@ bc_ParseVolumeSet() tve = (struct bc_volumeEntry *) malloc(sizeof(struct bc_volumeEntry)); if (!tve) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't malloc() a new volume spec record!"); return (-1); } memset(tve, 0, sizeof(*tve)); if (bc_ParseHost(serverName, &(tve->server))) - com_err(whoami, 0, "Can't get required info on host '%s'", + afs_com_err(whoami, 0, "Can't get required info on host '%s'", serverName); /* The above code has filled in the server sockaddr, now fill in @@ -548,26 +548,26 @@ bc_ParseVolumeSet() */ tve->serverName = (char *)malloc(strlen(serverName) + 1); if (!tve->serverName) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't malloc() a new volume spec server name field!"); return (-1); } strcpy(tve->serverName, serverName); tve->partname = (char *)malloc(strlen(partName) + 1); if (!tve->partname) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't malloc() a new volume spec partition pattern field!"); return (-1); } strcpy(tve->partname, partName); code = bc_GetPartitionID(partName, &tve->partition); if (code) { - com_err(whoami, 0, "Can't parse partition '%s'", partName); + afs_com_err(whoami, 0, "Can't parse partition '%s'", partName); return -1; } tp = (char *)malloc(strlen(vsname) + 1); if (!tp) { - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't malloc() a new volume spec volume pattern field!"); return (-1); } diff --git a/src/bucoord/volstub.c b/src/bucoord/volstub.c index 4742671..d143df1 100644 --- a/src/bucoord/volstub.c +++ b/src/bucoord/volstub.c @@ -27,6 +27,7 @@ RCSID #include "volser.h" #include "bc.h" #include +#include extern char *whoami; @@ -76,7 +77,7 @@ volImageTime(serv, part, volid, voltype, clDatePtr) code = UV_ListOneVolume(htonl(serv), part, volid, &viptr); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "Warning: Can't get clone time of volume %u - using 0", volid); *clDatePtr = 0; @@ -98,7 +99,7 @@ volImageTime(serv, part, volid, voltype, clDatePtr) break; default: - com_err(whoami, 0, + afs_com_err(whoami, 0, "Can't get clone time of volume %u - unknown volume type", volid); return (-1); diff --git a/src/budb/server.c b/src/budb/server.c index b33f963..3a2f83e 100644 --- a/src/budb/server.c +++ b/src/budb/server.c @@ -409,7 +409,7 @@ main(argc, argv) #ifdef AFS_NT40_ENV ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0); #endif - com_err(whoami, errno, "; Unable to obtain AFS server directory."); + afs_com_err(whoami, errno, "; Unable to obtain AFS server directory."); exit(2); } @@ -467,7 +467,7 @@ main(argc, argv) BU_conf = afsconf_Open(globalConfPtr->cellConfigdir); if (BU_conf == 0) { LogError(code, "Failed getting cell info\n"); - com_err(whoami, code, "Failed getting cell info"); + afs_com_err(whoami, code, "Failed getting cell info"); ERROR(BUDB_NOCELLS); } @@ -550,7 +550,7 @@ main(argc, argv) if (code) { LogError(code, "Ubik init failed\n"); - com_err(whoami, code, "Ubik init failed"); + afs_com_err(whoami, code, "Ubik init failed"); ERROR(code); } @@ -677,8 +677,8 @@ LogError(code, a, b, c, d, e, f, g, h, i) fprintf(globalConfPtr->log, "%s ", TimeStamp(now)); if (code) - fprintf(globalConfPtr->log, "%s: %s\n", error_table_name(code), - error_message(code)); + fprintf(globalConfPtr->log, "%s: %s\n", afs_error_table_name(code), + afs_error_message(code)); fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i); fflush(globalConfPtr->log); fclose(globalConfPtr->log); diff --git a/src/butc/lwps.c b/src/butc/lwps.c index 798f981..038d5bc 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -175,8 +175,8 @@ PrintLog(log, error1, error2, str, a, b, c, d, e, f, g, h, i, j) err1 = "Volume has moved to another server"; break; default: - err1 = (char *)error_message(error1); - err2 = (char *)error_table_name(error1); + err1 = (char *)afs_error_message(error1); + err2 = (char *)afs_error_table_name(error1); break; } if (error1 == -1) @@ -184,7 +184,7 @@ PrintLog(log, error1, error2, str, a, b, c, d, e, f, g, h, i, j) else fprintf(log, " %s: %s", err2, err1); if (error2) - fprintf(log, ": %s", error_message(error2)); + fprintf(log, ": %s", afs_error_message(error2)); fprintf(log, "\n"); } fflush(log); @@ -573,7 +573,7 @@ unmountTape(taskId, tapeInfoPtr) } if (rcpid == -1 && errno != EINTR) { tapemounted = 0; - com_err(whoami, errno, + afs_com_err(whoami, errno, "Error waiting for callout script to terminate."); break; } @@ -737,7 +737,7 @@ PromptForTape(flag, name, dbDumpId, taskId, tapecount) } /* if waitpid experienced an error, we prompt */ if (rcpid == -1 && errno != EINTR) { - com_err(whoami, errno, + afs_com_err(whoami, errno, "Error waiting for callout script to terminate."); TLog(taskId, "Can't get exit status from callout script. will prompt\n"); diff --git a/src/butm/butm_test.c b/src/butm/butm_test.c index 7a5d327..4fe7997 100644 --- a/src/butm/butm_test.c +++ b/src/butm/butm_test.c @@ -34,7 +34,7 @@ static char *whoami = "TEST FAIL"; if (code != err) \ { \ printf("FAILURE: expected %u; got %u\n", err, code); \ - if (code) com_err(whoami, code, ""); \ + if (code) afs_com_err(whoami, code, ""); \ } \ else printf("PASSED; got %u\n", err); \ printf("\n"); @@ -43,7 +43,7 @@ static char *whoami = "TEST FAIL"; { \ printf("TEST: %s\n", str); \ printf("FAILURE: expected %u; got %u\n", err, code); \ - if (code) com_err(whoami, code, ""); \ + if (code) afs_com_err(whoami, code, ""); \ printf("\n"); \ } #define NOREWIND 0 diff --git a/src/butm/file_tm.c b/src/butm/file_tm.c index 17f7a0c..e6b71ab 100644 --- a/src/butm/file_tm.c +++ b/src/butm/file_tm.c @@ -1752,7 +1752,7 @@ file_Configure(file) struct tapeConfig *file; { if (!file) { - com_err(whoami, BUTM_BADCONFIG, "device not specified"); + afs_com_err(whoami, BUTM_BADCONFIG, "device not specified"); return BUTM_BADCONFIG; } @@ -1763,13 +1763,13 @@ file_Configure(file) /* Tape must be large enough to at least fit a label */ if (config.tapeSize <= 0) { - com_err(whoami, BUTM_BADCONFIG, "Tape size bogus: %d Kbytes", + afs_com_err(whoami, BUTM_BADCONFIG, "Tape size bogus: %d Kbytes", config.tapeSize); return BUTM_BADCONFIG; } if (strlen(config.tapedir) == 0) { - com_err(whoami, BUTM_BADCONFIG, "no tape device specified"); + afs_com_err(whoami, BUTM_BADCONFIG, "no tape device specified"); return BUTM_BADCONFIG; } diff --git a/src/butm/test_ftm.c b/src/butm/test_ftm.c index f8d1406..2942b92 100644 --- a/src/butm/test_ftm.c +++ b/src/butm/test_ftm.c @@ -131,14 +131,14 @@ main(argc, argv) else if (strncmp(argv[i], "-tapename", strlen(argv[i])) == 0) tape = argv[++i]; else { - com_err(whoami, 0, "unexpected command argument: '%s'", + afs_com_err(whoami, 0, "unexpected command argument: '%s'", argv[i]); goto usage; } } else { struct stat buf; if (stat(argv[i], &buf)) { - com_err(whoami, errno, "can't stat filename parameter %s\n", + afs_com_err(whoami, errno, "can't stat filename parameter %s\n", argv[i]); } else { if ((buf.st_mode & S_IFREG) && (buf.st_mode & 0444)) @@ -152,12 +152,12 @@ main(argc, argv) goto usage; if ((strlen(tape) == 0) || (strlen(tape) >= BU_MAXTAPELEN)) { - com_err(whoami, 0, "bogus tape name"); + afs_com_err(whoami, 0, "bogus tape name"); goto usage; } code = GetDeviceInfo(config, &confInfo); if (code) { - com_err(whoami, 0, "cant find tape config info"); + afs_com_err(whoami, 0, "cant find tape config info"); goto usage; } @@ -169,12 +169,12 @@ main(argc, argv) printf("%s: Beginning Dump Tests\n", whoami); code = LWP_InitializeProcessSupport(1, &parent_pid); if (code) { - com_err(whoami, code, "Can't init LWP lib"); + afs_com_err(whoami, code, "Can't init LWP lib"); exit(1); } code = IOMGR_Initialize(); if (code) { - com_err(whoami, code, "Can't init LWP IOMGR lib"); + afs_com_err(whoami, code, "Can't init LWP IOMGR lib"); exit(1); } /* Perform normal test */ @@ -182,7 +182,7 @@ main(argc, argv) LWP_CreateProcess(PerformDumpTest, 100000, 0, (void *)&ti, "BUTM Tester", &pid); if (code) { - com_err(whoami, code, "libbutm.a: Normal Tests failed!. :-( "); + afs_com_err(whoami, code, "libbutm.a: Normal Tests failed!. :-( "); exit(code); } LWP_WaitProcess(&ti.dumpDone); @@ -195,7 +195,7 @@ main(argc, argv) LWP_CreateProcess(PerformDumpTest, 100000, 0, (void *)&ti, "BUTM Tester", &pid); if (code) { - com_err(whoami, code, "libbutm.a: Appended Tests failed!. :-( "); + afs_com_err(whoami, code, "libbutm.a: Appended Tests failed!. :-( "); exit(code); } @@ -228,7 +228,7 @@ PerformDumpTest(TestInfo * tip) info.structVersion = BUTM_MAJORVERSION; if (code = butm_file_Instantiate(&info, tip->tc_Infop)) { - com_err(whoami, code, "instantiating file tape"); + afs_com_err(whoami, code, "instantiating file tape"); ERROR_EXIT(2); } @@ -251,19 +251,19 @@ PerformDumpTest(TestInfo * tip) strcpy(label.comment, T_COMMENT); if (code = butm_Mount(&info, tip->tapeName)) { - com_err(whoami, code, "setting up tape"); + afs_com_err(whoami, code, "setting up tape"); ERROR_EXIT(2); } if (tip->appended) { /* This is to be an appended dump */ code = butm_SeekEODump(&info, tip->nFiles + 1); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "Can't append: Can't position to end of dump on tape\n"); ERROR_EXIT(code); } } if ((code = butm_Create(&info, &label, !tip->appended /*Rewind */ ))) { - com_err(whoami, code, "Writing tape label"); + afs_com_err(whoami, code, "Writing tape label"); ERROR_EXIT(2); } @@ -272,34 +272,34 @@ PerformDumpTest(TestInfo * tip) int len; int fid = open(tip->files[i], O_RDONLY, 0); if (fid < 0) { - com_err(whoami, errno, "opening file to write on tape"); + afs_com_err(whoami, errno, "opening file to write on tape"); ERROR_EXIT(3); } if (code = butm_WriteFileBegin(&info)) { - com_err(whoami, code, "beginning butm write file"); + afs_com_err(whoami, code, "beginning butm write file"); ERROR_EXIT(3); } while ((len = read(fid, bufferBlock->data, BUTM_BLKSIZE)) > 0) { if (code = butm_WriteFileData(&info, bufferBlock->data, 1, len)) { - com_err(whoami, code, "butm writing file data"); + afs_com_err(whoami, code, "butm writing file data"); ERROR_EXIT(3); } } if (len < 0) { - com_err(whoami, errno, "reading file data"); + afs_com_err(whoami, errno, "reading file data"); ERROR_EXIT(3); } if (code = butm_WriteFileEnd(&info)) { - com_err(whoami, code, "ending butm write file"); + afs_com_err(whoami, code, "ending butm write file"); ERROR_EXIT(3); } if (close(fid) < 0) { - com_err(whoami, errno, "closing file"); + afs_com_err(whoami, errno, "closing file"); ERROR_EXIT(3); } } if ((code = butm_WriteEOT(&info)) || (code = butm_Dismount(&info))) { - com_err(whoami, code, "finishing up tape"); + afs_com_err(whoami, code, "finishing up tape"); ERROR_EXIT(4); } @@ -307,19 +307,19 @@ PerformDumpTest(TestInfo * tip) label.structVersion = BUTM_MAJORVERSION; if (code = butm_Mount(&info, tip->tapeName)) { - com_err(whoami, code, "setting up tape"); + afs_com_err(whoami, code, "setting up tape"); ERROR_EXIT(5); } if (tip->appended) { /* This is to be an appended dump */ code = butm_SeekEODump(&info, tip->nFiles + 1); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "Can't append: Can't position to end of dump on tape\n"); ERROR_EXIT(code); } } if (code = butm_ReadLabel(&info, &label, !tip->appended /*rewind */ )) { - com_err(whoami, code, "reading tape label"); + afs_com_err(whoami, code, "reading tape label"); ERROR_EXIT(5); } past = time(0) - label.creationTime; @@ -359,12 +359,12 @@ PerformDumpTest(TestInfo * tip) fid = open(tip->files[i], O_RDONLY, 0); if (fid < 0) { - com_err(whoami, errno, "Opening %dth file to compare with tape", + afs_com_err(whoami, errno, "Opening %dth file to compare with tape", i + 1); ERROR_EXIT(6); } if (code = butm_ReadFileBegin(&info)) { - com_err(whoami, code, "Beginning butm %dth read file", i + 1); + afs_com_err(whoami, code, "Beginning butm %dth read file", i + 1); ERROR_EXIT(6); } @@ -374,13 +374,13 @@ PerformDumpTest(TestInfo * tip) code = butm_ReadFileData(&info, tbuffer, BUTM_BLKSIZE, &tlen); if (code && code != BUTM_STATUS_EOF) { - com_err(whoami, code, "Reading %dth tape data", i + 1); + afs_com_err(whoami, code, "Reading %dth tape data", i + 1); ERROR_EXIT(6); } memset(fbuffer, 0, BUTM_BLKSIZE); flen = read(fid, fbuffer, sizeof(fbuffer)); if (flen < 0) { - com_err(whoami, errno, "Reading %dth file data", i + 1); + afs_com_err(whoami, errno, "Reading %dth file data", i + 1); ERROR_EXIT(6); } if (code == BUTM_STATUS_EOF) @@ -402,11 +402,11 @@ PerformDumpTest(TestInfo * tip) } if (code = butm_ReadFileEnd(&info)) { - com_err(whoami, code, "Ending butm %dth read file", i + 1); + afs_com_err(whoami, code, "Ending butm %dth read file", i + 1); ERROR_EXIT(7); } if (close(fid) < 0) { - com_err(whoami, errno, "Closing %dth file", i + 1); + afs_com_err(whoami, errno, "Closing %dth file", i + 1); ERROR_EXIT(7); } } @@ -414,12 +414,12 @@ PerformDumpTest(TestInfo * tip) if ((info.status & BUTM_STATUS_EOD) == 0) { code = butm_ReadFileBegin(&info); if (code && (code != BUTM_EOD)) { - com_err(whoami, code, "Should have encountered an 'End Of Tape'"); + afs_com_err(whoami, code, "Should have encountered an 'End Of Tape'"); ERROR_EXIT(8); } } if (code = butm_Dismount(&info)) { - com_err(whoami, code, "Finishing up tape"); + afs_com_err(whoami, code, "Finishing up tape"); ERROR_EXIT(8); } diff --git a/src/cmd/test/itest.c b/src/cmd/test/itest.c index 7e2cd44..9f7f598 100644 --- a/src/cmd/test/itest.c +++ b/src/cmd/test/itest.c @@ -84,13 +84,13 @@ main(argc, argv) break; code = cmd_ParseLine(tline, tv, &tc, 100); if (code) { - printf("itest: parsing failure: %s\n", error_message(code)); + printf("itest: parsing failure: %s\n", afs_error_message(code)); exit(1); } code = cmd_Dispatch(tc, tv); cmd_FreeArgv(tv); if (code) { - printf("itest: execution failed: %s\n", error_message(code)); + printf("itest: execution failed: %s\n", afs_error_message(code)); } } return 0; diff --git a/src/comerr/com_err.c b/src/comerr/com_err.c index e8eb112..18b02bb 100644 --- a/src/comerr/com_err.c +++ b/src/comerr/com_err.c @@ -25,7 +25,7 @@ default_com_err_proc(const char *whoami, afs_int32 code, const char *fmt, fputs(": ", stderr); } if (code) { - fputs(error_message(code), stderr); + fputs(afs_error_message(code), stderr); fputs(" ", stderr); } if (fmt) { @@ -42,25 +42,25 @@ typedef void (*errf) (const char *, afs_int32, const char *, va_list); static errf com_err_hook = default_com_err_proc; void -com_err_va(const char *whoami, afs_int32 code, const char *fmt, va_list args) +afs_com_err_va(const char *whoami, afs_int32 code, const char *fmt, va_list args) { (*com_err_hook) (whoami, code, fmt, args); } void -com_err(const char *whoami, afs_int32 code, const char *fmt, ...) +afs_com_err(const char *whoami, afs_int32 code, const char *fmt, ...) { va_list pvar; if (!com_err_hook) com_err_hook = default_com_err_proc; va_start(pvar, fmt); - com_err_va(whoami, code, fmt, pvar); + afs_com_err_va(whoami, code, fmt, pvar); va_end(pvar); } errf -set_com_err_hook(errf new_proc) +afs_set_com_err_hook(errf new_proc) { errf x = com_err_hook; if (new_proc) @@ -71,7 +71,7 @@ set_com_err_hook(errf new_proc) } errf -reset_com_err_hook(void) +afs_reset_com_err_hook(void) { errf x = com_err_hook; com_err_hook = default_com_err_proc; diff --git a/src/comerr/com_err.h b/src/comerr/com_err.h index a3d5a0a..15a8a3f 100644 --- a/src/comerr/com_err.h +++ b/src/comerr/com_err.h @@ -8,21 +8,29 @@ * with this package. */ -#ifndef __COM_ERR_H +#ifndef __AFS_COM_ERR_H #include -extern void com_err(const char *, afs_int32, const char *, ...); -extern void com_err_va(const char *whoami, afs_int32 code, const char *fmt, +extern void afs_com_err(const char *, afs_int32, const char *, ...); +extern void afs_com_err_va(const char *whoami, afs_int32 code, const char *fmt, va_list args); -extern const char *error_table_name(afs_int32); -extern const char *error_message(afs_int32); +extern const char *afs_error_table_name(afs_int32); +extern const char *afs_error_message(afs_int32); extern -void (*set_com_err_hook +void (*afs_set_com_err_hook (void (*)(const char *, afs_int32, const char *, va_list))) (const char *, afs_int32, const char *, va_list); -extern void (*reset_com_err_hook(void)) (const char *, afs_int32, +extern void (*afs_reset_com_err_hook(void)) (const char *, afs_int32, const char *, va_list); -#define __COM_ERR_H -#endif /* ! defined(__COM_ERR_H) */ +#define __AFS_COM_ERR_H +#ifdef AFS_OLD_COM_ERR +#define com_err afs_com_err +#define com_err_va afs_com_err_va +#define error_table_name afs_error_table_name +#define error_message afs_error_message +#define set_com_err_hook afs_set_com_err_hook +#define reset_com_err_hook afs_reset_com_err_hook +#endif /* AFS_OLD_COM_ERR */ +#endif /* ! defined(__AFS_COM_ERR_H) */ diff --git a/src/comerr/compile_et.c b/src/comerr/compile_et.c index 35c2bad..ca37a98 100644 --- a/src/comerr/compile_et.c +++ b/src/comerr/compile_et.c @@ -375,7 +375,7 @@ main(int argc, char **argv) fputs("static struct et_list etlink = { 0, &et};\n\n", cfile); fprintf(cfile, "void initialize_%s_error_table(void) {\n", table_name); - fputs(" add_to_error_table(&etlink);\n", cfile); + fputs(" afs_add_to_error_table(&etlink);\n", cfile); fputs("}\n", cfile); fclose(cfile); diff --git a/src/comerr/error_msg.c b/src/comerr/error_msg.c index 5ca5660..6e29513 100644 --- a/src/comerr/error_msg.c +++ b/src/comerr/error_msg.c @@ -45,7 +45,7 @@ static pthread_once_t et_list_once = PTHREAD_ONCE_INIT; * Function to initialize the et_list_mutex */ -void +static void et_mutex_once(void) { assert(!pthread_mutex_init @@ -110,7 +110,7 @@ volume_message(int code) } const char * -error_message(afs_int32 code) +afs_error_message(afs_int32 code) { int offset; struct et_list *et; @@ -147,7 +147,7 @@ error_message(afs_int32 code) UNLOCK_ET_LIST; strlcpy(buffer, "Unknown code ", sizeof buffer); if (table_num) { - strlcat(buffer, error_table_name(table_num), sizeof buffer); + strlcat(buffer, afs_error_table_name(table_num), sizeof buffer); strlcat(buffer, " ", sizeof buffer); } for (cp = buffer; *cp; cp++); @@ -169,7 +169,7 @@ error_message(afs_int32 code) } void -add_to_error_table(struct et_list *new_table) +afs_add_to_error_table(struct et_list *new_table) { struct et_list *et; diff --git a/src/comerr/error_table.h b/src/comerr/error_table.h index 929dad8..e26b1c9 100644 --- a/src/comerr/error_table.h +++ b/src/comerr/error_table.h @@ -9,7 +9,7 @@ #include -#ifndef _ET_H +#ifndef _AFS_ET_H struct error_table { char const *const *msgs; @@ -25,7 +25,11 @@ struct et_list { #define ERRCODE_RANGE 8 /* # of bits to shift table number */ #define BITS_PER_CHAR 6 /* # bits to shift per character in name */ -extern char const *error_table_name(afs_int32 num); -extern void add_to_error_table(struct et_list *new_table); -#define _ET_H +extern char const *afs_error_table_name(afs_int32 num); +extern void afs_add_to_error_table(struct et_list *new_table); +#ifdef AFS_OLD_COM_ERR +#define error_table_name afs_error_table_name +#define add_to_error_table(X) afs_add_to_error_table(X) +#endif /* AFS_OLD_COM_ERR */ +#define _AFS_ET_H #endif diff --git a/src/comerr/et_name.c b/src/comerr/et_name.c index 1515c56..1b840c7 100644 --- a/src/comerr/et_name.c +++ b/src/comerr/et_name.c @@ -26,7 +26,7 @@ static const char char_set[] = static char buf[6]; const char * -error_table_name(afs_int32 num) +afs_error_table_name(afs_int32 num) { int ch; int i; diff --git a/src/comerr/internal.h b/src/comerr/internal.h index 83897d8..877e129 100644 --- a/src/comerr/internal.h +++ b/src/comerr/internal.h @@ -1,5 +1,5 @@ /* - * internal include file for com_err package + * internal include file for afs_com_err package * */ #include "mit-sipb-cr.h" diff --git a/src/comerr/test/test.c b/src/comerr/test/test.c index f09be3c..eb8c72e 100644 --- a/src/comerr/test/test.c +++ b/src/comerr/test/test.c @@ -18,38 +18,38 @@ extern int sys_nerr, errno; main() { printf("Before initiating error table:\n\n"); - printf("Table name '%s'\n", error_table_name(KRB_MK_AP_TGTEXP)); - printf("UNIX name '%s'\n", error_table_name(EPERM)); - printf("Msg TGT-expired is '%s'\n", error_message(KRB_MK_AP_TGTEXP)); - printf("Msg EPERM is '%s'\n", error_message(EPERM)); - printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR)); - printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr - 1)); - printf("Msg {sys_nerr} is '%s'\n", error_message(sys_nerr)); + printf("Table name '%s'\n", afs_error_table_name(KRB_MK_AP_TGTEXP)); + printf("UNIX name '%s'\n", afs_error_table_name(EPERM)); + printf("Msg TGT-expired is '%s'\n", afs_error_message(KRB_MK_AP_TGTEXP)); + printf("Msg EPERM is '%s'\n", afs_error_message(EPERM)); + printf("Msg FOO_ERR is '%s'\n", afs_error_message(FOO_ERR)); + printf("Msg {sys_nerr-1} is '%s'\n", afs_error_message(sys_nerr - 1)); + printf("Msg {sys_nerr} is '%s'\n", afs_error_message(sys_nerr)); - printf("With 0: tgt-expired -> %s\n", error_message(KRB_MK_AP_TGTEXP)); + printf("With 0: tgt-expired -> %s\n", afs_error_message(KRB_MK_AP_TGTEXP)); initialize_KRB_error_table(); initialize_KRB_error_table(); printf("KRB error table initialized: base %d (%s), name %s\n", - ERROR_TABLE_BASE_KRB, error_message(ERROR_TABLE_BASE_KRB), - error_table_name(ERROR_TABLE_BASE_KRB)); - printf("With krb: tgt-expired -> %s\n", error_message(KRB_MK_AP_TGTEXP)); + ERROR_TABLE_BASE_KRB, afs_error_message(ERROR_TABLE_BASE_KRB), + afs_error_table_name(ERROR_TABLE_BASE_KRB)); + printf("With krb: tgt-expired -> %s\n", afs_error_message(KRB_MK_AP_TGTEXP)); initialize_QUUX_error_table(); printf("QUUX error table initialized: base %d (%s), name %s\n", - ERROR_TABLE_BASE_QUUX, error_message(ERROR_TABLE_BASE_QUUX), - error_table_name(ERROR_TABLE_BASE_QUUX)); - - printf("Msg for TGT-expired is '%s'\n", error_message(KRB_MK_AP_TGTEXP)); - printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr - 1)); - printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR)); - printf("Msg KRB_SKDC_CANT is '%s'\n", error_message(KRB_SKDC_CANT)); - printf("Msg 1e6 (8B 64) is '%s'\n", error_message(1000000)); + ERROR_TABLE_BASE_QUUX, afs_error_message(ERROR_TABLE_BASE_QUUX), + afs_error_table_name(ERROR_TABLE_BASE_QUUX)); + + printf("Msg for TGT-expired is '%s'\n", afs_error_message(KRB_MK_AP_TGTEXP)); + printf("Msg {sys_nerr-1} is '%s'\n", afs_error_message(sys_nerr - 1)); + printf("Msg FOO_ERR is '%s'\n", afs_error_message(FOO_ERR)); + printf("Msg KRB_SKDC_CANT is '%s'\n", afs_error_message(KRB_SKDC_CANT)); + printf("Msg 1e6 (8B 64) is '%s'\n", afs_error_message(1000000)); printf("\n\nCOM_ERR tests:\n"); - com_err("whoami", FOO_ERR, (char *)NULL); - com_err("whoami", FOO_ERR, " -- message goes %s", "here"); - com_err("whoami", 0, NULL); - com_err("whoami", 0, "error number %d\n", 0); + afs_com_err("whoami", FOO_ERR, (char *)NULL); + afs_com_err("whoami", FOO_ERR, " -- message goes %s", "here"); + afs_com_err("whoami", 0, NULL); + afs_com_err("whoami", 0, "error number %d\n", 0); return 0; } diff --git a/src/finale/translate_et.c b/src/finale/translate_et.c index d048a74..794241b 100644 --- a/src/finale/translate_et.c +++ b/src/finale/translate_et.c @@ -73,8 +73,8 @@ main(int argc, char *argv[]) code = atoi(argv[i]); offset = code & ((1 << ERRCODE_RANGE) - 1); - printf("%d (%s).%d = %s\n", (int)code, error_table_name(code), - (int)offset, error_message(code)); + printf("%d (%s).%d = %s\n", (int)code, afs_error_table_name(code), + (int)offset, afs_error_message(code)); } return 0; } diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index a1ed521..c62cf12 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -68,7 +68,7 @@ DefaultCell(void) return 0; code = ka_ExpandCell(0, cell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); } return code; } @@ -88,7 +88,7 @@ DumpUser(char *user, char *arock, int showadmin, int showkey, char *inst) code = ka_ParseLoginName(user, name, instance, 0); if (code) { - com_err(whoami, code, "parsing user's name '%s'", user); + afs_com_err(whoami, code, "parsing user's name '%s'", user); return KABADCMD; } @@ -97,7 +97,7 @@ DumpUser(char *user, char *arock, int showadmin, int showkey, char *inst) code = ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry); if (code) { - com_err(whoami, code, "getting information for %s.%s", name, inst); + afs_com_err(whoami, code, "getting information for %s.%s", name, inst); return code; } if (tentry.minor_version != KAMINORVERSION) @@ -254,7 +254,7 @@ ListUsers(struct cmd_syndesc *as, char *arock) ubik_Call(KAM_ListEntry, conn, 0, index, &next_index, &count, &name); if (code) { - com_err(whoami, code, "calling KAM_ListEntry"); + afs_com_err(whoami, code, "calling KAM_ListEntry"); break; } if (!next_index) @@ -300,7 +300,7 @@ handle_errors(int code, /* error code to handle */ } } - printf(" : [%s] %s", error_table_name(code), error_message(code)); + printf(" : [%s] %s", afs_error_table_name(code), afs_error_message(code)); switch (code) { case UNOQUORUM: printf(", wait one second\n"); @@ -331,7 +331,7 @@ CreateUser(struct cmd_syndesc *as, char *arock) code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[0].items->data); return KABADCMD; } @@ -359,7 +359,7 @@ DeleteUser(struct cmd_syndesc *as, char *arock) OKlist[0].code = 0; code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[0].items->data); return KABADCMD; } @@ -431,7 +431,7 @@ parse_flags(char *name, char *inst, char *str, afs_int32 * flags) ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "could get current flag value for %s.%s", name, inst); return -1; } @@ -517,7 +517,7 @@ ka_islocked(char *name, char *instance, afs_uint32 * when) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (code) { if (seriouserror(code)) - com_err(whoami, code, ""); + afs_com_err(whoami, code, ""); } else if (tempwhen) { /* user is locked */ if (!*when || tempwhen < *when) { *when = tempwhen; @@ -542,7 +542,7 @@ Unlock(struct cmd_syndesc *as, char *arock) code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[0].items->data); return KABADCMD; } @@ -557,7 +557,7 @@ Unlock(struct cmd_syndesc *as, char *arock) && conn->conns[count - 1]->peer) { server = conn->conns[count - 1]->peer->host; } - com_err(whoami, code, + afs_com_err(whoami, code, "so %s.%s may still be locked (on server %d.%d.%d.%d)", name, instance, ((server >> 24) & 0xFF), ((server >> 16) & 0xFF), ((server >> 8) & 0xFF), @@ -589,7 +589,7 @@ SetFields(struct cmd_syndesc *as, char *arock) code = ka_ParseLoginName(as->parms[0].items->data, name, instance, 0); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[0].items->data); return KABADCMD; } @@ -729,7 +729,7 @@ SetFields(struct cmd_syndesc *as, char *arock) return KABADCMD; } if (code) - com_err(whoami, code, "calling KAM_SetFields for %s.%s", name, + afs_com_err(whoami, code, "calling KAM_SetFields for %s.%s", name, instance); return code; } @@ -744,7 +744,7 @@ StringToKey(struct cmd_syndesc *as, char *arock) if (as->parms[1].items) { code = ka_ExpandCell(as->parms[1].items->data, realm, 0 /*local */ ); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "expanding %s as cell name, attempting to continue", as->parms[1].items->data); } @@ -783,7 +783,7 @@ SetPassword(struct cmd_syndesc *as, char *arock) code = ka_ParseLoginName(as->parms[0].items->data, name, instance, realm); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[0].items->data); return KABADCMD; } @@ -824,7 +824,7 @@ SetPassword(struct cmd_syndesc *as, char *arock) code = ubik_Call(KAM_SetPassword, conn, 0, name, instance, kvno, key); #endif if (code) - com_err(whoami, code, "so can't set password for %s.%s", name, + afs_com_err(whoami, code, "so can't set password for %s.%s", name, instance); return code; } @@ -849,7 +849,7 @@ PrintName(char *name, char *inst, char *acell, int buflen, char *buf) if (left) { bad_name: code = KABADNAME; - com_err(whoami, code, "PrintName: principal name was '%s'.'%s'@'%s'", + afs_com_err(whoami, code, "PrintName: principal name was '%s'.'%s'@'%s'", name, inst, acell); return code; } @@ -919,7 +919,7 @@ ListTicket(struct ktc_principal *server, int verbose) /* get the ticket info itself */ code = ktc_GetToken(server, &token, sizeof(token), &client); if (code) { - com_err(whoami, code, "failed to get token info for server %s", + afs_com_err(whoami, code, "failed to get token info for server %s", PrintedPrincipal(server)); return code; } @@ -980,7 +980,7 @@ GetTicket(struct cmd_syndesc *as, char *arock) ka_ParseLoginName(as->parms[0].items->data, server.name, server.instance, server.cell); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[0].items->data); return KABADCMD; } @@ -991,7 +991,7 @@ GetTicket(struct cmd_syndesc *as, char *arock) } else { code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); return code; } } @@ -1001,7 +1001,7 @@ GetTicket(struct cmd_syndesc *as, char *arock) ka_GetServerToken(server.name, server.instance, server.cell, life, &token, /*new */ 1, /*dosetpag */ 0); if (code) - com_err(whoami, code, "getting ticket for %s", + afs_com_err(whoami, code, "getting ticket for %s", PrintedPrincipal(&server)); else { code = ListTicket(&server, /*verbose */ 1); @@ -1021,7 +1021,7 @@ GetPassword(struct cmd_syndesc *as, char *arock) code = ka_ParseLoginName(as->parms[0].items->data, name, 0, 0); if (code) { abort: - com_err(whoami, code, + afs_com_err(whoami, code, "getting %s's password via loopback connection to GetPassword", name); /* if we got a timeout, print a clarification, too */ @@ -1069,7 +1069,7 @@ GetRandomKey(struct cmd_syndesc *as, char *arock) code = ubik_Call(KAM_GetRandomKey, conn, 0, &key); if (code) - com_err(whoami, code, "so can't get random key"); + afs_com_err(whoami, code, "so can't get random key"); else { int i; printf("Key: "); @@ -1159,11 +1159,11 @@ DebugInfo(struct cmd_syndesc *as, char *arock) if (code) { struct afsconf_cell cellinfo; - com_err(whoami, code, "couldn't find host %s in cell %s", + afs_com_err(whoami, code, "couldn't find host %s in cell %s", as->parms[0].items->data, cell); code = ka_GetServers(cell, &cellinfo); if (code) - com_err(whoami, code, "getting servers in cell %s", cell); + afs_com_err(whoami, code, "getting servers in cell %s", cell); else { printf("Servers in cell %s, are:\n", cell); for (i = 0; i < cellinfo.numServers; i++) @@ -1177,7 +1177,7 @@ DebugInfo(struct cmd_syndesc *as, char *arock) code = ubik_Call(KAM_Debug, conn, 0, KAMAJORVERSION, 0, &info); if (code) { - com_err(whoami, code, "call to Debug failed"); + afs_com_err(whoami, code, "call to Debug failed"); return code; } now = time(0); @@ -1332,7 +1332,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) ka_ParseLoginName(as->parms[12].items->data, name, instance, newCell); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[12].items->data); return code; } @@ -1363,7 +1363,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) } code = ka_ExpandCell(newCell, newCell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); return code; } strcpy(cell, newCell); @@ -1378,7 +1378,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) ap[i] = ip->data; code = ubik_ParseClientList(i, ap, serverList); if (code) { - com_err(whoami, code, "could not parse server list"); + afs_com_err(whoami, code, "could not parse server list"); return code; } ka_ExplicitCell(cell, serverList); @@ -1412,7 +1412,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) else if (strlen(passwd) == 0) code = KANULLPASSWORD; if (code) { - com_err(whoami, code, "reading password"); + afs_com_err(whoami, code, "reading password"); return code; } } @@ -1453,7 +1453,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) reason = "Authentication Server was unavailable"; break; default: - reason = (char *)error_message(code); + reason = (char *)afs_error_message(code); } fprintf(stderr, "%s: Auth. as %s to AuthServer failed: %s\nProceeding w/o authentication\n", @@ -1474,7 +1474,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) /*Don't need pwd expiration info here */ ); if (acode && (acode != code)) /* codes are usually the same */ - com_err(whoami, code, + afs_com_err(whoami, code, "getting Authentication token for %s", PrintedName(name, instance, cell)); } @@ -1485,15 +1485,15 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) pToken = ((token.ticketLen == 0) ? 0 : &token); code = ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken, &conn); if (code && pToken) { - com_err(whoami, code, + afs_com_err(whoami, code, "connecting to AuthServer: now trying w/o authentication"); code = ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, 0, &conn); if (code) - com_err(whoami, code, + afs_com_err(whoami, code, "making unauthenticated connection to AuthServer"); } if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "Couldn't establish connection to Authentication Server"); return code; } @@ -1518,7 +1518,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) else if (strlen(password) == 0) code = KANULLPASSWORD; if (code) { - com_err(whoami, code, "prompting for %s", p + 1); + afs_com_err(whoami, code, "prompting for %s", p + 1); return code; } ip = (struct cmd_item *)malloc(sizeof(struct cmd_item)); @@ -1552,7 +1552,7 @@ ForgetTicket(struct cmd_syndesc *as, char *arock) ka_ParseLoginName(name, server.name, server.instance, server.cell); if (code) { - com_err(whoami, code, "couldn't interpret name '%s'", name); + afs_com_err(whoami, code, "couldn't interpret name '%s'", name); return code; } if (server.cell[0] == 0) { @@ -1562,13 +1562,13 @@ ForgetTicket(struct cmd_syndesc *as, char *arock) } else { code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); return code; } } code = ktc_ForgetToken(&server); if (code) { - com_err(whoami, code, "couldn't remove tokens for %s", + afs_com_err(whoami, code, "couldn't remove tokens for %s", PrintedPrincipal(&server)); return code; } @@ -1579,14 +1579,14 @@ ForgetTicket(struct cmd_syndesc *as, char *arock) } code = ktc_ForgetAllTokens(); if (code) { - com_err(whoami, code, "couldn't delete all tokens"); + afs_com_err(whoami, code, "couldn't delete all tokens"); return code; } } #endif code = ktc_ForgetAllTokens(); if (code) { - com_err(whoami, code, "couldn't delete all tokens"); + afs_com_err(whoami, code, "couldn't delete all tokens"); return code; } return 0; @@ -1608,7 +1608,7 @@ ListTickets(struct cmd_syndesc *as, char *arock) ka_ParseLoginName(name, server.name, server.instance, server.cell); if (code) { - com_err(whoami, code, "couldn't interpret name '%s'", name); + afs_com_err(whoami, code, "couldn't interpret name '%s'", name); return code; } if (server.cell[0] == 0) { @@ -1618,7 +1618,7 @@ ListTickets(struct cmd_syndesc *as, char *arock) } else { code = ka_ExpandCell(server.cell, server.cell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); return code; } } @@ -1833,7 +1833,7 @@ ka_AdminInteractive(int cmd_argc, char *cmd_argv[]) code = cmd_ParseLine(line, argv, &argc, sizeof(argv) / sizeof(argv[0])); if (code) { - com_err(whoami, code, "parsing line: '%s'", line); + afs_com_err(whoami, code, "parsing line: '%s'", line); return code; } code = cmd_Dispatch(argc, argv); diff --git a/src/kauth/decode_ticket.c b/src/kauth/decode_ticket.c index 061ccf4..51cee80 100644 --- a/src/kauth/decode_ticket.c +++ b/src/kauth/decode_ticket.c @@ -45,7 +45,7 @@ main(int argc, char *argv[]) if (ka_ReadBytes(argv[1], key, sizeof(key)) != 8) printf("Key must be 8 bytes long\n"); if (!des_check_key_parity(key) || des_is_weak_key(key)) { - com_err(whoami, KABADKEY, "server's key for decoding ticket is bad"); + afs_com_err(whoami, KABADKEY, "server's key for decoding ticket is bad"); exit(1); } ticketLen = ka_ReadBytes(argv[2], ticket, sizeof(ticket)); @@ -55,14 +55,14 @@ main(int argc, char *argv[]) tkt_DecodeTicket(ticket, ticketLen, key, client.name, client.instance, client.cell, &sessionkey, &host, &start, &end); if (code) { - com_err(whoami, code, "decoding ticket"); + afs_com_err(whoami, code, "decoding ticket"); if (code = tkt_CheckTimes(start, end, time(0)) <= 0) - com_err(whoami, 0, "because of start or end times"); + afs_com_err(whoami, 0, "because of start or end times"); exit(1); } if (!des_check_key_parity(&sessionkey) || des_is_weak_key(&sessionkey)) { - com_err(whoami, KABADKEY, "checking ticket's session key"); + afs_com_err(whoami, KABADKEY, "checking ticket's session key"); exit(1); } diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index 5fe2fdb..efe35f9 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -40,6 +40,7 @@ RCSID #include #include #include +#include #include "kautils.h" #include "kaserver.h" #include "kalog.h" @@ -176,7 +177,7 @@ get_time(timeP, tt, admin) } else { es_Report ("in get_time: set_password failed because: %s\n", - error_message(code)); + afs_error_message(code)); return code; } } diff --git a/src/kauth/kas.c b/src/kauth/kas.c index ad1bd29..8ecfa61 100644 --- a/src/kauth/kas.c +++ b/src/kauth/kas.c @@ -82,7 +82,7 @@ main(int argc, char *argv[]) code = ka_Init(0); if (code) { - com_err(whoami, code, "Can't get cell info"); + afs_com_err(whoami, code, "Can't get cell info"); exit(1); } diff --git a/src/kauth/kaserver.c b/src/kauth/kaserver.c index 1ce89cf..2b5e9a9 100644 --- a/src/kauth/kaserver.c +++ b/src/kauth/kaserver.c @@ -47,6 +47,7 @@ RCSID #include #include #include +#include #include #include #include "kauth.h" @@ -330,7 +331,7 @@ main(argc, argv) if (!KA_conf) { code = KANOCELLS; abort: - com_err(whoami, code, "Failed getting cell info"); + afs_com_err(whoami, code, "Failed getting cell info"); exit(1); } #ifdef AUTH_DBM_LOG @@ -356,7 +357,7 @@ main(argc, argv) &cellinfo, &clones); if (servers) { if (code = ubik_ParseServerList(argc, argv, &myHost, serverList)) { - com_err(whoami, code, "Couldn't parse server list"); + afs_com_err(whoami, code, "Couldn't parse server list"); exit(1); } cellinfo.hostAddr[0].sin_addr.s_addr = myHost; @@ -424,7 +425,7 @@ main(argc, argv) &clones, dbpath, &KA_dbase); if (code) { - com_err(whoami, code, "Ubik init failed"); + afs_com_err(whoami, code, "Ubik init failed"); exit(2); } diff --git a/src/kauth/kautils.p.h b/src/kauth/kautils.p.h index d1fc30a..32d491a 100644 --- a/src/kauth/kautils.p.h +++ b/src/kauth/kautils.p.h @@ -291,7 +291,7 @@ struct ka_getTicketAnswer { }; #ifndef ERROR_TABLE_BASE_KA -#define ka_ErrorString error_message +#define ka_ErrorString afs_error_message #undef KAMINERROR #define KAMINERROR ERROR_TABLE_BASE_KA #define KAMAXERROR (KAMINERROR+255) diff --git a/src/kauth/klog.c b/src/kauth/klog.c index def9647..c82ac7d 100644 --- a/src/kauth/klog.c +++ b/src/kauth/klog.c @@ -221,7 +221,7 @@ CommandProc(struct cmd_syndesc *as, char *arock) if (code || !(lcell = ka_LocalCell())) { nocell: if (!Silent) - com_err(rn, code, "Can't get local cell name!"); + afs_com_err(rn, code, "Can't get local cell name!"); KLOGEXIT(code); } if (code = ka_CellToRealm(lcell, lrealm, 0)) @@ -254,7 +254,7 @@ CommandProc(struct cmd_syndesc *as, char *arock) code = ubik_ParseClientList(i, ap, serverList); if (code) { if (!Silent) { - com_err(rn, code, "could not parse server list"); + afs_com_err(rn, code, "could not parse server list"); } return code; } @@ -353,7 +353,7 @@ CommandProc(struct cmd_syndesc *as, char *arock) strcpy(realm, lcell); if (code = ka_CellToRealm(realm, realm, &local)) { if (!Silent) - com_err(rn, code, "Can't convert cell to realm"); + afs_com_err(rn, code, "Can't convert cell to realm"); KLOGEXIT(code); } @@ -391,7 +391,7 @@ CommandProc(struct cmd_syndesc *as, char *arock) code = krb_write_ticket_file(realm); if (!Silent) { if (code) - com_err(rn, code, "writing Kerberos ticket file"); + afs_com_err(rn, code, "writing Kerberos ticket file"); else fprintf(stderr, "Wrote ticket file to /tmp\n"); } diff --git a/src/kauth/kpasswd.c b/src/kauth/kpasswd.c index 0d50392..211b2f7 100644 --- a/src/kauth/kpasswd.c +++ b/src/kauth/kpasswd.c @@ -262,7 +262,7 @@ CommandProc(as, arock) if (code || !(lcell = ka_LocalCell())) { #ifndef AFS_FREELANCE_CLIENT if (!Pipe) - com_err(rn, code, "Can't get local cell name!"); + afs_com_err(rn, code, "Can't get local cell name!"); exit(1); #endif } @@ -270,7 +270,7 @@ CommandProc(as, arock) code = rx_Init(0); if (code) { if (!Pipe) - com_err(rn, code, "Failed to initialize Rx"); + afs_com_err(rn, code, "Failed to initialize Rx"); exit(1); } @@ -301,7 +301,7 @@ CommandProc(as, arock) code = ubik_ParseClientList(i, ap, serverList); if (code) { if (!Pipe) - com_err(rn, code, "could not parse server list"); + afs_com_err(rn, code, "could not parse server list"); return code; } lexplicit = 1; @@ -382,7 +382,7 @@ CommandProc(as, arock) #ifdef AFS_FREELANCE_CLIENT if (!foundExplicitCell && !lcell) { if (!Pipe) - com_err(rn, code, "no cell name provided"); + afs_com_err(rn, code, "no cell name provided"); exit(1); } #else @@ -392,7 +392,7 @@ CommandProc(as, arock) if (code = ka_CellToRealm(realm, realm, &local)) { if (!Pipe) - com_err(rn, code, "Can't convert cell to realm"); + afs_com_err(rn, code, "Can't convert cell to realm"); exit(1); } lcstring(cell, realm, sizeof(cell)); @@ -413,7 +413,7 @@ CommandProc(as, arock) memset(&key, 0, sizeof(key)); memset(passwd, 0, sizeof(passwd)); if (code) - com_err(rn, code, "reading password"); + afs_com_err(rn, code, "reading password"); exit(1); } } @@ -522,17 +522,17 @@ CommandProc(as, arock) memset(&mitkey, 0, sizeof(mitkey)); memset(&key, 0, sizeof(key)); if (code == KAUBIKCALL) - com_err(rn, code, "(Authentication Server unavailable, try later)"); + afs_com_err(rn, code, "(Authentication Server unavailable, try later)"); else if (code) { if (code == KABADREQUEST) fprintf(stderr, "%s: Incorrect old password.\n", rn); else - com_err(rn, code, "so couldn't change password"); + afs_com_err(rn, code, "so couldn't change password"); } else { code = ka_AuthServerConn(realm, KA_MAINTENANCE_SERVICE, &token, &conn); if (code) - com_err(rn, code, "contacting Admin Server"); + afs_com_err(rn, code, "contacting Admin Server"); else { if (dess2k == 1) code = @@ -546,7 +546,7 @@ CommandProc(as, arock) memset(&newmitkey, 0, sizeof(newmitkey)); if (code) { char *reason; - reason = (char *)error_message(code); + reason = (char *)afs_error_message(code); fprintf(stderr, "%s: Password was not changed because %s\n", rn, reason); } else @@ -567,7 +567,7 @@ CommandProc(as, arock) no_change: /* yuck, yuck, yuck */ if (code) - com_err(rn, code, "getting new password"); + afs_com_err(rn, code, "getting new password"); no_change_no_msg: memset(&key, 0, sizeof(key)); memset(npasswd, 0, sizeof(npasswd)); diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index 2222b36..c7d3a0b 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -740,12 +740,12 @@ process_udp_auth(ksoc, pkt) if (code) { if (code == KANOENT) { code = KERB_ERR_PRINCIPAL_UNKNOWN; - err_packet(ksoc, pkt, code, (char *)error_message(code)); + err_packet(ksoc, pkt, code, (char *)afs_error_message(code)); } else if (code == KAPWEXPIRED) { code = KERB_ERR_NAME_EXP; err_packet(ksoc, pkt, code, "password has expired"); } else - err_packet(ksoc, pkt, code, (char *)error_message(code)); + err_packet(ksoc, pkt, code, (char *)afs_error_message(code)); } return 0; } @@ -789,7 +789,7 @@ process_udp_appl(ksoc, pkt) if (code) { if (code == KANOENT) code = KERB_ERR_PRINCIPAL_UNKNOWN; - err_packet(ksoc, pkt, code, (char *)error_message(code)); + err_packet(ksoc, pkt, code, (char *)afs_error_message(code)); return -1; } return 0; diff --git a/src/kauth/manyklog.c b/src/kauth/manyklog.c index f2522e5..1a7950c 100644 --- a/src/kauth/manyklog.c +++ b/src/kauth/manyklog.c @@ -213,7 +213,7 @@ CommandProc(as, arock) p if (code || !(lcell = ka_LocalCell())) { nocell: if (!Silent) - com_err(rn, code, "Can't get local cell name!"); + afs_com_err(rn, code, "Can't get local cell name!"); KLOGEXIT(code); } if (code = ka_CellToRealm(lcell, lrealm, 0)) @@ -250,7 +250,7 @@ CommandProc(as, arock) code = ubik_ParseClientList(i, ap, serverList); if (code) { if (!Silent) { - com_err(rn, code, "could not parse server list"); + afs_com_err(rn, code, "could not parse server list"); } return code; } @@ -349,7 +349,7 @@ CommandProc(as, arock) strcpy(realm, lcell); if (code = ka_CellToRealm(realm, realm, &local)) { if (!Silent) - com_err(rn, code, "Can't convert cell to realm"); + afs_com_err(rn, code, "Can't convert cell to realm"); KLOGEXIT(code); } diff --git a/src/kauth/rebuild.c b/src/kauth/rebuild.c index 4a892a1..c9641a8 100644 --- a/src/kauth/rebuild.c +++ b/src/kauth/rebuild.c @@ -394,12 +394,12 @@ readDB(offset, buffer, size) offset += UBIK_HEADERSIZE; code = lseek(fd, offset, SEEK_SET); if (code != offset) { - com_err(whoami, errno, "skipping Ubik header"); + afs_com_err(whoami, errno, "skipping Ubik header"); exit(2); } code = read(fd, buffer, size); if (code != size) { - com_err(whoami, errno, "reading db got %d bytes", code); + afs_com_err(whoami, errno, "reading db got %d bytes", code); exit(3); } } @@ -430,7 +430,7 @@ WorkerBee(as, arock) if (outFile) { out = fopen(outFile, "w"); if (!out) { - com_err(whoami, errno, "opening output file %s", outFile); + afs_com_err(whoami, errno, "opening output file %s", outFile); exit(7); } } else @@ -438,12 +438,12 @@ WorkerBee(as, arock) fd = open(dbFile, O_RDONLY, 0); if (fd < 0) { - com_err(whoami, errno, "opening database file %s", dbFile); + afs_com_err(whoami, errno, "opening database file %s", dbFile); exit(6); } code = fstat(fd, &info); if (code) { - com_err(whoami, errno, "stat'ing file %s", dbFile); + afs_com_err(whoami, errno, "stat'ing file %s", dbFile); exit(6); } if ((info.st_size - UBIK_HEADERSIZE) % UBIK_BUFFERSIZE) diff --git a/src/kauth/test/multiklog.c b/src/kauth/test/multiklog.c index 592e8e5..01c4a77 100644 --- a/src/kauth/test/multiklog.c +++ b/src/kauth/test/multiklog.c @@ -176,7 +176,7 @@ CommandProc(as, arock) if (code || !(lcell = ka_LocalCell())) { nocell: if (!Silent) - com_err(rn, code, "Can't get local cell name!"); + afs_com_err(rn, code, "Can't get local cell name!"); exit(code); } if (code = ka_CellToRealm(lcell, lrealm, 0)) @@ -213,7 +213,7 @@ CommandProc(as, arock) code = ubik_ParseClientList(i, ap, serverList); if (code) { if (!Silent) { - com_err(rn, code, "could not parse server list"); + afs_com_err(rn, code, "could not parse server list"); } return code; } @@ -316,7 +316,7 @@ CommandProc(as, arock) strcpy(realm, lcell); if (code = ka_CellToRealm(realm, realm, &local)) { if (!Silent) - com_err(rn, code, "Can't convert cell to realm"); + afs_com_err(rn, code, "Can't convert cell to realm"); exit(code); } @@ -362,7 +362,7 @@ CommandProc(as, arock) code = krb_write_ticket_file(realm); if (!Silent) { if (code) - com_err(rn, code, "writing Kerberos ticket file"); + afs_com_err(rn, code, "writing Kerberos ticket file"); else fprintf(stderr, "Wrote ticket file to /tmp\n"); } diff --git a/src/kauth/test/test_badtix.c b/src/kauth/test/test_badtix.c index 05add78..e296bdc 100644 --- a/src/kauth/test/test_badtix.c +++ b/src/kauth/test/test_badtix.c @@ -170,7 +170,7 @@ TestOldKeys(userkey) &adminConn)) ) { abort: - com_err(whoami, code, "testing old keys"); + afs_com_err(whoami, code, "testing old keys"); exit(1); } @@ -275,7 +275,7 @@ TestOldKeys(userkey) } if (code) { abort_1: - com_err(whoami, code, "at %d seconds: calling server with v=%x", + afs_com_err(whoami, code, "at %d seconds: calling server with v=%x", sleep, v); exit(2); } @@ -296,7 +296,7 @@ TestOldKeys(userkey) &adminTokens[i], &conn); if (code) { abort_ta: - com_err(whoami, code, "Checking admin token #%d with kvno %d\n", + afs_com_err(whoami, code, "Checking admin token #%d with kvno %d\n", i, (int)adminTokens[i].kvno); exit(5); } @@ -321,7 +321,7 @@ TestOldKeys(userkey) ka_GetToken(name, inst, localCell, name, inst, tgsConn, now, now + 3600, &tgsTokens[i], "", &token); if (code) { - com_err(whoami, code, "Checking tgs token #%d with kvno %d\n", i, + afs_com_err(whoami, code, "Checking tgs token #%d with kvno %d\n", i, (int)tgsTokens[i].kvno); exit(6); } @@ -329,7 +329,7 @@ TestOldKeys(userkey) code = ubik_Call(KAM_DeleteUser, adminConn, 0, aaname, aainst); if (code) { - com_err(whoami, code, "Deleting alternate admin user"); + afs_com_err(whoami, code, "Deleting alternate admin user"); exit(3); } return; @@ -414,7 +414,7 @@ main(argc, argv) code = ka_CellConfig(AFSCONF_CLIENTNAME); if (code) - com_err(whoami, code, "calling cell config"); + afs_com_err(whoami, code, "calling cell config"); localCell = ka_LocalCell(); for (i = 0; i < (sizeof(truncate) / sizeof(int)); i++) { @@ -453,15 +453,15 @@ main(argc, argv) code = rx_Init(0); if (code) { - com_err(whoami, code, "rx_Init'ing"); + afs_com_err(whoami, code, "rx_Init'ing"); exit(1); } if (code = ka_Init(0)) { - com_err(whoami, code, "ka_Init'ing"); + afs_com_err(whoami, code, "ka_Init'ing"); exit(1); } if (code = ubik_ParseClientList(3, args, serverList)) { - com_err(whoami, code, "parsing Ubik server list"); + afs_com_err(whoami, code, "parsing Ubik server list"); exit(1); } ka_ExplicitCell(localCell, serverList); @@ -480,7 +480,7 @@ main(argc, argv) code = ubik_ClientInit(conns, &lpbkConn); if (code) { abort_4: - com_err(whoami, code, + afs_com_err(whoami, code, "getting %s's password via loopback connection to GetPassword", name); exit(1); @@ -497,7 +497,7 @@ main(argc, argv) code = ka_AuthServerConn(localCell, KA_AUTHENTICATION_SERVICE, 0, &aconn); if (code) { abort: - com_err(whoami, code, "connecting to authentication service"); + afs_com_err(whoami, code, "connecting to authentication service"); exit(1); } end = now + 100 * 3600 + 2; @@ -522,7 +522,7 @@ main(argc, argv) &token, 0); if (code) { abort_1: - com_err(whoami, code, "using admin ticket with time jitter"); + afs_com_err(whoami, code, "using admin ticket with time jitter"); exit(1); } @@ -544,7 +544,7 @@ main(argc, argv) code = ubik_Call(KAM_SetPassword, conn, 0, name, inst, 0, badkey); if (code != KABADKEY) { abort_5: - com_err(whoami, code, "Trying to set bad key"); + afs_com_err(whoami, code, "Trying to set bad key"); exit(1); } memset(&badkey, 0, sizeof(badkey)); @@ -566,7 +566,7 @@ main(argc, argv) code = ubik_Call(KAM_SetPassword, conn, 0, aname, ainst, 0, akey); if (code) { abort_6: - com_err(whoami, code, "Checking SetPassword"); + afs_com_err(whoami, code, "Checking SetPassword"); exit(2); } code = @@ -595,7 +595,7 @@ main(argc, argv) &atoken.sessionKey, 0, aname, ainst); if (code) { abort_3: - com_err(whoami, code, "faking up AuthServer ticket"); + afs_com_err(whoami, code, "faking up AuthServer ticket"); exit(1); } { @@ -644,13 +644,13 @@ main(argc, argv) code = ka_AuthServerConn(localCell, KA_MAINTENANCE_SERVICE, &atoken, &conn); if (code) { - com_err(whoami, code, "contacting admin server with bashed ticket"); + afs_com_err(whoami, code, "contacting admin server with bashed ticket"); exit(0); /* this is supposed to happen */ } code = ubik_Call(KAM_GetEntry, conn, 0, name, inst, KAMAJORVERSION, &tentry); if (code != RXKADBADTICKET) { - com_err(whoami, code, + afs_com_err(whoami, code, "GetEntry failed to fail even with damaged ticket!!!!\n"); exit(1); } @@ -661,7 +661,7 @@ main(argc, argv) if (argc == 2) { code = setpag(); if (code) - com_err(whoami, code, "calling SetPAG"); + afs_com_err(whoami, code, "calling SetPAG"); else printf("Calling SetPAG and exec'ing %s\n", argv[1]); execve(argv[1], argv + 1, 0); diff --git a/src/kauth/test/test_getticket.c b/src/kauth/test/test_getticket.c index 9c9eec3..a11b86c 100644 --- a/src/kauth/test/test_getticket.c +++ b/src/kauth/test/test_getticket.c @@ -130,7 +130,7 @@ SetFields(conn, name, flags, expiration, lifetime) lifetime, -1, /* spares */ 0, 0); if (code) { - com_err(whoami, code, "calling set fields on %s", name); + afs_com_err(whoami, code, "calling set fields on %s", name); CRASH(); } } @@ -201,7 +201,7 @@ GetTokenLife(name, passwd, expectedLife, match) } code = ktc_GetToken(&afs, &t, sizeof(t), 0); if (code) { - com_err(whoami, code, "getting afs token from ktc"); + afs_com_err(whoami, code, "getting afs token from ktc"); CRASH(); } CheckLife(t.endTime, t.startTime, expectedLife, match); @@ -243,7 +243,7 @@ Main(as, arock) ka_ParseLoginName(as->parms[12].items->data, name, instance, newCell); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[12].items->data); return code; } @@ -273,13 +273,13 @@ Main(as, arock) code = ka_ExpandCell(newCell, newCell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); return code; } cell = newCell; code = ka_CellToRealm(cell, realm, 0); if (code) { - com_err(whoami, code, "Can't get realm from cell name"); + afs_com_err(whoami, code, "Can't get realm from cell name"); return code; } @@ -299,7 +299,7 @@ Main(as, arock) else if (strlen(passwd) == 0) code = KANULLPASSWORD; if (code) { - com_err(whoami, code, "reading password"); + afs_com_err(whoami, code, "reading password"); return code; } } @@ -313,7 +313,7 @@ Main(as, arock) ap[1] = "-servers"; code = ubik_ParseClientList(i, ap, serverList); if (code) { - com_err(whoami, code, "could not parse server list"); + afs_com_err(whoami, code, "could not parse server list"); return code; } ka_ExplicitCell(cell, serverList); @@ -326,7 +326,7 @@ Main(as, arock) strcpy(afs.cell, cell); code = ktc_GetToken(&afs, &oldAFSToken, sizeof(oldAFSToken), &oldClient); if (code) { - com_err(whoami, code, "saving existing afs token"); + afs_com_err(whoami, code, "saving existing afs token"); return code; } @@ -345,7 +345,7 @@ Main(as, arock) ka_GetAdminToken(name, instance, cell, &key, 3600, &token, 1 /*new */ ); if (code) { - com_err(whoami, code, "getting admin token"); + afs_com_err(whoami, code, "getting admin token"); return code; } pToken = &token; @@ -358,7 +358,7 @@ Main(as, arock) ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken, &ubikConn); if (code) { - com_err(whoami, code, "Getting AuthServer ubik conn"); + afs_com_err(whoami, code, "Getting AuthServer ubik conn"); return code; } @@ -383,7 +383,7 @@ Main(as, arock) ktc_GetToken(&tgs_server, &tgs_token, sizeof(tgs_token), &tgs_client); if (code) { - com_err(whoami, code, "saving tgs token"); + afs_com_err(whoami, code, "saving tgs token"); return code; } @@ -418,7 +418,7 @@ Main(as, arock) /* since the rest should be errors, restore good AFS ticket */ code = ktc_SetToken(&afs, &oldAFSToken, &oldClient, 0); if (code) { - com_err(whoami, code, "restoring old afs token"); + afs_com_err(whoami, code, "restoring old afs token"); return code; } @@ -439,13 +439,13 @@ Main(as, arock) /* restore old tgs, since GetTicket are prohibited too. */ code = ktc_SetToken(&tgs_server, &tgs_token, &tgs_client, 0); if (code) { - com_err(whoami, code, "restoring old tgs token"); + afs_com_err(whoami, code, "restoring old tgs token"); return code; } printf("Restoring TGT obtained before NOTGS set\n"); code = ka_GetServerToken(AUTH_SUPERUSER, "", cell, 100, 0, 1); if (code != KABADUSER) { - com_err(whoami, code, + afs_com_err(whoami, code, "expected BADUSER error, getting AFS token w/ old tgs token but with NOTGS set"); CRASH(); } else @@ -456,7 +456,7 @@ Main(as, arock) struct ktc_token afsToken; code = ktc_SetToken(&afs, &oldAFSToken, &oldClient, 0); if (code) { - com_err(whoami, code, "restoring old afs token"); + afs_com_err(whoami, code, "restoring old afs token"); return code; } fprintf(stdout, "Waiting for TGS ticket to age (about 5 min)..."); @@ -472,14 +472,14 @@ Main(as, arock) /* restore old tgs */ code = ktc_SetToken(&tgs_server, &tgs_token, &tgs_client, 0); if (code) { - com_err(whoami, code, "restoring old tgs token"); + afs_com_err(whoami, code, "restoring old tgs token"); return code; } code = ka_GetServerToken(AUTH_SUPERUSER, "", cell, MAXKTCTICKETLIFETIME, &afsToken, 1); if (code) { - com_err(whoami, code, "getting AFS token w/ old tgs token"); + afs_com_err(whoami, code, "getting AFS token w/ old tgs token"); CRASH(); } CheckLife(afsToken.endTime, afsToken.startTime, 3600 - (5 * 60), diff --git a/src/kauth/test/test_interim_ktc.c b/src/kauth/test/test_interim_ktc.c index 6bdb84e..138fdbf 100644 --- a/src/kauth/test/test_interim_ktc.c +++ b/src/kauth/test/test_interim_ktc.c @@ -117,7 +117,7 @@ CheckUnixUID(server, token, client) code = ktc_SetToken(server, token, client, 0); if (code) { - com_err(whoami, code, "using SetToken to set vice id"); + afs_com_err(whoami, code, "using SetToken to set vice id"); return 1; } sprintf(name_buf, "Unix UID %d", getuid()); @@ -128,13 +128,13 @@ CheckUnixUID(server, token, client) fprintf(stderr, "GetToken returned bad client: '"); PrintPrincipal(stderr, &nclient); fprintf(stderr, "'\n"); - com_err(whoami, code, "should have gotten '%s'", name_buf); + afs_com_err(whoami, code, "should have gotten '%s'", name_buf); return 1; } lifetime = (unsigned long)ntoken.endTime - (unsigned long)ntoken.startTime; if ((lifetime & 1) == 1) { - com_err(whoami, code, "GetToken returned even lifetime (%d)", + afs_com_err(whoami, code, "GetToken returned even lifetime (%d)", lifetime); return 1; } @@ -157,7 +157,7 @@ CheckAFSId(server, token, client) viceId = atoi((client->name) + 7); code = ktc_SetToken(server, token, client, 0); if (code) { - com_err(whoami, code, "using SetToken to set vice id to %d", viceId); + afs_com_err(whoami, code, "using SetToken to set vice id to %d", viceId); return 1; } code = ktc_GetToken(server, &ntoken, sizeof(ntoken), &nclient); @@ -169,13 +169,13 @@ CheckAFSId(server, token, client) fprintf(stderr, "' should have gotten '"); PrintPrincipal(stderr, client); fprintf(stderr, "'\n"); - com_err(whoami, code, "didn't preserve AFS ID"); + afs_com_err(whoami, code, "didn't preserve AFS ID"); return 1; } lifetime = (unsigned long)ntoken.endTime - (unsigned long)ntoken.startTime; if ((lifetime & 1) == 0) { - com_err(whoami, code, "GetToken returned even lifetime (%d)", + afs_com_err(whoami, code, "GetToken returned even lifetime (%d)", lifetime); return 1; } @@ -265,7 +265,7 @@ CheckAuth2(server) buffer.out_size = 0; code = pioctl(0, _VICEIOCTL(3), &buffer, 1); if (code) { - com_err(whoami, errno, "setting old-style token"); + afs_com_err(whoami, errno, "setting old-style token"); return 1; } @@ -322,7 +322,7 @@ ListCellsCmd() if (errno == EDOM) break; /* done with the list */ else { - com_err(whoami, code, "getting cell list"); + afs_com_err(whoami, code, "getting cell list"); exit(1); } } @@ -494,7 +494,7 @@ AddTester(pathname) blob.out = space; code = pioctl(pathname, VIOCGETAL, &blob, 1); if (code) { - com_err(whoami, errno, "getting acl for %s", pathname); + afs_com_err(whoami, errno, "getting acl for %s", pathname); return 1; } if (verbose > 1) @@ -538,7 +538,7 @@ AddTester(pathname) blob.in_size = 1 + strlen(blob.in); code = pioctl(pathname, VIOCSETAL, &blob, 1); if (code) { - com_err(whoami, errno, "setting acl on %s to %s", pathname, blob.in); + afs_com_err(whoami, errno, "setting acl on %s to %s", pathname, blob.in); return 1; } if (verbose > 1) { @@ -566,7 +566,7 @@ FreeUnusedCell() token.endTime = 0; code = ktc_SetToken(&server, &token, &client, 0); if (code) { - com_err(whoami, code, "freeing cell"); + afs_com_err(whoami, code, "freeing cell"); exit(1); } } @@ -596,7 +596,7 @@ TryAuthenticating(name, password, viceId, cell) strcpy(server.cell, cell); code = ktc_GetToken(&server, &token, sizeof(token), &client); if (code) { - com_err(whoami, code, "so couldn't get %s's afs token in %s", name, + afs_com_err(whoami, code, "so couldn't get %s's afs token in %s", name, cell); return code; } @@ -648,23 +648,23 @@ CheckAFSTickets() strcpy(server.cell, ka_LocalCell()); code = ktc_GetToken(&server, &token, sizeof(token), &client); if (code) { - com_err(whoami, code, "so couldn't get afs token"); + afs_com_err(whoami, code, "so couldn't get afs token"); return code; } code = mkdir(tdpath, 0777); if (code && (errno != EEXIST)) { - com_err(whoami, errno, "making test dir %s", tdpath); + afs_com_err(whoami, errno, "making test dir %s", tdpath); return code; } fd = open(tfpath, O_WRONLY + O_CREAT + O_TRUNC, 0777); if (fd == -1) { - com_err(whoami, errno, "making test file %s", tfpath); + afs_com_err(whoami, errno, "making test file %s", tfpath); goto failed; } code = close(fd); if (code) { - com_err(whoami, errno, "failed to close %s after create", tfpath); + afs_com_err(whoami, errno, "failed to close %s after create", tfpath); goto failed; } @@ -678,7 +678,7 @@ CheckAFSTickets() goto failed; code = ktc_GetToken(&server, &ntoken, sizeof(ntoken), &nclient); if (code) { - com_err(whoami, code, "getting new local afs token"); + afs_com_err(whoami, code, "getting new local afs token"); goto failed; } @@ -705,29 +705,29 @@ CheckAFSTickets() code = open(tfpath, O_RDONLY, 0); /* check for read access */ if (!((code == -1) && ((errno == ENOENT) || (errno == EACCES)))) { - com_err(whoami, errno, "didn't fail to open %s for read", tfpath); + afs_com_err(whoami, errno, "didn't fail to open %s for read", tfpath); goto failed; } /* as tester we should have read but not write */ code = ktc_SetToken(&server, &ntoken, &nclient, 0); if (code) { - com_err(whoami, code, "restoring new local afs token"); + afs_com_err(whoami, code, "restoring new local afs token"); goto failed; } code = open(tfpath, O_RDWR + O_TRUNC, 0); if ((code != -1) || (errno != EACCES)) { - com_err(whoami, errno, "didn't fail to open %s for write", tfpath); + afs_com_err(whoami, errno, "didn't fail to open %s for write", tfpath); goto failed; } fd = open(tfpath, O_RDONLY, 0); if (fd == -1) { - com_err(whoami, errno, "failed to open %s for read", tfpath); + afs_com_err(whoami, errno, "failed to open %s for read", tfpath); goto failed; } code = close(fd); if (code) { - com_err(whoami, errno, "failed to close %s after open", tfpath); + afs_com_err(whoami, errno, "failed to close %s after open", tfpath); goto failed; } @@ -735,11 +735,11 @@ CheckAFSTickets() /* go back to original privileges */ code = ktc_SetToken(&server, &token, &client, 0); if (code) { - com_err(whoami, code, "so couldn't set afs token in new pag"); + afs_com_err(whoami, code, "so couldn't set afs token in new pag"); exit(1); } if (unlink(tfpath) || rmdir(tdpath)) { - com_err(whoami, errno, "removing test dir %s", tdpath); + afs_com_err(whoami, errno, "removing test dir %s", tdpath); return 1; } return exitCode; @@ -765,7 +765,7 @@ main(argc, argv) srandom(1); - /* Initialize com_err error code hacking */ + /* Initialize afs_com_err error code hacking */ initialize_U_error_table(); initialize_KA_error_table(); initialize_RXK_error_table(); @@ -824,10 +824,10 @@ main(argc, argv) /* expand requested cell name */ code = ka_CellConfig(AFSCONF_CLIENTNAME); if (code) - com_err(whoami, code, "calling cell config"); + afs_com_err(whoami, code, "calling cell config"); code = ka_ExpandCell(cell, cell, 0); if (code) { - com_err(whoami, code, "expanding cell %s", cell); + afs_com_err(whoami, code, "expanding cell %s", cell); exit(1); } @@ -837,7 +837,7 @@ main(argc, argv) if (printToken) { code = ktc_GetToken(&server, &token, sizeof(token), &client); if (code) { - com_err(whoami, code, "so couldn't get afs token"); + afs_com_err(whoami, code, "so couldn't get afs token"); exit(1); } PrintAuthentication(stdout, &server, &token, &client); @@ -867,7 +867,7 @@ main(argc, argv) memcpy(&ntoken, &token, sizeof(ntoken)); code = ktc_SetToken(&server, &ntoken, &client, 0); if (code != KTC_NOCELL) { - com_err(whoami, code, + afs_com_err(whoami, code, "should have gotten bad pioctl error calling SetToken with bogus cell name"); goto failed; } @@ -876,7 +876,7 @@ main(argc, argv) ntoken.ticketLen = 0; code = ktc_SetToken(&server, &ntoken, &client, 0); if ((code != KTC_TOOBIG) && (code != KTC_PIOCTLFAIL)) { - com_err(whoami, code, + afs_com_err(whoami, code, "should have gotten error calling SetToken with zero ticket length"); goto failed; } @@ -884,7 +884,7 @@ main(argc, argv) ntoken.endTime = 0; code = ktc_SetToken(&server, &ntoken, &client, 0); if (code) { - com_err(whoami, code, "calling SetToken with zero expiration time"); + afs_com_err(whoami, code, "calling SetToken with zero expiration time"); goto failed; } strcpy(nclient.name, "foo"); @@ -892,7 +892,7 @@ main(argc, argv) strcpy(nclient.cell, "foo.bar.baz"); code = ktc_SetToken(&server, &ntoken, &nclient, 0); if (code) { - com_err(whoami, code, "calling SetToken with bogus client cell"); + afs_com_err(whoami, code, "calling SetToken with bogus client cell"); goto failed; } memcpy(&ntoken, &token, sizeof(ntoken)); diff --git a/src/kauth/test/test_rxkad_free.c b/src/kauth/test/test_rxkad_free.c index e54cce5..ffbc590 100644 --- a/src/kauth/test/test_rxkad_free.c +++ b/src/kauth/test/test_rxkad_free.c @@ -111,7 +111,7 @@ Main(as, arock) ka_ParseLoginName(as->parms[12].items->data, name, instance, newCell); if (code) { - com_err(whoami, code, "parsing user's name '%s'", + afs_com_err(whoami, code, "parsing user's name '%s'", as->parms[12].items->data); return code; } @@ -139,7 +139,7 @@ Main(as, arock) code = ka_ExpandCell(newCell, newCell, 0 /*local */ ); if (code) { - com_err(whoami, code, "Can't expand cell name"); + afs_com_err(whoami, code, "Can't expand cell name"); return code; } cell = newCell; @@ -160,7 +160,7 @@ Main(as, arock) else if (strlen(passwd) == 0) code = KANULLPASSWORD; if (code) { - com_err(whoami, code, "reading password"); + afs_com_err(whoami, code, "reading password"); return code; } } @@ -174,7 +174,7 @@ Main(as, arock) ap[1] = "-servers"; code = ubik_ParseClientList(i, ap, serverList); if (code) { - com_err(whoami, code, "could not parse server list"); + afs_com_err(whoami, code, "could not parse server list"); return code; } ka_ExplicitCell(cell, serverList); @@ -212,7 +212,7 @@ Main(as, arock) ka_GetAdminToken(name, instance, cell, &key, 3600, &token, 1 /*new */ ); if (code) { - com_err(whoami, code, "getting admin token"); + afs_com_err(whoami, code, "getting admin token"); return code; } pToken = &token; @@ -225,7 +225,7 @@ Main(as, arock) ka_AuthServerConn(cell, KA_MAINTENANCE_SERVICE, pToken, &ubikConn); if (code) { - com_err(whoami, code, "Getting AuthServer ubik conn"); + afs_com_err(whoami, code, "Getting AuthServer ubik conn"); return code; } @@ -247,7 +247,7 @@ Main(as, arock) ubik_Call(KAM_GetEntry, ubikConn, 0, name, instance, KAMAJORVERSION, &tentry); if (code) { - com_err(whoami, code, "getting information for %s.%s", name, + afs_com_err(whoami, code, "getting information for %s.%s", name, instance); return code; } diff --git a/src/kauth/user.c b/src/kauth/user.c index 6dbafe6..f53730a 100644 --- a/src/kauth/user.c +++ b/src/kauth/user.c @@ -111,7 +111,7 @@ ka_GetAFSTicket(char *name, char *instance, char *realm, Date lifetime, return code; code = pr_Initialize(0, AFSDIR_CLIENT_ETC_DIRPATH, server.cell); if (code) { - com_err(whoami, code, "initializing ptserver in cell '%s'", + afs_com_err(whoami, code, "initializing ptserver in cell '%s'", server.cell); return 0; } @@ -134,7 +134,7 @@ ka_GetAFSTicket(char *name, char *instance, char *realm, Date lifetime, if ((code == 0) && (viceId == ANONYMOUSID)) code = PRNOENT; if (code) { - com_err(whoami, code, "translating %s to id", username); + afs_com_err(whoami, code, "translating %s to id", username); return 0; } @@ -285,7 +285,7 @@ ka_UserAuthenticateGeneral(afs_int32 flags, char *name, char *instance, char *re *reasonP = "Authentication Server was unavailable"; break; default: - *reasonP = (char *)error_message(code); + *reasonP = (char *)afs_error_message(code); } return code; } @@ -322,7 +322,7 @@ ka_UserReadPassword(char *prompt, char *password, int plen, char **reasonP) return 0; if (reasonP) { - *reasonP = (char *)error_message(code); + *reasonP = (char *)afs_error_message(code); } return code; } diff --git a/src/libadmin/adminutil/afs_utilAdmin.c b/src/libadmin/adminutil/afs_utilAdmin.c index e04c0aa..f51d364 100644 --- a/src/libadmin/adminutil/afs_utilAdmin.c +++ b/src/libadmin/adminutil/afs_utilAdmin.c @@ -104,7 +104,7 @@ util_AdminErrorCodeTranslate(afs_status_t errorCode, int langId, if (!error_init_done) pthread_once(&error_init_once, init_once); code = (afs_int32) errorCode; - *errorTextP = error_message(code); + *errorTextP = afs_error_message(code); rc = 1; fail_util_AdminErrorCodeTranslate: diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index 32edbcd..f60ee2d 100644 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -68,8 +68,8 @@ EXPORTS xdrrx_create @72 hton_syserr_conv @73 rxkad_global_stats @74 DATA - com_err @75 - error_message @76 + afs_com_err @75 + afs_error_message @76 rx_socket @77 DATA ; AssertionFailed @79 afs_winsockInit @80 diff --git a/src/libafsrpc/afsrpc.exp b/src/libafsrpc/afsrpc.exp index b0bfac6..06f1af9 100644 --- a/src/libafsrpc/afsrpc.exp +++ b/src/libafsrpc/afsrpc.exp @@ -84,8 +84,8 @@ rxkad_global_stats_lock rxkad_stats_key _et_list et_list_mutex -com_err -error_message +afs_com_err +afs_error_message rx_socket des_pcbc_init rx_BusyError diff --git a/src/ptserver/db_verify.c b/src/ptserver/db_verify.c index 47861a8..1eb0681 100644 --- a/src/ptserver/db_verify.c +++ b/src/ptserver/db_verify.c @@ -57,6 +57,7 @@ RCSID #include #include #include +#include #include "ptint.h" #include "pterror.h" @@ -121,7 +122,7 @@ ReadHeader() code = pr_Read(0, (char *)&cheader, sizeof(cheader)); if (code) { - com_err(whoami, code, "couldn't read header"); + afs_com_err(whoami, code, "couldn't read header"); return code; } /* Check and see if database exists and is approximately OK. */ @@ -129,7 +130,7 @@ ReadHeader() || ntohl(cheader.eofPtr) == 0) { if (code) return code; - com_err(whoami, PRDBBAD, "header is bad"); + afs_com_err(whoami, PRDBBAD, "header is bad"); return PRDBBAD; } return 0; @@ -1301,7 +1302,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ n = eof / sizeof(struct prentry); if ((eof < 0) || (n * sizeof(struct prentry) != eof)) { code = PRDBBAD; - com_err(whoami, code, "eof ptr no good: eof=%d, sizeof(prentry)=%d", + afs_com_err(whoami, code, "eof ptr no good: eof=%d, sizeof(prentry)=%d", eof, sizeof(struct prentry)); abort: return code; @@ -1318,7 +1319,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ } code = WalkHashTable(cheader.nameHash, MAP_NAMEHASH, map, misc); if (code) { - com_err(whoami, code, "walking name hash"); + afs_com_err(whoami, code, "walking name hash"); goto abort; } if (misc->verbose) { @@ -1327,7 +1328,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ } code = WalkHashTable(cheader.idHash, MAP_IDHASH, map, misc); if (code) { - com_err(whoami, code, "walking id hash"); + afs_com_err(whoami, code, "walking id hash"); goto abort; } @@ -1339,7 +1340,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ misc->idRange = n - misc->minId + 1; misc->idmap = (afs_int32 *) malloc(misc->idRange * sizeof(afs_int32)); if (!misc->idmap) { - com_err(whoami, 0, "Unable to malloc space for max ids of %d", + afs_com_err(whoami, 0, "Unable to malloc space for max ids of %d", misc->idRange); code = -1; goto abort; @@ -1353,7 +1354,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ } code = WalkChains(map, misc); if (code) { - com_err(whoami, code, "walking chains"); + afs_com_err(whoami, code, "walking chains"); goto abort; } if (misc->verbose) { @@ -1362,7 +1363,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ } code = WalkNextChain(map, misc, 0, 0); if (code) { - com_err(whoami, code, "walking free list"); + afs_com_err(whoami, code, "walking free list"); goto abort; } if (misc->verbose) { @@ -1371,7 +1372,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ } code = WalkOwnedChain(map, misc, 0, 0); if (code) { - com_err(whoami, code, "walking orphan list"); + afs_com_err(whoami, code, "walking orphan list"); goto abort; } @@ -1381,7 +1382,7 @@ CheckPrDatabase(struct misc_data *misc) /* info & statistics */ } code = GC(map, misc); if (code) { - com_err(whoami, code, "looking for unreferenced entries"); + afs_com_err(whoami, code, "looking for unreferenced entries"); goto abort; } @@ -1453,7 +1454,7 @@ WorkerBee(struct cmd_syndesc *as, char *arock) fd = open(pr_dbaseName, O_RDONLY, 0); if (fd == -1) { - com_err(whoami, errno, "Open failed on db %s", pr_dbaseName); + afs_com_err(whoami, errno, "Open failed on db %s", pr_dbaseName); exit(2); } @@ -1471,7 +1472,7 @@ WorkerBee(struct cmd_syndesc *as, char *arock) if (recreateFile) { misc.recreate = fopen(recreateFile, "w"); if (misc.recreate == 0) { - com_err(whoami, errno, + afs_com_err(whoami, errno, "can't create file for recreation instructions: %s", recreateFile); exit(4); @@ -1479,7 +1480,7 @@ WorkerBee(struct cmd_syndesc *as, char *arock) } code = CheckPrDatabase(&misc); if (code) { - com_err(whoami, code, "Checking prserver database"); + afs_com_err(whoami, code, "Checking prserver database"); exit(3); } exit(0); diff --git a/src/ptserver/pt_util.c b/src/ptserver/pt_util.c index 8a366da..9275d1d 100644 --- a/src/ptserver/pt_util.c +++ b/src/ptserver/pt_util.c @@ -242,7 +242,7 @@ CommandProc(register struct cmd_syndesc *a_as) if (code) fprintf(stderr, "Error setting group count on %s: %s\n", - name, error_message(code)); + name, afs_error_message(code)); } code = CreateEntry(0, u->name, &uid, 1 /*idflag */ , 1 /*gflag */ , @@ -251,7 +251,7 @@ CommandProc(register struct cmd_syndesc *a_as) } if (code) fprintf(stderr, "Error while creating %s: %s\n", - u->name, error_message(code)); + u->name, afs_error_message(code)); continue; } /* Add user to group */ @@ -271,7 +271,7 @@ CommandProc(register struct cmd_syndesc *a_as) if (code) fprintf(stderr, "Error while adding %s to %s: %s\n", mem, - name, error_message(code)); + name, afs_error_message(code)); } else { sscanf(buffer, "%s %d/%d %d %d %d", name, &flags, "a, &id, &oid, &cid); @@ -289,7 +289,7 @@ CommandProc(register struct cmd_syndesc *a_as) usr_head = u; } else if (code) { fprintf(stderr, "Error while creating %s: %s\n", name, - error_message(code)); + afs_error_message(code)); } else if ((flags & PRACCESS) || (flags & (PRGRP | PRQUOTA)) == (PRGRP | PRQUOTA)) { @@ -303,14 +303,14 @@ CommandProc(register struct cmd_syndesc *a_as) if (code) fprintf(stderr, "Error while setting flags on %s: %s\n", name, - error_message(code)); + afs_error_message(code)); } } } for (u = usr_head; u; u = u->next) if (u->uid) fprintf(stderr, "Error while creating %s: %s\n", u->name, - error_message(PRBADNAM)); + afs_error_message(PRBADNAM)); } else { for (i = 0; i < HASHSIZE; i++) { upos = nflag ? ntohl(prh.nameHash[i]) : ntohl(prh.idHash[i]); diff --git a/src/ptserver/ptclient.c b/src/ptserver/ptclient.c index 332b8ed..0918e40 100644 --- a/src/ptserver/ptclient.c +++ b/src/ptserver/ptclient.c @@ -237,7 +237,7 @@ main(argc, argv) code = pr_Initialize(security, confdir, cell); if (code) { - com_err(whoami, code, "Couldn't initialize protection library"); + afs_com_err(whoami, code, "Couldn't initialize protection library"); exit(1); } @@ -252,7 +252,7 @@ main(argc, argv) code = GetString(op, sizeof(op)); if (code) { - com_err(whoami, PRBADARG, + afs_com_err(whoami, PRBADARG, "error reading opcode in line '%s', got '%.*s'", line, sizeof(op), op); exit(1); @@ -269,7 +269,7 @@ main(argc, argv) else code = ubik_PR_INewEntry(pruclient, 0, name, id, oid); if (CodeOk(code)) - com_err(whoami, code, "on %s %s %d %d", op, name, id, oid); + afs_com_err(whoami, code, "on %s %s %d %d", op, name, id, oid); } else if (!strcmp(op, "sf")) { afs_int32 mask, access, gq, uq; if (GetInt32(&id) || GetXInt32(&mask) || GetXInt32(&access) @@ -280,7 +280,7 @@ main(argc, argv) ubik_PR_SetFieldsEntry(pruclient, 0, id, mask, access, gq, uq, 0, 0); if (CodeOk(code)) - com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask, + afs_com_err(whoami, code, "on %s %d %x %x %d %d", op, id, mask, access, gq, uq); } else if (!strcmp(op, "ce")) { char newname[PR_MAXNAMELEN]; @@ -293,7 +293,7 @@ main(argc, argv) ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid, newid); if (CodeOk(code)) - com_err(whoami, code, "on %s %d %s %d %d", op, id, newname, + afs_com_err(whoami, code, "on %s %d %s %d %d", op, id, newname, oid, newid); } else if (!strcmp(op, "wh")) { /* scanf("%d",&id); */ @@ -334,7 +334,7 @@ main(argc, argv) else code = ubik_PR_AddToGroup(pruclient, 0, id, gid); if (CodeOk(code)) - com_err(whoami, code, "on %s %d %d", op, id, gid); + afs_com_err(whoami, code, "on %s %d %d", op, id, gid); } else if (!strcmp(op, "iton")) { lid.idlist_val = (afs_int32 *) malloc(20 * sizeof(afs_int32)); ptr = lid.idlist_val; diff --git a/src/ptserver/ptclient.h b/src/ptserver/ptclient.h index 92d14db..f4de080 100644 --- a/src/ptserver/ptclient.h +++ b/src/ptserver/ptclient.h @@ -46,4 +46,4 @@ extern int PR_UpdateEntry(); extern int PR_ListSuperGroups(); #endif -#define pr_ErrorMsg error_message +#define pr_ErrorMsg afs_error_message diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 2aca376..5ffd9a4 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -46,6 +46,7 @@ RCSID #include "ptclient.h" #include "pterror.h" #include +#include #undef FOREIGN @@ -176,7 +177,7 @@ GetGlobals(struct cmd_syndesc *as, char *arock) code = pr_Initialize(sec, AFSDIR_CLIENT_ETC_DIRPATH, cell); } if (code) { - com_err(whoami, code, "while initializing"); + afs_com_err(whoami, code, "while initializing"); return code; } if (as->parms[19].items) @@ -226,13 +227,13 @@ CreateGroup(struct cmd_syndesc *as, char *arock) if (idi) { code = util_GetInt32(idi->data, &id); if (code) { - com_err(whoami, code, "because group id was: '%s'", + afs_com_err(whoami, code, "because group id was: '%s'", idi->data); return code; } if (id >= 0) { code = PRBADARG; - com_err(whoami, code, "because group id %d was not negative", + afs_com_err(whoami, code, "because group id %d was not negative", id); return code; } @@ -249,13 +250,13 @@ CreateGroup(struct cmd_syndesc *as, char *arock) code = pr_CreateGroup(namei->data, owner, &id); if (code) { if (owner || id) - com_err(whoami, code, + afs_com_err(whoami, code, "; unable to create group %s with id %d%s%s%s%s", namei->data, id, owner ? " owned by '" : "", owner ? owner : "", owner ? "'" : "", (force ? " (ignored)" : "")); else - com_err(whoami, code, "; unable to create group %s %s", + afs_com_err(whoami, code, "; unable to create group %s %s", namei->data, (force ? "(ignored)" : "")); if (!force) return code; @@ -281,7 +282,7 @@ CreateUser(struct cmd_syndesc *as, char *arock) if (idi) { code = util_GetInt32(idi->data, &id); if (code) { - com_err(whoami, code, "because id was: '%s'", idi->data); + afs_com_err(whoami, code, "because id was: '%s'", idi->data); return code; } if (id == 0) { @@ -295,11 +296,11 @@ CreateUser(struct cmd_syndesc *as, char *arock) code = pr_CreateUser(namei->data, &id); if (code) { if (id) - com_err(whoami, code, + afs_com_err(whoami, code, "; unable to create user %s with id %d %s", namei->data, id, (force ? "(ignored)" : "")); else - com_err(whoami, code, "; unable to create user %s %s", + afs_com_err(whoami, code, "; unable to create user %s %s", namei->data, (force ? "(ignored)" : "")); if (!force) return code; @@ -321,11 +322,11 @@ GetNameOrId(register struct cmd_syndesc *as, struct idlist *lids, struct namelis int goodCount; if (!(as->parms[0].items || as->parms[1].items)) { - com_err(whoami, 0, "must specify either a name or an id."); + afs_com_err(whoami, 0, "must specify either a name or an id."); return -1; } if (as->parms[0].items && as->parms[1].items) { - com_err(whoami, 0, "can't specify both a name and id."); + afs_com_err(whoami, 0, "can't specify both a name and id."); return -1; } @@ -354,11 +355,11 @@ GetNameOrId(register struct cmd_syndesc *as, struct idlist *lids, struct namelis code = pr_NameToId(nl, lids); if (code) - com_err(whoami, code, "so couldn't look up names"); + afs_com_err(whoami, code, "so couldn't look up names"); else { for (n = 0; n < lids->idlist_len; n++) { if ((lids->idlist_val[n] == ANONYMOUSID)) { - com_err(whoami, PRNOENT, "so couldn't look up id for %s", + afs_com_err(whoami, PRNOENT, "so couldn't look up id for %s", nl->namelist_val[n]); } else goodCount++; @@ -380,7 +381,7 @@ GetNameOrId(register struct cmd_syndesc *as, struct idlist *lids, struct namelis for (i = as->parms[1].items; i; i = i->next) { code = util_GetInt32(i->data, &lids->idlist_val[n]); if (code) - com_err(whoami, code = + afs_com_err(whoami, code = PRNOENT, "because a bogus id '%s' was specified", i->data); n++; @@ -390,7 +391,7 @@ GetNameOrId(register struct cmd_syndesc *as, struct idlist *lids, struct namelis lnames->namelist_len = 0; code = pr_IdToName(lids, lnames); if (code) - com_err(whoami, code, "translating ids"); + afs_com_err(whoami, code, "translating ids"); } } if (code) { @@ -447,11 +448,11 @@ GetNameOrId(register struct cmd_syndesc *as, struct idlist *lids, struct namelis tids.idlist_val = 0; code = pr_NameToId(&names, &tids); if (code) - com_err(whoami, code, "so couldn't look up names"); + afs_com_err(whoami, code, "so couldn't look up names"); else { for (n = 0; n < tids.idlist_len; n++) { if ((tids.idlist_val[n] == ANONYMOUSID)) { - com_err(whoami, PRNOENT, "so couldn't look up id for %s", + afs_com_err(whoami, PRNOENT, "so couldn't look up id for %s", names.namelist_val[n]); } else goodCount++; @@ -470,7 +471,7 @@ GetNameOrId(register struct cmd_syndesc *as, struct idlist *lids, struct namelis tnames.namelist_len = 0; code = pr_IdToName(&ids, &tnames); if (code) - com_err(whoami, code, "translating ids"); + afs_com_err(whoami, code, "translating ids"); else goodCount++; if (lnames) { @@ -501,7 +502,7 @@ AddToGroup(struct cmd_syndesc *as, char *arock) for (g = as->parms[1].items; g; g = g->next) { code = pr_AddToGroup(u->data, g->data); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; unable to add user %s to group %s %s", u->data, g->data, (force ? "(ignored)" : "")); if (!force) @@ -522,7 +523,7 @@ RemoveFromGroup(struct cmd_syndesc *as, char *arock) for (g = as->parms[1].items; g; g = g->next) { code = pr_RemoveUserFromGroup(u->data, g->data); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; unable to remove user %s from group %s %s", u->data, g->data, (force ? "(ignored)" : "")); if (!force) @@ -557,7 +558,7 @@ ListMembership(struct cmd_syndesc *as, char *arock) list.namelist_len = 0; code = pr_IDListMembers(ids.idlist_val[i], &list); if (code) { - com_err(whoami, code, "; unable to get membership of %s (id: %d)", + afs_com_err(whoami, code, "; unable to get membership of %s (id: %d)", name, id); continue; } @@ -598,7 +599,7 @@ Delete(struct cmd_syndesc *as, char *arock) code = pr_DeleteByID(id); if (code) { - com_err(whoami, code, "deleting %s (id: %d) %s", name, id, + afs_com_err(whoami, code, "deleting %s (id: %d) %s", name, id, (force ? "(ignored)" : "")); if (!force) return code; @@ -646,7 +647,7 @@ CheckEntry(struct cmd_syndesc *as, char *arock) code = pr_ListEntry(id, &aentry); if (code) { rcode = code; - com_err(whoami, code, "; unable to find entry for (id: %d)", id); + afs_com_err(whoami, code, "; unable to find entry for (id: %d)", id); continue; } @@ -655,7 +656,7 @@ CheckEntry(struct cmd_syndesc *as, char *arock) code = pr_IdToName(&lids, &lnames); if (code) { rcode = code; - com_err(whoami, code, + afs_com_err(whoami, code, "translating owner (%d) and creator (%d) ids", aentry.owner, aentry.creator); continue; @@ -736,7 +737,7 @@ ListEntries(struct cmd_syndesc *as, char *arock) pr_ListEntries(flag, startindex, &nentries, &entriesp, &nextstartindex); if (code) { - com_err(whoami, code, "; unable to list entries\n"); + afs_com_err(whoami, code, "; unable to list entries\n"); if (entriesp) free(entriesp); break; @@ -764,7 +765,7 @@ ChownGroup(struct cmd_syndesc *as, char *arock) owner = as->parms[1].items->data; code = pr_ChangeEntry(name, "", 0, owner); if (code) - com_err(whoami, code, "; unable to change owner of %s to %s", name, + afs_com_err(whoami, code, "; unable to change owner of %s to %s", name, owner); return code; } @@ -780,7 +781,7 @@ ChangeName(struct cmd_syndesc *as, char *arock) newname = as->parms[1].items->data; code = pr_ChangeEntry(oldname, newname, 0, ""); if (code) - com_err(whoami, code, "; unable to change name of %s to %s", oldname, + afs_com_err(whoami, code, "; unable to change name of %s to %s", oldname, newname); return code; } @@ -793,11 +794,11 @@ ListMax(struct cmd_syndesc *as, char *arock) code = pr_ListMaxUserId(&maxUser); if (code) - com_err(whoami, code, "getting maximum user id"); + afs_com_err(whoami, code, "getting maximum user id"); else { code = pr_ListMaxGroupId(&maxGroup); if (code) - com_err(whoami, code, "getting maximum group id"); + afs_com_err(whoami, code, "getting maximum group id"); else { printf("Max user id is %d and max group id is %d.\n", maxUser, maxGroup); @@ -817,12 +818,12 @@ SetMax(struct cmd_syndesc *as, char *arock) /* set user max */ code = util_GetInt32(as->parms[1].items->data, &maxid); if (code) { - com_err(whoami, code, "because id was: '%s'", + afs_com_err(whoami, code, "because id was: '%s'", as->parms[1].items->data); } else { code = pr_SetMaxUserId(maxid); if (code) - com_err(whoami, code, "so couldn't set Max User Id to %d", + afs_com_err(whoami, code, "so couldn't set Max User Id to %d", maxid); } } @@ -830,12 +831,12 @@ SetMax(struct cmd_syndesc *as, char *arock) /* set group max */ code = util_GetInt32(as->parms[0].items->data, &maxid); if (code) { - com_err(whoami, code, "because id was: '%s'", + afs_com_err(whoami, code, "because id was: '%s'", as->parms[0].items->data); } else { code = pr_SetMaxGroupId(maxid); if (code) - com_err(whoami, code, "so couldn't set Max Group Id to %d", + afs_com_err(whoami, code, "so couldn't set Max Group Id to %d", maxid); } } @@ -904,7 +905,7 @@ SetFields(struct cmd_syndesc *as, char *arock) if (as->parms[2].items) { /* limitgroups */ code = util_GetInt32(as->parms[2].items->data, &ngroups); if (code) { - com_err(whoami, code, "because ngroups was: '%s'", + afs_com_err(whoami, code, "because ngroups was: '%s'", as->parms[2].items->data); return code; } @@ -914,7 +915,7 @@ SetFields(struct cmd_syndesc *as, char *arock) if (as->parms[3].items) { /* limitgroups */ code = util_GetInt32(as->parms[3].items->data, &nusers); if (code) { - com_err(whoami, code, "because nusers was: '%s'", + afs_com_err(whoami, code, "because nusers was: '%s'", as->parms[3].items->data); return code; } @@ -929,7 +930,7 @@ SetFields(struct cmd_syndesc *as, char *arock) continue; code = pr_SetFieldsEntry(id, mask, flags, ngroups, nusers); if (code) { - com_err(whoami, code, "; unable to set fields for %s (id: %d)", + afs_com_err(whoami, code, "; unable to set fields for %s (id: %d)", name, id); return code; } @@ -971,7 +972,7 @@ ListOwned(struct cmd_syndesc *as, char *arock) list.namelist_len = 0; code = pr_ListOwned(oid, &list, &more); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "; unable to get owner list for %s (id: %d)", name, oid); break; @@ -1188,7 +1189,7 @@ main(int argc, char **argv) cmd_ParseLine(line, parsev, &parsec, sizeof(parsev) / sizeof(*parsev)); if (code) { - com_err(whoami, code, "parsing line: <%s>", line); + afs_com_err(whoami, code, "parsing line: <%s>", line); exit(2); } savec = parsev[0]; diff --git a/src/ptserver/ptserver.c b/src/ptserver/ptserver.c index 463f5d9..8878fc0 100644 --- a/src/ptserver/ptserver.c +++ b/src/ptserver/ptserver.c @@ -148,6 +148,7 @@ RCSID #include "error_macros.h" #include "afs/audit.h" #include +#include /* make all of these into a structure if you want */ @@ -459,7 +460,7 @@ main(int argc, char **argv) code = afsconf_GetExtendedCellInfo(prdir, NULL, "afsprot", &info, &clones); if (code) { - com_err(whoami, code, "Couldn't get server list"); + afs_com_err(whoami, code, "Couldn't get server list"); PT_EXIT(2); } pr_realmName = info.name; @@ -469,7 +470,7 @@ main(int argc, char **argv) /* get keys */ code = afsconf_GetKey(prdir, 999, &tkey); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "couldn't get bcrypt keys from key file, ignoring."); } #endif @@ -527,7 +528,7 @@ main(int argc, char **argv) ubik_ServerInitByInfo(myHost, htons(AFSCONF_PROTPORT), &info, &clones, pr_dbaseName, &dbase); if (code) { - com_err(whoami, code, "Ubik init failed"); + afs_com_err(whoami, code, "Ubik init failed"); PT_EXIT(2); } #if defined(SUPERGROUPS) diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index 39b1ece..8a835f7 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -52,6 +52,7 @@ RCSID #include #include #include +#include #include "ptclient.h" #include "ptuser.h" #include "pterror.h" @@ -185,7 +186,7 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell) if (code) fprintf(stderr, "libprot: clientauthsecure returns %d %s" - " (so trying noauth)\n", code, error_message(code)); + " (so trying noauth)\n", code, afs_error_message(code)); if (code) scIndex = 0; /* use noauth */ if (scIndex != 2) @@ -221,7 +222,7 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell) if ((scIndex == 0) && (sc[0] == 0)) sc[0] = rxnull_NewClientSecurityObject(); if ((scIndex == 0) && (secLevel != 0)) - com_err(whoami, code, + afs_com_err(whoami, code, "Could not get afs tokens, running unauthenticated."); memset(serverconns, 0, sizeof(serverconns)); /* terminate list!!! */ @@ -233,7 +234,7 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell) code = ubik_ClientInit(serverconns, &pruclient); if (code) { - com_err(whoami, code, "ubik client init failed."); + afs_com_err(whoami, code, "ubik client init failed."); return code; } lastLevel = scIndex; diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index bc2a73b..43ccf2c 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -1697,7 +1697,7 @@ read_DbHeader(struct ubik_trans *tt) code = pr_Read(tt, 0, 0, (char *)&cheader, sizeof(cheader)); if (code != 0) { - com_err(whoami, code, "Couldn't read header"); + afs_com_err(whoami, code, "Couldn't read header"); } return code; } @@ -1735,7 +1735,7 @@ Initdb() len = sizeof(cheader); code = pr_Read(tt, 0, 0, (char *)&cheader, len); if (code != 0) { - com_err(whoami, code, "couldn't read header"); + afs_com_err(whoami, code, "couldn't read header"); ubik_AbortTrans(tt); return code; } @@ -1762,14 +1762,14 @@ Initdb() for (i = 0; i < sizeof(cheader); i++) if (bp[i]) { code = PRDBBAD; - com_err(whoami, code, + afs_com_err(whoami, code, "Can't rebuild database because it is not empty"); return code; } } if (!pr_noAuth) { code = PRDBBAD; - com_err(whoami, code, + afs_com_err(whoami, code, "Can't rebuild database because not running NoAuth"); return code; } @@ -1804,7 +1804,7 @@ Initdb() if ((code = set_header_word(tt, version, htonl(PRDBVERSION))) || (code = set_header_word(tt, headerSize, htonl(sizeof(cheader)))) || (code = set_header_word(tt, eofPtr, cheader.headerSize))) { - com_err(whoami, code, "couldn't write header words"); + afs_com_err(whoami, code, "couldn't write header words"); ubik_AbortTrans(tt); return code; } @@ -1814,7 +1814,7 @@ Initdb() code = CreateEntry \ (tt, (name), &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \ if (code) { \ - com_err (whoami, code, "couldn't create %s with id %di.", \ + afs_com_err (whoami, code, "couldn't create %s with id %di.", \ (name), (id)); \ ubik_AbortTrans(tt); \ return code; \ @@ -1832,7 +1832,7 @@ Initdb() * it back to 0 */ code = set_header_word(tt, maxID, 0); /* correct in any byte order */ if (code) { - com_err(whoami, code, "couldn't reset max id"); + afs_com_err(whoami, code, "couldn't reset max id"); ubik_AbortTrans(tt); return code; } diff --git a/src/ptserver/readgroup.c b/src/ptserver/readgroup.c index 5d75c27..52300ae 100644 --- a/src/ptserver/readgroup.c +++ b/src/ptserver/readgroup.c @@ -29,6 +29,7 @@ RCSID #include #include #include +#include #include "ptclient.h" #include "pterror.h" diff --git a/src/ptserver/readpwd.c b/src/ptserver/readpwd.c index 165a43e..9b9870e 100644 --- a/src/ptserver/readpwd.c +++ b/src/ptserver/readpwd.c @@ -28,6 +28,7 @@ RCSID #include #include #include +#include #include "ptclient.h" int diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c index 951eb37..0655b84 100644 --- a/src/ptserver/testpt.c +++ b/src/ptserver/testpt.c @@ -49,6 +49,7 @@ RCSID #include "ptclient.h" #include "pterror.h" #include +#include static char *whoami = "testpr"; static struct afsconf_dir *conf; /* cell info, set by MyBeforeProc */ @@ -78,7 +79,7 @@ ListUsedIds(struct cmd_syndesc *as, char *arock) code = pr_Initialize(1, conf_dir, NULL); if (code) { - com_err(whoami, code, "initializing pruser"); + afs_com_err(whoami, code, "initializing pruser"); exit(1); } if (startId < 0) { @@ -86,7 +87,7 @@ ListUsedIds(struct cmd_syndesc *as, char *arock) code = pr_ListMaxGroupId(&maxId); if (code) { bad_max: - com_err(whoami, code, "getting maximum id"); + afs_com_err(whoami, code, "getting maximum id"); exit(2); } if (startId < maxId) { @@ -132,7 +133,7 @@ ListUsedIds(struct cmd_syndesc *as, char *arock) lids.idlist_len = i; code = pr_IdToName(&lids, &lnames); if (code) { - com_err(whoami, code, "converting id to name"); + afs_com_err(whoami, code, "converting id to name"); exit(2); } for (j = 0; j < lnames.namelist_len; j++) { @@ -255,7 +256,7 @@ CreateUser(int u) } } } - com_err(whoami, code, "couldn't create %s", name); + afs_com_err(whoami, code, "couldn't create %s", name); exit(12); } done: @@ -323,7 +324,7 @@ CreateGroup(int g) } } } - com_err(whoami, code, "couldn't create %s w/ owner=%d", name, owner); + afs_com_err(whoami, code, "couldn't create %s w/ owner=%d", name, owner); exit(13); } done: @@ -352,7 +353,7 @@ DeleteRandomId(afs_int32 *list) if (id = list[m]) { code = ubik_Call(PR_Delete, pruclient, 0, id); if (code) { - com_err(whoami, code, "Couldn't delete %di", id); + afs_com_err(whoami, code, "Couldn't delete %di", id); exit(22); } list[m] = 0; @@ -380,7 +381,7 @@ AddUser(int u, int g) gi = groups[g]; code = ubik_Call(PR_AddToGroup, pruclient, 0, ui, gi); if (code) { - com_err(whoami, code, "couldn't add %d to %d", ui, gi); + afs_com_err(whoami, code, "couldn't add %d to %d", ui, gi); exit(14); } if (verbose) @@ -399,7 +400,7 @@ RemUser(int u, int g) gi = groups[g]; code = ubik_Call(PR_RemoveFromGroup, pruclient, 0, ui, gi); if (code) { - com_err(whoami, code, "couldn't remove %d from %d", ui, gi); + afs_com_err(whoami, code, "couldn't remove %d from %d", ui, gi); exit(14); } if (verbose) @@ -424,7 +425,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) code = pr_Initialize(1, conf_dir, NULL); if (code) { - com_err(whoami, code, "initializing pruser"); + afs_com_err(whoami, code, "initializing pruser"); exit(1); } /* get name of person running command */ @@ -439,7 +440,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) exit(2); code = ktc_GetToken(&afs, &token, sizeof(token), &user); if (code) { - com_err(whoami, code, "getting afs tokens"); + afs_com_err(whoami, code, "getting afs tokens"); exit(3); } if (strlen(user.instance) > 0) { @@ -451,7 +452,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) callerId = atoi(user.name + 7); code = pr_SIdToName(callerId, callerName); if (code) { - com_err(whoami, code, "call get name for id %d", callerId); + afs_com_err(whoami, code, "call get name for id %d", callerId); exit(6); } } else { @@ -465,7 +466,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) callerId = 0; code = pr_CreateUser(callerName, &callerId); if (code) { - com_err(whoami, code, "can't create caller %s", callerName); + afs_com_err(whoami, code, "can't create caller %s", callerName); exit(5); } printf("Creating caller %s (%di)\n", callerName, callerId); @@ -473,7 +474,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) /* else */ #endif if (code) { - com_err(whoami, code, "can't find caller %s", callerName); + afs_com_err(whoami, code, "can't find caller %s", callerName); exit(6); } else printf("Assuming caller is %s (%di)\n", callerName, callerId); @@ -599,7 +600,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) proc = PR_GetCPS; code = ubik_Call(proc, pruclient, 0, ui, &alist, &over); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "getting membership list of (%di) using %s", ui, ((proc == PR_GetCPS) ? "GetCPR" : "ListElements")); exit(24); @@ -657,7 +658,7 @@ TestManyMembers(struct cmd_syndesc *as, char *arock) (xlist).prlist_val = 0; (xlist).prlist_len = 0; \ code = ubik_Call (PR_ListOwned, pruclient, 0, (xid), &(xlist), &over); \ if (code) { \ - com_err (whoami, code, "getting owner list of (%di)", (xid)); \ + afs_com_err (whoami, code, "getting owner list of (%di)", (xid)); \ exit (23); } \ if (over) \ { fprintf (stderr, "membership of id %di too long\n", (xid)); } @@ -778,7 +779,7 @@ TestPrServ(struct cmd_syndesc *as, char *arock) code = pr_Initialize(1, conf_dir, NULL); if (code) { - com_err(whoami, code, "initializing pruser"); + afs_com_err(whoami, code, "initializing pruser"); exit(1); } @@ -789,7 +790,7 @@ TestPrServ(struct cmd_syndesc *as, char *arock) id = 0; code = pr_CreateUser(name, &id); if ((code != RXGEN_CC_MARSHAL) && (code != PRBADNAM)) { - com_err(whoami, code, "succeeded creating %s", name); + afs_com_err(whoami, code, "succeeded creating %s", name); exit(2); } name[i] = 0; @@ -799,17 +800,17 @@ TestPrServ(struct cmd_syndesc *as, char *arock) fprintf(stderr, "group already exists, skipping\n"); pr_SNameToId(name, &id); } else if (code) { - com_err(whoami, code, "failed creating %s", name); + afs_com_err(whoami, code, "failed creating %s", name); exit(3); } if ((code = pr_ListEntry(id, &ent)) || (code = pr_SIdToName(ent.creator, creator))) { - com_err(whoami, code, "getting creator's name"); + afs_com_err(whoami, code, "getting creator's name"); exit(5); } code = pr_DeleteByID(id); if (code) { - com_err(whoami, code, "deleting %s", name); + afs_com_err(whoami, code, "deleting %s", name); exit(6); } /* now make sure the illegal chars are detected */ @@ -820,7 +821,7 @@ TestPrServ(struct cmd_syndesc *as, char *arock) id = 0; code = pr_CreateUser(name, &id); if (code != PRBADNAM) { - com_err(whoami, code, "succeeded creating %s", name); + afs_com_err(whoami, code, "succeeded creating %s", name); exit(8); } } @@ -842,12 +843,12 @@ TestPrServ(struct cmd_syndesc *as, char *arock) } else if (code) { char ascii[BUFSIZ]; ka_ConvertBytes(ascii, sizeof(ascii), name, strlen(name)); - com_err(whoami, code, "failed creating %s", ascii); + afs_com_err(whoami, code, "failed creating %s", ascii); exit(4); } code = pr_DeleteByID(id); if (code) { - com_err(whoami, code, "deleting %s", name); + afs_com_err(whoami, code, "deleting %s", name); exit(7); } } @@ -859,7 +860,7 @@ TestPrServ(struct cmd_syndesc *as, char *arock) id = 0; code = pr_CreateGroup(name, &id); if (code != PRNOENT) { /* owner doesn't exist */ - com_err(whoami, code, "succeeded creating %s", name); + afs_com_err(whoami, code, "succeeded creating %s", name); exit(9); } name[0] = creator[0]; /* fix owner */ @@ -871,7 +872,7 @@ TestPrServ(struct cmd_syndesc *as, char *arock) id = 0; code = pr_CreateGroup(name, creator, &id); if (code != PRBADNAM) { - com_err(whoami, code, "succeeded creating %s", name); + afs_com_err(whoami, code, "succeeded creating %s", name); exit(10); } } @@ -892,12 +893,12 @@ TestPrServ(struct cmd_syndesc *as, char *arock) } else if (code) { char ascii[BUFSIZ]; ka_ConvertBytes(ascii, sizeof(ascii), name, strlen(name)); - com_err(whoami, code, "failed creating %s", ascii); + afs_com_err(whoami, code, "failed creating %s", ascii); exit(4); } code = pr_DeleteByID(id); if (code) { - com_err(whoami, code, "deleting %s", name); + afs_com_err(whoami, code, "deleting %s", name); exit(7); } } @@ -1003,7 +1004,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) (unsigned long)getpid()); code = mkdir(tmp_conf_dir, 0777); if ((code < 0) && (errno != EEXIST)) { - com_err(whoami, errno, "can't create temporary afsconf dir: %s", + afs_com_err(whoami, errno, "can't create temporary afsconf dir: %s", cdir); return errno; } @@ -1013,7 +1014,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) f = fopen(tmp_conf_file, "w"); if (f == 0) { cantcreate: - com_err(whoami, errno, "can't create conf file %s", + afs_com_err(whoami, errno, "can't create conf file %s", tmp_conf_file); return errno; } @@ -1026,7 +1027,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock) } if (fclose(f) == EOF) { cantclose: - com_err(whoami, errno, "can't write to conf file %s", + afs_com_err(whoami, errno, "can't write to conf file %s", tmp_conf_file); return errno; } @@ -1135,6 +1136,6 @@ main(int argc, char *argv[]) code = cmd_Dispatch(argc, argv); if (code) - com_err(whoami, code, "calling cmd_Dispatch"); + afs_com_err(whoami, code, "calling cmd_Dispatch"); exit(code); } diff --git a/src/rx/test/generator.c b/src/rx/test/generator.c index 2baf8d5..bf11247 100644 --- a/src/rx/test/generator.c +++ b/src/rx/test/generator.c @@ -75,14 +75,14 @@ static char *unix_symbols[] = { /* all one string */ "LIBS = $(DESTDIR)lib/libafsrpc.so \\\n" "\t$(DESTDIR)lib/afs/libcmd.a \\\n" - "\t$(DESTDIR)lib/afs/libcom_err.a \\\n" + "\t$(DESTDIR)lib/afs/libafs_com_err.a \\\n" "\t$(DESTDIR)lib/afs/util.a \n", /* all one string */ "LIBS = $(DESTDIR)lib/librxkad.a \\\n" "\t$(DESTDIR)lib/libdes.a \\\n" "\t$(DESTDIR)lib/librx.a \\\n" "\t$(DESTDIR)lib/liblwp.a \\\n" "\t$(DESTDIR)lib/afs/libcmd.a \\\n" - "\t$(DESTDIR)lib/afs/libcom_err.a \\\n" + "\t$(DESTDIR)lib/afs/libafs_com_err.a \\\n" "\t$(DESTDIR)lib/afs/util.a \\\n" "\t/usr/ucblib/libucb.a \n", /* all one string */ @@ -102,7 +102,7 @@ static char *nt_symbols[] = { /* all one string */ "LIBS = $(DESTDIR)/lib/afsrpc.lib \\\n" "\t$(DESTDIR)/lib/afs/afscmd.lib \\\n" - "\t$(DESTDIR)/lib/afs/afscom_err.lib \\\n" + "\t$(DESTDIR)/lib/afs/afsafs_com_err.lib \\\n" "\t$(DESTDIR)/lib/afs/afsutil.lib \\\n" "\t$(DESTDIR)/lib/pthread.lib \\\n" "\t$(DESTDIR)/lib/afsreg.lib \\\n" "\t$(XLIBS)\n", @@ -112,7 +112,7 @@ static char *nt_symbols[] = { "\t$(DESTDIR)/lib/afsdes.lib \\\n" "\t$(DESTDIR)/lib/afsrx.lib \\\n" "\t$(DESTDIR)/lib/afslwp.lib \\\n" "\t$(DESTDIR)/lib/afs/afscmd.lib \\\n" - "\t$(DESTDIR)/lib/afs/afscom_err.lib \\\n" + "\t$(DESTDIR)/lib/afs/afsafs_com_err.lib \\\n" "\t$(DESTDIR)/lib/afs/afsutil.lib \\\n" "\t$(DESTDIR)/lib/afsreg.lib \n", diff --git a/src/rxkad/test/stress.c b/src/rxkad/test/stress.c index 6f83311..eb57840 100644 --- a/src/rxkad/test/stress.c +++ b/src/rxkad/test/stress.c @@ -154,7 +154,7 @@ CommandProc(as, arock) /* These options not compatible with -server */ if (cParms->stopServer) { code = RXKST_BADARGS; - com_err(whoami, code, "stop server not compatible with -client"); + afs_com_err(whoami, code, "stop server not compatible with -client"); return code; } @@ -176,7 +176,7 @@ CommandProc(as, arock) code = pthread_attr_init(&tattr); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "can't pthread_attr_init server process"); return code; } @@ -184,7 +184,7 @@ CommandProc(as, arock) code = pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "can't pthread_attr_setdetachstate server process"); return code; } @@ -199,7 +199,7 @@ CommandProc(as, arock) (opaque) sParms, "Server Process", &pid); #endif if (code) { - com_err(whoami, code, "can't create server process"); + afs_com_err(whoami, code, "can't create server process"); return code; } } else { @@ -258,7 +258,7 @@ CommandProc(as, arock) code = rxkst_StartClient(cParms); if (code) { - com_err(whoami, code, "StartClient returned"); + afs_com_err(whoami, code, "StartClient returned"); return code; } } else { @@ -266,7 +266,7 @@ CommandProc(as, arock) || as->parms[aFASTCALLS].items || as->parms[aSLOWCALLS].items || as->parms[aCOPIOUSCALLS].items) { code = RXKST_BADARGS; - com_err(whoami, code, + afs_com_err(whoami, code, "send/recv len and # calls are client options"); return code; } @@ -299,14 +299,14 @@ main(argc, argv) code = rx_Init(0); rx_SetRxDeadTime(120); if (code < 0) { - com_err(whoami, code, "can't init Rx"); + afs_com_err(whoami, code, "can't init Rx"); exit(1); } #ifndef AFS_PTHREAD_ENV initialProcess = 0; code = LWP_CurrentProcess(&initialProcess); if (code) { - com_err(whoami, code, "LWP initialization failed"); + afs_com_err(whoami, code, "LWP initialization failed"); exit(1); } #endif diff --git a/src/rxkad/test/stress_c.c b/src/rxkad/test/stress_c.c index 008ffaa..0b41a53 100644 --- a/src/rxkad/test/stress_c.c +++ b/src/rxkad/test/stress_c.c @@ -318,7 +318,7 @@ CallSimultaneously(threads, rock, proc) code = pthread_attr_init(&tattr); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "can't pthread_attr_init worker process"); return code; } @@ -326,7 +326,7 @@ CallSimultaneously(threads, rock, proc) code = pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "can't pthread_attr_setdetachstate worker process"); return code; } @@ -339,7 +339,7 @@ CallSimultaneously(threads, rock, proc) (opaque) w, "Worker Process", &pid); #endif if (code) { - com_err(whoami, code, "can't create worker process"); + afs_com_err(whoami, code, "can't create worker process"); return code; } } @@ -428,7 +428,7 @@ RunLoadTest(parms, conn) start = ftime(); code = CallSimultaneously(parms->threads, &c, DoClient); if (code) { - com_err(whoami, code, "in DoClient"); + afs_com_err(whoami, code, "in DoClient"); return code; } interval = ftime() - start; @@ -611,10 +611,10 @@ MakeMultiChannelCall(conn, each, expectedCode, codes) code = CallSimultaneously(RX_MAXCALLS, &mc, UniChannelCall); if (((expectedCode == RXKST_INCFAILED) || (expectedCode == -1)) && ((code == expectedCode) || (code == -3))); /* strange cases */ else if (code != expectedCode) { - com_err(whoami, code, + afs_com_err(whoami, code, "problem making multichannel call, expected '%s'", ((expectedCode == 0) - ? "no error" : (char *)error_message(expectedCode))); + ? "no error" : (char *)afs_error_message(expectedCode))); } return code; } @@ -646,14 +646,14 @@ CheckCallFailure(conn, codes, code, msg) someZero++; fprintf(stderr, " %d no error\n", i); } else - fprintf(stderr, " %d %s\n", i, error_message(codes[i])); + fprintf(stderr, " %d %s\n", i, afs_error_message(codes[i])); } if (someZero) { char buf[100]; sprintf(buf, "connection dead following %s", msg); code = FastCall(conn); if (code) - com_err(whoami, code, buf); + afs_com_err(whoami, code, buf); } } } @@ -674,7 +674,7 @@ RunCallTest(parms, host, sc, si) #ifndef rx_GetPacketCksum code = RXKST_BADARGS; - com_err(whoami, code, + afs_com_err(whoami, code, "Older versions of Rx don't support Get/Set callNumber Vector procedures: can't run this CallTest"); return code; @@ -1049,7 +1049,7 @@ RunHijackTest(parms, host, sc, si) #ifndef rx_GetPacketCksum code = RXKST_BADARGS; - com_err(whoami, code, + afs_com_err(whoami, code, "Older versions of Rx don't export packet tracing routines: can't run this HijackTest"); return code; @@ -1095,7 +1095,7 @@ RunHijackTest(parms, host, sc, si) outgoingOps.op = OO_ZEROCKSUM; code = FastCall(conn); if (code) { - com_err(whoami, code, "doing FastCall with ZEROCKSUM"); + afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM"); return code; } /* The server thinks we're an old style client. Now start sending cksums. @@ -1103,7 +1103,7 @@ RunHijackTest(parms, host, sc, si) outgoingOps.op = OO_NOOP; code = FastCall(conn); if (code) { - com_err(whoami, code, "doing FastCall with non-ZEROCKSUM"); + afs_com_err(whoami, code, "doing FastCall with non-ZEROCKSUM"); return code; } /* The server now thinks we're a new style client, we can't go back now. */ @@ -1112,11 +1112,11 @@ RunHijackTest(parms, host, sc, si) if (code == 0) code = RXKST_NOBADCKSUM; if (code != RXKADSEALEDINCON) { - com_err(whoami, code, "doing FastCall with ZEROCKSUM"); + afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM"); return code; } else if (!conn->error) { code = RXKST_NOCONNERROR; - com_err(whoami, code, "doing FastCall with ZEROCKSUM"); + afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM"); return code; } else code = 0; @@ -1130,11 +1130,11 @@ RunHijackTest(parms, host, sc, si) if (code == 0) code = RXKST_NOBADCKSUM; if (code != RXKADSEALEDINCON) { - com_err(whoami, code, "doing FastCall with ZEROCKSUM"); + afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM"); return code; } else if (!conn->error) { code = RXKST_NOCONNERROR; - com_err(whoami, code, "doing FastCall with ZEROCKSUM"); + afs_com_err(whoami, code, "doing FastCall with ZEROCKSUM"); return code; } else code = 0; @@ -1172,7 +1172,7 @@ RunHijackTest(parms, host, sc, si) if (outgoingOps.counts[RX_PACKET_TYPE_RESPONSE] > 0) { oracle: code = RXKST_CHALLENGEORACLE; - com_err(whoami, code, "misdirecting challenge"); + afs_com_err(whoami, code, "misdirecting challenge"); return code; } code = FastCall(otherConn); /* generate some activity here */ @@ -1206,14 +1206,14 @@ RunHijackTest(parms, host, sc, si) code = pthread_attr_init(&tattr); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "can't pthread_attr_init slow call process"); return code; } code = pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED); if (code) { - com_err(whoami, code, + afs_com_err(whoami, code, "can't pthread_attr_setdetachstate slow call process"); return code; } @@ -1226,7 +1226,7 @@ RunHijackTest(parms, host, sc, si) (opaque) otherConn, "Slow Call Process", &pid); #endif if (code) { - com_err(whoami, code, "can't create slow call process"); + afs_com_err(whoami, code, "can't create slow call process"); return code; } #ifdef AFS_PTHREAD_ENV @@ -1339,7 +1339,7 @@ rxkst_StartClient(parms) if (conn) { code = RXKST_Kill(conn); if (code) { - com_err(whoami, code, "trying to stop server"); + afs_com_err(whoami, code, "trying to stop server"); } rx_DestroyConnection(conn); } else @@ -1357,7 +1357,7 @@ rxkst_StartClient(parms) rxs_Release(sc); rx_Finalize(); if (code) { - com_err(parms->whoami, code, "test fails"); + afs_com_err(parms->whoami, code, "test fails"); exit(13); } else { printf("Test Okay\n"); diff --git a/src/shlibafsrpc/libafsrpc.exp b/src/shlibafsrpc/libafsrpc.exp index b0bfac6..06f1af9 100644 --- a/src/shlibafsrpc/libafsrpc.exp +++ b/src/shlibafsrpc/libafsrpc.exp @@ -84,8 +84,8 @@ rxkad_global_stats_lock rxkad_stats_key _et_list et_list_mutex -com_err -error_message +afs_com_err +afs_error_message rx_socket des_pcbc_init rx_BusyError diff --git a/src/shlibafsrpc/libafsrpc.map b/src/shlibafsrpc/libafsrpc.map index e791b5f..f69ce14 100644 --- a/src/shlibafsrpc/libafsrpc.map +++ b/src/shlibafsrpc/libafsrpc.map @@ -57,8 +57,8 @@ rxkad_global_stats; rxkad_global_stats_lock; rxkad_stats_key; - com_err; - error_message; + afs_com_err; + afs_error_message; rx_socket; rxevent_debugFile; rx_debugFile; @@ -79,7 +79,7 @@ multi_Select; multi_Init; multi_Finalize_Ignore; - add_to_error_table; + afs_add_to_error_table; xdr_afsUUID; xdr_afs_int32; xdr_afs_uint32; diff --git a/src/tests/afscp.c b/src/tests/afscp.c index d63da62..d974e2d 100644 --- a/src/tests/afscp.c +++ b/src/tests/afscp.c @@ -351,12 +351,12 @@ main(int argc, char **argv) dfd = open(destpath, O_RDWR | O_TRUNC, 0666); if (dfd < 0) { fprintf(stderr, "Cannot open %s (%s)\n", destpath, - error_message(errno)); + afs_error_message(errno)); goto Fail_dconn; } } else if (dfd < 0) { fprintf(stderr, "Cannot open %s (%s)\n", destpath, - error_message(errno)); + afs_error_message(errno)); goto Fail_dconn; } } else { @@ -372,7 +372,7 @@ main(int argc, char **argv) code = 0; } else { printf("Cannot create %s (%s)\n", destpath, - error_message(code)); + afs_error_message(code)); if (code) goto Fail_dconn; } @@ -383,19 +383,19 @@ main(int argc, char **argv) sfd = open(srcf, O_RDONLY, 0); if (sfd < 0) { fprintf(stderr, "Cannot open %s (%s)\n", srcf, - error_message(errno)); + afs_error_message(errno)); goto Fail_dconn; } if (fstat(sfd, &statbuf) < 0) { fprintf(stderr, "Cannot stat %s (%s)\n", srcf, - error_message(errno)); + afs_error_message(errno)); close(sfd); goto Fail_dconn; } } else { if ((code = RXAFS_FetchStatus(sconn, &sf, &fst, &scb, &vs))) { printf("Cannot fetchstatus of %d.%d (%s)\n", sf.Volume, sf.Vnode, - error_message(code)); + afs_error_message(code)); goto Fail_dconn; } } @@ -420,7 +420,7 @@ main(int argc, char **argv) if (!slcl) { if ((code = StartRXAFS_FetchData(scall, &sf, 0, filesz))) { printf("Unable to fetch data from %s (%s)\n", srcf, - error_message(code)); + afs_error_message(code)); goto Fail_call; } } @@ -441,7 +441,7 @@ main(int argc, char **argv) if ((code = StartRXAFS_StoreData(dcall, &df, &sst, 0, filesz, filesz))) { printf("Unable to store data to %s (%s)\n", destpath, - error_message(code)); + afs_error_message(code)); goto Fail_call; } } @@ -500,7 +500,7 @@ main(int argc, char **argv) fetchcode = rx_EndCall(scall, fetchcode); } if (fetchcode && printcallerrs) - printf("Error returned from fetch: %s\n", error_message(fetchcode)); + printf("Error returned from fetch: %s\n", afs_error_message(fetchcode)); if (dlcl) { if (close(dfd) && !storecode) @@ -509,7 +509,7 @@ main(int argc, char **argv) storecode = rx_EndCall(dcall, storecode); } if (storecode && printcallerrs) - printf("Error returned from store: %s\n", error_message(storecode)); + printf("Error returned from store: %s\n", afs_error_message(storecode)); gettimeofday(&finish, &tz); @@ -521,7 +521,7 @@ main(int argc, char **argv) scb.CallBackType = CB_DROPPED; if ((code = RXAFS_GiveUpCallBacks(sconn, &theFids, &theCBs))) printf("Could not give up source callback: %s\n", - error_message(code)); + afs_error_message(code)); } if (!dlcl) { @@ -532,7 +532,7 @@ main(int argc, char **argv) dcb.CallBackType = CB_DROPPED; if ((code = RXAFS_GiveUpCallBacks(dconn, &theFids, &theCBs))) printf("Could not give up target callback: %s\n", - error_message(code)); + afs_error_message(code)); } if (code == 0) diff --git a/src/tests/afsdump_dirlist.c b/src/tests/afsdump_dirlist.c index 020c387..3dced00 100644 --- a/src/tests/afsdump_dirlist.c +++ b/src/tests/afsdump_dirlist.c @@ -114,7 +114,7 @@ my_error_cb(afs_uint32 code, int fatal, void *ref, char *msg, ...) error_count++; if (!quiet) { va_start(alist, msg); - com_err_va(argv0, code, msg, alist); + afs_com_err_va(argv0, code, msg, alist); va_end(alist); } } @@ -137,7 +137,7 @@ main(int argc, char **argv) initialize_xFil_error_table(); r = xfopen(&input_file, O_RDONLY, input_path); if (r) { - com_err(argv0, r, "opening %s", input_path); + afs_com_err(argv0, r, "opening %s", input_path); exit(2); } @@ -153,6 +153,6 @@ main(int argc, char **argv) if (verbose && error_count) fprintf(stderr, "*** %d errors\n", error_count); if (r && !quiet) - fprintf(stderr, "*** FAILED: %s\n", error_message(r)); + fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r)); exit(0); } diff --git a/src/tests/afsdump_extract.c b/src/tests/afsdump_extract.c index 8df473f..f900d91 100644 --- a/src/tests/afsdump_extract.c +++ b/src/tests/afsdump_extract.c @@ -320,7 +320,7 @@ my_error_cb(afs_uint32 code, int fatal, void *ref, char *msg, ...) error_count++; if (!quiet) { va_start(alist, msg); - com_err_va(argv0, code, msg, alist); + afs_com_err_va(argv0, code, msg, alist); va_end(alist); } } @@ -547,7 +547,7 @@ main(int argc, char **argv) initialize_xFil_error_table(); r = xfopen(&input_file, O_RDONLY, input_path); if (r) { - com_err(argv0, r, "opening %s", input_path); + afs_com_err(argv0, r, "opening %s", input_path); exit(2); } @@ -568,7 +568,7 @@ main(int argc, char **argv) if ((r = xftell(&input_file, &where)) || (r = Path_PreScan(&input_file, &phi, 1)) || (r = xfseek(&input_file, &where))) { - com_err(argv0, r, "- path initialization failed"); + afs_com_err(argv0, r, "- path initialization failed"); xfclose(&input_file); exit(1); } @@ -596,6 +596,6 @@ main(int argc, char **argv) if (verbose && error_count) fprintf(stderr, "*** %d errors\n", error_count); if (r && !quiet) - fprintf(stderr, "*** FAILED: %s\n", error_message(r)); + fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r)); exit(0); } diff --git a/src/tests/afsdump_scan.c b/src/tests/afsdump_scan.c index 9f2557a..0127a5e 100644 --- a/src/tests/afsdump_scan.c +++ b/src/tests/afsdump_scan.c @@ -223,7 +223,7 @@ my_error_cb(afs_uint32 code, int fatal, void *ref, char *msg, ...) error_count++; if (!quiet) { va_start(alist, msg); - com_err_va(argv0, code, msg, alist); + afs_com_err_va(argv0, code, msg, alist); va_end(alist); } } @@ -290,7 +290,7 @@ main(int argc, char **argv) initialize_xFil_error_table(); r = xfopen(&input_file, O_RDONLY, input_path); if (r) { - com_err(argv0, r, "opening %s", input_path); + afs_com_err(argv0, r, "opening %s", input_path); exit(2); } @@ -311,7 +311,7 @@ main(int argc, char **argv) } if (gendump_path && (r = setup_repair())) { - com_err(argv0, r, "setting up repair output"); + afs_com_err(argv0, r, "setting up repair output"); xfclose(&input_file); exit(2); } @@ -326,7 +326,7 @@ main(int argc, char **argv) if ((r = xftell(&input_file, &where)) || (r = Path_PreScan(&input_file, &phi, 0)) || (r = xfseek(&input_file, &where))) { - com_err(argv0, r, "- path initialization failed"); + afs_com_err(argv0, r, "- path initialization failed"); xfclose(&input_file); exit(2); } @@ -353,6 +353,6 @@ main(int argc, char **argv) if (verbose && error_count) fprintf(stderr, "*** %d errors\n", error_count); if (r && !quiet) - fprintf(stderr, "*** FAILED: %s\n", error_message(r)); + fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r)); exit(0); } diff --git a/src/tests/afsdump_xsed.c b/src/tests/afsdump_xsed.c index acdadaa..402fa13 100644 --- a/src/tests/afsdump_xsed.c +++ b/src/tests/afsdump_xsed.c @@ -229,7 +229,7 @@ my_error_cb(afs_uint32 code, int fatal, void *ref, char *msg, ...) error_count++; if (!quiet) { va_start(alist, msg); - com_err_va(argv0, code, msg, alist); + afs_com_err_va(argv0, code, msg, alist); va_end(alist); } } @@ -335,7 +335,7 @@ main(int argc, char **argv) initialize_AVds_error_table(); r = xfopen(&X, input_path, O_RDONLY, 0); if (r) { - com_err(argv0, r, "opening %s", input_path); + afs_com_err(argv0, r, "opening %s", input_path); exit(2); } @@ -356,7 +356,7 @@ main(int argc, char **argv) } if (gendump_path && (r = setup_repair())) { - com_err(argv0, r, "setting up repair output"); + afs_com_err(argv0, r, "setting up repair output"); xfclose(X); exit(2); } @@ -371,7 +371,7 @@ main(int argc, char **argv) if ((r = xftell(X, &where)) || (r = Path_PreScan(X, &phi, 0)) || (r = xfseek(X, &where))) { - com_err(argv0, r, "- path initialization failed"); + afs_com_err(argv0, r, "- path initialization failed"); xfclose(X); exit(2); } @@ -401,6 +401,6 @@ main(int argc, char **argv) if (verbose && error_count) fprintf(stderr, "*** %d errors\n", error_count); if (r && !quiet) - fprintf(stderr, "*** FAILED: %s\n", error_message(r)); + fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r)); exit(0); } diff --git a/src/tests/null-search.c b/src/tests/null-search.c index 0b5f016..519c9ef 100644 --- a/src/tests/null-search.c +++ b/src/tests/null-search.c @@ -71,7 +71,7 @@ my_error_cb(afs_uint32 code, int fatal, void *ref, char *msg, ...) error_count++; if (!quiet) { va_start(alist, msg); - com_err_va(argv0, code, msg, alist); + afs_com_err_va(argv0, code, msg, alist); va_end(alist); } } @@ -139,7 +139,7 @@ main(int argc, char **argv) initialize_xFil_error_table(); r = xfopen(&input_file, O_RDONLY, input_path); if (r) { - com_err(argv0, r, "opening %s", input_path); + afs_com_err(argv0, r, "opening %s", input_path); exit(2); } @@ -156,7 +156,7 @@ main(int argc, char **argv) if ((r = xftell(&input_file, &where)) || (r = Path_PreScan(&input_file, &phi, 0)) || (r = xfseek(&input_file, &where))) { - com_err(argv0, r, "- path initialization failed"); + afs_com_err(argv0, r, "- path initialization failed"); xfclose(&input_file); exit(2); } @@ -171,5 +171,5 @@ main(int argc, char **argv) if (bad_count) printf("*** %d bad files\n", bad_count); if (r && !quiet) - printf("*** FAILED: %s\n", error_message(r)); + printf("*** FAILED: %s\n", afs_error_message(r)); } diff --git a/src/update/client.c b/src/update/client.c index 9a5cdd4..b176aac 100644 --- a/src/update/client.c +++ b/src/update/client.c @@ -218,7 +218,7 @@ main(int argc, char **argv) errcode = rx_Init(0); if (errcode) { printf("Rx initialize failed \n"); - com_err(whoami, errcode, "calling Rx init"); + afs_com_err(whoami, errcode, "calling Rx init"); exit(1); } @@ -238,7 +238,7 @@ main(int argc, char **argv) exit(1); } if (errcode) { - com_err(whoami, errcode, "Couldn't get security obect for localAuth"); + afs_com_err(whoami, errcode, "Couldn't get security obect for localAuth"); exit(1); } @@ -260,7 +260,7 @@ main(int argc, char **argv) /* construct local path from canonical (wire-format) path */ if ((errcode = ConstructLocalPath(df->name, "/", &curDir))) { - com_err(whoami, errcode, "Unable to construct local path"); + afs_com_err(whoami, errcode, "Unable to construct local path"); return errcode; } @@ -271,7 +271,7 @@ main(int argc, char **argv) #else if (mkdir(curDir, 0700) < 0) { #endif - com_err(whoami, errno, "can't create dir"); + afs_com_err(whoami, errno, "can't create dir"); printf("upclient: Can't update dir %s\n", curDir); return -1; } @@ -290,14 +290,14 @@ main(int argc, char **argv) error = rx_EndCall(call, 0); if (error && !errcode) { printf("could not end rx call \n"); - com_err(whoami, error, "calling EndCall"); + afs_com_err(whoami, error, "calling EndCall"); goto fail; } if (errcode) { printf ("warning: could not fetch the contents of directory %s \n", df->name); - com_err(whoami, errcode, "calling FetchFile"); + afs_com_err(whoami, errcode, "calling FetchFile"); cnt++; goto fail; } @@ -305,7 +305,7 @@ main(int argc, char **argv) stream = fopen(dirbuf, "r"); if (stream == NULL) { printf("fopen failed on %s \n", dirbuf); - com_err(whoami, errno, "fopen"); + afs_com_err(whoami, errno, "fopen"); goto fail; } umask(00); @@ -354,7 +354,7 @@ main(int argc, char **argv) dirp = opendir(curDir); if (dirp == 0) { - com_err(whoami, errno, "Can't open local dir %s", curDir); + afs_com_err(whoami, errno, "Can't open local dir %s", curDir); goto fail; } @@ -373,7 +373,7 @@ main(int argc, char **argv) errcode = unlink(filename); if (errcode) { printf("could not delete file %s \n", filename); - com_err(whoami, errno, "could not delete file %s", + afs_com_err(whoami, errno, "could not delete file %s", filename); } } @@ -415,7 +415,7 @@ IsCompatible(char *filename, afs_int32 time, afs_int32 length) /* construct a local path from canonical (wire-format) path */ if ((error = ConstructLocalPath(filename, "/", &localname))) { - com_err(whoami, error, "Unable to construct local path"); + afs_com_err(whoami, error, "Unable to construct local path"); return error; } @@ -448,12 +448,12 @@ FetchFile(struct rx_call *call, char *remoteFile, char *localFile, int dirFlag) fd = open(localFile, O_CREAT | O_TRUNC | O_WRONLY, 0666); if (fd < 0) { printf("Could not create %s\n", localFile); - com_err(whoami, errno, "Could not create %s", localFile); + afs_com_err(whoami, errno, "Could not create %s", localFile); error = UPDATE_ERROR; return error; } if (fstat(fd, &status) < 0) { - com_err(whoami, errno, "Could not stat %s", localFile); + afs_com_err(whoami, errno, "Could not stat %s", localFile); close(fd); printf("could not stast %s\n", localFile); return UPDATE_ERROR; @@ -503,7 +503,7 @@ update_ReceiveFile(register int fd, register struct rx_call *call, register stru if (!nbytes) error = UPDATE_ERROR; if (write(fd, buffer, nbytes) != nbytes) { - com_err(whoami, errno, "File system write failed!"); + afs_com_err(whoami, errno, "File system write failed!"); printf("File system write failed!\n"); error = UPDATE_ERROR; } @@ -586,7 +586,7 @@ NotOnHost(char *filename, struct filestr *okhostfiles) for (tf = okhostfiles; tf; tf = tf->next) { /* construct local path from canonical (wire-format) path */ if ((rc = ConstructLocalPath(tf->name, "/", &hostfile))) { - com_err(whoami, rc, "Unable to construct local path"); + afs_com_err(whoami, rc, "Unable to construct local path"); return -1; } if (PathsAreEquivalent(hostfile, filename)) { @@ -613,7 +613,7 @@ RenameNewFiles(struct filestr *modFiles) for (tf = modFiles; tf; tf = tf->next) { /* construct local path from canonical (wire-format) path */ if ((errcode = ConstructLocalPath(tf->name, "/", &fname))) { - com_err(whoami, errcode, "Unable to construct local path"); + afs_com_err(whoami, errcode, "Unable to construct local path"); return errcode; } strcpy(newname, fname); @@ -623,7 +623,7 @@ RenameNewFiles(struct filestr *modFiles) errcode = renamefile(newname, fname); if (errcode) { printf("could not rename %s to %s\n", newname, fname); - com_err(whoami, errno, "could not rename %s to %s", newname, + afs_com_err(whoami, errno, "could not rename %s to %s", newname, fname); } free(fname); @@ -664,7 +664,7 @@ GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ /* construct local path from canonical (wire-format) path */ errcode = ConstructLocalPath(filename, "/", &lfile); if (errcode) { - com_err(whoami, errcode, "Unable to construct local path"); + afs_com_err(whoami, errcode, "Unable to construct local path"); return -1; } strcpy(newfile, lfile); @@ -681,7 +681,7 @@ GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ if (errcode) { printf("failed to fetch file %s \n", filename); - com_err(whoami, errcode, "fetching file"); + afs_com_err(whoami, errcode, "fetching file"); return 1; } @@ -690,7 +690,7 @@ GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ if (errcode) { printf("could not change protection on %s to %u\n", newfile, (unsigned int)mode); - com_err(whoami, errno, "could not change protection on %s to %u", + afs_com_err(whoami, errno, "could not change protection on %s to %u", newfile, mode); return 1; } @@ -703,7 +703,7 @@ GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ if (errcode) { printf("warning: could not change uid and gid on %s to %u and %u \n", newfile, gid, uid); - com_err(whoami, errno, + afs_com_err(whoami, errno, "warning: could not change uid and gid on %s to %u and %u", newfile, gid, uid); } @@ -716,7 +716,7 @@ GetFileFromUpServer(struct rx_connection *conn, /* handle for upserver */ if (errcode) { printf("could not change access and modify times on %s to %u %u\n", newfile, (unsigned int)atime, (unsigned int)mtime); - com_err(whoami, errno, + afs_com_err(whoami, errno, "could not change access and modify times on %s to %u %u", newfile, atime, mtime); return 1; diff --git a/src/update/server.c b/src/update/server.c index 7c2c958..a0689c8 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -50,6 +50,7 @@ RCSID #include #include #include +#include #ifdef AFS_AIX_ENV #include #endif @@ -352,7 +353,7 @@ UPDATE_FetchFile(struct rx_call *call, char *name) /* construct a local path from a canonical (wire-format) path */ if ((error = ConstructLocalPath(name, "/", &reqObject))) { - com_err(whoami, error, "Unable to construct local path"); + afs_com_err(whoami, error, "Unable to construct local path"); return UPDATE_ERROR; } @@ -384,7 +385,7 @@ UPDATE_FetchInfo(struct rx_call *call, char *name) /* construct a local path from a canonical (wire-format) path */ if ((error = ConstructLocalPath(name, "/", &reqObject))) { - com_err(whoami, error, "Unable to construct local path"); + afs_com_err(whoami, error, "Unable to construct local path"); return UPDATE_ERROR; } @@ -559,14 +560,14 @@ AddObject(char **expPath, char *dir) /* construct a local path from a canonical (wire-format) path */ if ((error = ConstructLocalPath(dir, "/", expPath))) { - com_err(whoami, error, "Unable to construct local path"); + afs_com_err(whoami, error, "Unable to construct local path"); return error; } /* stat the object */ error = stat(*expPath, &statbuf); if (error) { - com_err(whoami, error, ";Can't stat object."); + afs_com_err(whoami, error, ";Can't stat object."); return error; } /* now check if the object has an exportable (file/dir) type */ diff --git a/src/uss/uss_acl.c b/src/uss/uss_acl.c index 19d6f31..0073707 100644 --- a/src/uss/uss_acl.c +++ b/src/uss/uss_acl.c @@ -604,7 +604,7 @@ uss_acl_SetAccess(a_access, a_clear, a_negative) */ code = uss_fs_GetACL(path_field, tmp_str, MAXSIZE); if (code) { - com_err(uss_whoami, code, "while getting access list for %s", + afs_com_err(uss_whoami, code, "while getting access list for %s", path_field); #ifdef USS_ACL_DB printf("%s: Error code from uss_fs_GetACL %d, errno %d\n", rn, code, @@ -674,7 +674,7 @@ uss_acl_SetAccess(a_access, a_clear, a_negative) printf("\t3. Non-existent user or group on ACL.\n"); return (code); } else { - com_err(uss_whoami, code, "while setting the access list"); + afs_com_err(uss_whoami, code, "while setting the access list"); return (code); } } @@ -724,7 +724,7 @@ uss_acl_SetDiskQuota(a_path, a_q) code = uss_fs_SetVolStat(a_path, tmp_str, sizeof(*status) + 3); if (code) { - com_err(uss_whoami, code, "while setting disk quota"); + afs_com_err(uss_whoami, code, "while setting disk quota"); #ifdef USS_ACL_DB printf("%s: uss_fs_SetVolStat() error code: %d, errno is %d\n", rn, code, errno); diff --git a/src/uss/uss_kauth.c b/src/uss/uss_kauth.c index 56886d8..cd82d33 100644 --- a/src/uss/uss_kauth.c +++ b/src/uss/uss_kauth.c @@ -205,7 +205,7 @@ InitThisModule() sizeof(longPassBuff), /*Size of above */ &reasonString); if (code) { - com_err(uss_whoami, code, "while getting password "); + afs_com_err(uss_whoami, code, "while getting password "); #ifdef USS_KAUTH_DB printf("%s: Error code from ka_UserReadPassword(): %d\n", rn, code); @@ -226,7 +226,7 @@ InitThisModule() * to truncate the password to generate the appropriate * key. */ - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while getting administrator token (trying shortened password next...)"); #ifdef USS_KAUTH_DB printf("%s: Error code from ka_GetAdminToken: %d\n", rn, @@ -240,7 +240,7 @@ InitThisModule() uss_Cell, &key, 24 * 60 * 60, &token, 0 /*new */ ); if (code) { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while getting administrator token (possibly wrong password, or not an administrative account)"); #ifdef USS_KAUTH_DB printf("%s: Error code from ka_GetAdminToken: %d\n", rn, @@ -262,7 +262,7 @@ InitThisModule() * We failed to get an admin token, but the password is * of a reasonable length, so we're just hosed. */ - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while getting administrator token (possibly wrong password, or not an administrative account)"); #ifdef USS_KAUTH_DB printf("%s: Error code from ka_GetAdminToken: %d\n", rn, @@ -291,7 +291,7 @@ InitThisModule() ka_AuthServerConn(uss_Cell, KA_MAINTENANCE_SERVICE, &token, &uconn_kauthP); if (code) { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while establishing Authentication Server connection"); #ifdef USS_KAUTH_DB printf("%s: Error code from ka_AuthServerConn: %d\n", rn, code); @@ -399,7 +399,7 @@ uss_kauth_AddUser(a_user, a_passwd) "%s: Warning: User '%s' already in Authentication DB\n", uss_whoami, a_user); } else { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while adding user '%s' to Authentication DB", a_user); #ifdef USS_KAUTH_DB @@ -481,7 +481,7 @@ uss_kauth_DelUser(a_user) uss_whoami, a_user); return (0); } else { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while deleting entry in Authentication DB\n"); #ifdef USS_KAUTH_DB printf("%s: Error code from KAM_DeleteUser: %d\n", rn, code); @@ -712,7 +712,7 @@ uss_kauth_SetFields(username, expirestring, reuse, failures, lockout) "Must specify one of the optional parameters. Continuing...\n"); if (code) { - com_err(uss_whoami, code, "calling KAM_SetFields for %s.%s", + afs_com_err(uss_whoami, code, "calling KAM_SetFields for %s.%s", username, instance); return (code); diff --git a/src/uss/uss_ptserver.c b/src/uss/uss_ptserver.c index 98c47c8..901ac63 100644 --- a/src/uss/uss_ptserver.c +++ b/src/uss/uss_ptserver.c @@ -90,7 +90,7 @@ InitThisModule() uss_ConfDir, /*Config directory */ uss_Cell); /*Cell to touch */ if (code) { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while initializing Protection Server library"); return (code); } @@ -176,7 +176,7 @@ uss_ptserver_AddUser(a_user, a_uid) */ mappedUserID = id; if (code = pr_SNameToId(a_user, &mappedUserID)) { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while getting uid from Protection Server"); return (code); } @@ -198,7 +198,7 @@ uss_ptserver_AddUser(a_user, a_uid) /* * Got a fatal error. */ - com_err(uss_whoami, code, "while accessing Protection Server"); + afs_com_err(uss_whoami, code, "while accessing Protection Server"); return (code); } } @@ -268,7 +268,7 @@ uss_ptserver_DelUser(a_name) uss_whoami, a_name); } /*User not registered */ else { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while deleting user from Protection DB"); return (code); } /*Fatal PTS error */ @@ -326,7 +326,7 @@ uss_ptserver_XlateUser(a_user, a_uidP) *a_uidP = 0; code = pr_SNameToId(a_user, a_uidP); if (code) { - com_err(uss_whoami, code, "while getting uid from Protection DB"); + afs_com_err(uss_whoami, code, "while getting uid from Protection DB"); return (code); } if (*a_uidP == ANONYMOUSID) { diff --git a/src/uss/uss_vol.c b/src/uss/uss_vol.c index e71b740..b20ba4d 100644 --- a/src/uss/uss_vol.c +++ b/src/uss/uss_vol.c @@ -739,7 +739,7 @@ uss_vol_CreateVol(a_volname, a_server, a_partition, a_quota, a_mpoint, if (!initDone) { code = InitThisModule(NoAuthFlag, uss_ConfDir, uss_Cell); if (code) { - com_err(uss_whoami, code, + afs_com_err(uss_whoami, code, "while inititializing VLDB connection(s)\n"); return (code); } diff --git a/src/venus/cmdebug.c b/src/venus/cmdebug.c index 806e77e..d22ab73 100644 --- a/src/venus/cmdebug.c +++ b/src/venus/cmdebug.c @@ -58,7 +58,7 @@ PrintCacheConfig(struct rx_connection *aconn) code = RXAFSCB_GetCacheConfig(aconn, 1, &srv_ver, &conflen, &c); if (code) { printf("cmdebug: error checking cache config: %s\n", - error_message(code)); + afs_error_message(code)); return 0; } @@ -113,7 +113,7 @@ PrintInterfaces(struct rx_connection *aconn) code = RXAFSCB_WhoAreYou(aconn, &addr); if (code) { printf("cmdebug: error checking interfaces: %s\n", - error_message(code)); + afs_error_message(code)); return 0; } @@ -204,7 +204,7 @@ PrintLocks(register struct rx_connection *aconn, int aint32) break; /* otherwise we have an unrecognized error */ printf("cmdebug: error checking locks: %s\n", - error_message(code)); + afs_error_message(code)); return code; } /* here we have the lock information, so display it, perhaps */ @@ -275,7 +275,7 @@ PrintCacheEntries32(struct rx_connection *aconn, int aint32) if (code == 1) break; printf("cmdebug: failed to get cache entry %d (%s)\n", i, - error_message(code)); + afs_error_message(code)); return code; } @@ -367,7 +367,7 @@ PrintCacheEntries64(struct rx_connection *aconn, int aint32) if (code == 1) break; printf("cmdebug: failed to get cache entry %d (%s)\n", i, - error_message(code)); + afs_error_message(code)); return code; } diff --git a/src/venus/dedebug.c b/src/venus/dedebug.c index a0204fd..14ff024 100644 --- a/src/venus/dedebug.c +++ b/src/venus/dedebug.c @@ -41,7 +41,7 @@ static PrintCacheEntries(struct rx_connection *aconn, int aint32) if (code) { if (code == 1) break; printf("cmdebug: failed to get cache entry %d (%s)\n", i, - error_message(code)); + afs_error_message(code)); return code; } diff --git a/src/venus/fs.c b/src/venus/fs.c index 96d7bb1..8d9abfd 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -3668,7 +3668,7 @@ Die(int errnum, char *filename) fprintf(stderr, "%s:'%s'", pn, filename); else fprintf(stderr, "%s", pn); - fprintf(stderr, ": %s\n", error_message(errnum)); + fprintf(stderr, ": %s\n", afs_error_message(errnum)); break; } } diff --git a/src/venus/livesys.c b/src/venus/livesys.c index ba09900..ea121e7 100644 --- a/src/venus/livesys.c +++ b/src/venus/livesys.c @@ -72,7 +72,7 @@ main(argc, argv) memcpy(space, &setp, sizeof(afs_int32)); code = pioctl(0, VIOC_AFS_SYSNAME, &blob, 1); if (code) { - fprintf(stderr, "livesys: %s\n", error_message(code)); + fprintf(stderr, "livesys: %s\n", afs_error_message(code)); return 1; } input = space; diff --git a/src/venus/twiddle.c b/src/venus/twiddle.c index 3657f58..a75abf3 100644 --- a/src/venus/twiddle.c +++ b/src/venus/twiddle.c @@ -205,6 +205,6 @@ Die(code, filename) fprintf(stderr, "%s:'%s'", pn, filename); else fprintf(stderr, "%s", pn); - fprintf(stderr, ": %s\n", error_message(errno)); + fprintf(stderr, ": %s\n", afs_error_message(errno)); } } /*Die */ diff --git a/src/venus/whatfid.c b/src/venus/whatfid.c index beef331..ab1977c 100644 --- a/src/venus/whatfid.c +++ b/src/venus/whatfid.c @@ -148,6 +148,6 @@ PioctlError(code, filename) fprintf(stderr, "%s:'%s'", pn, filename); else fprintf(stderr, "%s", pn); - fprintf(stderr, ": %s\n", error_message(errno)); + fprintf(stderr, ": %s\n", afs_error_message(errno)); } } /*Die */ diff --git a/src/viced/host.c b/src/viced/host.c index d156f7b..c4b0c10 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -55,6 +55,7 @@ RCSID #include #include #include +#include #include #include #include @@ -321,7 +322,7 @@ hpr_Initialize(struct ubik_client **uclient) if ((afsconf_GetLatestKey(tdir, 0, 0) == 0)) { code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex); if (code) - ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, error_message(code))); + ViceLog(0, ("hpr_Initialize: clientauthsecure returns %d %s (so trying noauth)", code, afs_error_message(code))); if (code) scIndex = 0; /* use noauth */ if (scIndex != 2) diff --git a/src/volser/common.c b/src/volser/common.c index 30b536a..f7a8a17 100644 --- a/src/volser/common.c +++ b/src/volser/common.c @@ -33,7 +33,7 @@ void LogError(afs_int32 errcode) { ViceLog(0, - ("%s: %s\n", error_table_name(errcode), error_message(errcode))); + ("%s: %s\n", afs_error_table_name(errcode), afs_error_message(errcode))); } #ifndef AFS_PTHREAD_ENV diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 5e5a38e..2772697 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -398,8 +398,8 @@ PrintError(char *msg, afs_int32 errcode) initialize_VL_error_table(); offset = errcode & ((1 << ERRCODE_RANGE) - 1); - fprintf(STDERR, "%s: %s\n", error_table_name(errcode), - error_message(errcode)); + fprintf(STDERR, "%s: %s\n", afs_error_table_name(errcode), + afs_error_message(errcode)); break; } } -- 1.9.4