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;
}
}
}
fprintf(stderr,
"File::setAttributes(): uafs_stat failed for %s (%s)\n",
- dirName, error_message(errno));
+ dirName, afs_error_message(errno));
return JNI_FALSE;
}
}
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;
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");
}
}
#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*/
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");
}
}
#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*/
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;
}
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;
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;
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;
}
}
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);
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;
}
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;
}
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;
}
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;
}
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);
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;
}
}
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 = \
#ifndef PRE_AFS35
#include <afs/dirpath.h>
#endif /* !PRE_AFS35 */
+#include <afs/com_err.h>
int
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);
}
exit(status);
}
-#ifndef HAVE_ADD_TO_ERROR_TABLE
-
-#define error_table error_table_compat
-#include <afs/error_table.h>
-#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;
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);
}
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 */
* 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 : "<default>"));
exit(1);
} else
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];
}
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");
}
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;
}
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;
}
done:
if (code)
- com_err("bos", code, "(while reading log)");
+ afs_com_err("bos", code, "(while reading log)");
return code;
}
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);
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;
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);
}
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;
entries[e].serverPartition[ei], &servers,
&ss, &ps);
if (tcode) {
- com_err(whoami, tcode, "");
+ afs_com_err(whoami, tcode, "");
ERROR(tcode);
}
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);
}
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);
}
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 */
entry.serverPartition[foundentry], &servers,
&ss, &ps);
if (code) {
- com_err(whoami, code, "");
+ afs_com_err(whoami, code, "");
return (code);
}
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);
}
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);
}
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;
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);
}
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 (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))
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);
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;
}
}
}
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;
}
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);
}
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) {
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;
}
}
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;
}
}
/* 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);
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 {
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;
}
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);
}
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);
}
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;
}
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 */
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 */
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;
}
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);
}
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);
}
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);
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) {
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);
}
}
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;
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);
}
fclose(fd);
} else {
- com_err(whoami, 0, "-name or -file option required");
+ afs_com_err(whoami, 0, "-name or -file option required");
return (-1);
}
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;
}
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;
}
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);
}
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;
}
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
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;
}
*/
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);
*/
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();
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;
}
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);
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);
* 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) {
/* 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) {
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);
}
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 */
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;
}
*/
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;
}
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;
}
}
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;
}
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);
}
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);
}
&host);
if (code) {
- com_err(whoami, code, "; Unable to verify database");
+ afs_com_err(whoami, code, "; Unable to verify database");
return (-1);
}
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);
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);
}
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);
}
/* 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 */
}
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)
/* 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);
}
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;
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;
}
if (fromTime > toTime) {
- com_err(whoami, 0,
+ afs_com_err(whoami, 0,
"'-from' date/time cannot be later than '-to' date/time");
return (-1);
}
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;
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);
}
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;
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;
}
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);
}
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;
}
}
if (code)
- com_err(whoami, code, "");
+ afs_com_err(whoami, code, "");
return (code);
}
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);
}
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));
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;
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);
}
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;
}
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);
}
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 */
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);
}
(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);
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);
}
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);
}
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);
}
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);
}
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);
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);
}
/* 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;
}
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:
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_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;
}
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:
/* 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);
}
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);
}
/* 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;
}
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");
}
|| (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);
}
}
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);
/* 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);
*/
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);
}
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);
}
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);
}
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;
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;
}
(!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 */
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);
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);
}
}
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;
}
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));
/* 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));
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);
}
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);
}
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);
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));
+ 1);
if (!tle->tapeName) {
free(tle);
- com_err(whoami, BC_NOMEM, "");
+ afs_com_err(whoami, BC_NOMEM, "");
return (BC_NOMEM);
}
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));
+ 1);
if (!ti->volumeName) {
free(ti);
- com_err(whoami, BC_NOMEM, "");
+ afs_com_err(whoami, BC_NOMEM, "");
return (BC_NOMEM);
}
} /* 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);
}
(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));
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;
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
}
if (ctPtr->textVersion != -1) {
- com_err(whoami, 0, "obsolete tapehosts - updating");
+ afs_com_err(whoami, 0, "obsolete tapehosts - updating");
bc_ClearHosts();
}
#include <afs/bubasics.h>
#include <afs/budb_client.h>
#include <afs/budb.h>
+#include <afs/com_err.h>
#include <errno.h>
#include "bc.h"
/* 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;
}
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);
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);
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);
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);
}
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);
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);
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;
*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);
}
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);
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);
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);
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);
}
}
/* 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 */
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;
}
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;
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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");
}
}
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);
}
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");
}
}
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);
}
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);
}
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);
}
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);
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");
}
}
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_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 {
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");
}
}
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);
}
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;
}
}
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);
}
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
*/
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);
}
#include "volser.h"
#include "bc.h"
#include <afs/volint.h>
+#include <afs/com_err.h>
extern char *whoami;
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;
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);
#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);
}
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);
}
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);
}
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);
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)
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);
}
if (rcpid == -1 && errno != EINTR) {
tapemounted = 0;
- com_err(whoami, errno,
+ afs_com_err(whoami, errno,
"Error waiting for callout script to terminate.");
break;
}
}
/* 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");
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");
{ \
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
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;
}
/* 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;
}
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))
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;
}
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 */
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);
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);
}
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);
}
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);
}
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);
}
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;
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);
}
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)
}
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);
}
}
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);
}
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;
fputs(": ", stderr);
}
if (code) {
- fputs(error_message(code), stderr);
+ fputs(afs_error_message(code), stderr);
fputs(" ", stderr);
}
if (fmt) {
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)
}
errf
-reset_com_err_hook(void)
+afs_reset_com_err_hook(void)
{
errf x = com_err_hook;
com_err_hook = default_com_err_proc;
* with this package.
*/
-#ifndef __COM_ERR_H
+#ifndef __AFS_COM_ERR_H
#include <stdarg.h>
-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) */
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);
* Function to initialize the et_list_mutex
*/
-void
+static void
et_mutex_once(void)
{
assert(!pthread_mutex_init
}
const char *
-error_message(afs_int32 code)
+afs_error_message(afs_int32 code)
{
int offset;
struct et_list *et;
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++);
}
void
-add_to_error_table(struct et_list *new_table)
+afs_add_to_error_table(struct et_list *new_table)
{
struct et_list *et;
#include <errno.h>
-#ifndef _ET_H
+#ifndef _AFS_ET_H
struct error_table {
char const *const *msgs;
#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
static char buf[6];
const char *
-error_table_name(afs_int32 num)
+afs_error_table_name(afs_int32 num)
{
int ch;
int i;
/*
- * internal include file for com_err package
+ * internal include file for afs_com_err package
*
*/
#include "mit-sipb-cr.h"
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;
}
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;
}
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;
}
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;
}
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)
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)
}
}
- 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");
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;
}
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;
}
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;
}
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;
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;
}
&& 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),
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
} 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;
}
}
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);
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 */
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: ");
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++)
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);
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;
}
}
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);
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);
else if (strlen(passwd) == 0)
code = KANULLPASSWORD;
if (code) {
- com_err(whoami, code, "reading password");
+ afs_com_err(whoami, code, "reading password");
return code;
}
}
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",
/*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));
}
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;
}
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));
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) {
} 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;
}
}
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;
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) {
} 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 =
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);
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));
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);
}
#include <des.h>
#include <afs/cellconfig.h>
#include <afs/auth.h>
+#include <afs/com_err.h>
#include "kautils.h"
#include "kaserver.h"
#include "kalog.h"
} else {
es_Report
("in get_time: set_password failed because: %s\n",
- error_message(code));
+ afs_error_message(code));
return code;
}
}
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);
}
#include <afs/cellconfig.h>
#include <lock.h>
#include <afs/afsutil.h>
+#include <afs/com_err.h>
#include <ubik.h>
#include <sys/stat.h>
#include "kauth.h"
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
&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;
&clones, dbpath, &KA_dbase);
if (code) {
- com_err(whoami, code, "Ubik init failed");
+ afs_com_err(whoami, code, "Ubik init failed");
exit(2);
}
};
#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)
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))
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;
}
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);
}
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");
}
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
}
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);
}
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;
#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
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));
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);
}
}
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 =
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
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));
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;
}
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;
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))
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;
}
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);
}
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);
}
}
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
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)
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))
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;
}
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);
}
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");
}
&adminConn))
) {
abort:
- com_err(whoami, code, "testing old keys");
+ afs_com_err(whoami, code, "testing old keys");
exit(1);
}
}
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);
}
&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);
}
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);
}
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;
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++) {
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);
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);
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;
&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);
}
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));
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 =
&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);
}
{
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);
}
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);
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();
}
}
}
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);
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;
}
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;
}
else if (strlen(passwd) == 0)
code = KANULLPASSWORD;
if (code) {
- com_err(whoami, code, "reading password");
+ afs_com_err(whoami, code, "reading password");
return code;
}
}
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);
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;
}
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;
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;
}
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;
}
/* 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;
}
/* 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
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)...");
/* 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),
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());
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;
}
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);
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;
}
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;
}
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);
}
}
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)
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) {
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);
}
}
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;
}
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;
}
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;
}
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;
}
/* 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;
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();
/* 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);
}
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);
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;
}
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;
}
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");
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));
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;
}
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;
else if (strlen(passwd) == 0)
code = KANULLPASSWORD;
if (code) {
- com_err(whoami, code, "reading password");
+ afs_com_err(whoami, code, "reading password");
return code;
}
}
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);
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;
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;
}
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;
}
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;
}
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;
}
*reasonP = "Authentication Server was unavailable";
break;
default:
- *reasonP = (char *)error_message(code);
+ *reasonP = (char *)afs_error_message(code);
}
return code;
}
return 0;
if (reasonP) {
- *reasonP = (char *)error_message(code);
+ *reasonP = (char *)afs_error_message(code);
}
return code;
}
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:
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
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
#include <afs/afsutil.h>
#include <ubik.h>
#include <afs/cmd.h>
+#include <afs/com_err.h>
#include "ptint.h"
#include "pterror.h"
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. */
|| 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;
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;
}
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) {
}
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;
}
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;
}
code = WalkChains(map, misc);
if (code) {
- com_err(whoami, code, "walking chains");
+ afs_com_err(whoami, code, "walking chains");
goto abort;
}
if (misc->verbose) {
}
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) {
}
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;
}
}
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;
}
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);
}
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);
}
code = CheckPrDatabase(&misc);
if (code) {
- com_err(whoami, code, "Checking prserver database");
+ afs_com_err(whoami, code, "Checking prserver database");
exit(3);
}
exit(0);
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 */ ,
}
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 */
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);
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)) {
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]);
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);
}
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);
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)
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];
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); */
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;
extern int PR_ListSuperGroups();
#endif
-#define pr_ErrorMsg error_message
+#define pr_ErrorMsg afs_error_message
#include "ptclient.h"
#include "pterror.h"
#include <afs/afsutil.h>
+#include <afs/com_err.h>
#undef FOREIGN
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)
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;
}
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;
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) {
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;
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;
}
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++;
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++;
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) {
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++;
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) {
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)
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)
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;
}
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;
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;
}
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;
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;
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;
}
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;
}
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);
/* 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);
}
}
/* 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);
}
}
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;
}
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;
}
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;
}
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;
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];
#include "error_macros.h"
#include "afs/audit.h"
#include <afs/afsutil.h>
+#include <afs/com_err.h>
/* make all of these into a structure if you want */
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;
/* 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
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)
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <afs/afsutil.h>
+#include <afs/com_err.h>
#include "ptclient.h"
#include "ptuser.h"
#include "pterror.h"
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)
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!!! */
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;
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;
}
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;
}
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;
}
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;
}
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; \
* 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;
}
#include <rx/xdr.h>
#include <afs/cellconfig.h>
#include <afs/afsutil.h>
+#include <afs/com_err.h>
#include "ptclient.h"
#include "pterror.h"
#include <rx/xdr.h>
#include <afs/cellconfig.h>
#include <afs/afsutil.h>
+#include <afs/com_err.h>
#include "ptclient.h"
int
#include "ptclient.h"
#include "pterror.h"
#include <afs/afsutil.h>
+#include <afs/com_err.h>
static char *whoami = "testpr";
static struct afsconf_dir *conf; /* cell info, set by MyBeforeProc */
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) {
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) {
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++) {
}
}
}
- com_err(whoami, code, "couldn't create %s", name);
+ afs_com_err(whoami, code, "couldn't create %s", name);
exit(12);
}
done:
}
}
}
- 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:
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;
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)
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)
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 */
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) {
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 {
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);
/* 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);
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);
(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)); }
code = pr_Initialize(1, conf_dir, NULL);
if (code) {
- com_err(whoami, code, "initializing pruser");
+ afs_com_err(whoami, code, "initializing pruser");
exit(1);
}
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;
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 */
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);
}
}
} 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);
}
}
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 */
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);
}
}
} 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);
}
}
(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;
}
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;
}
}
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;
}
code = cmd_Dispatch(argc, argv);
if (code)
- com_err(whoami, code, "calling cmd_Dispatch");
+ afs_com_err(whoami, code, "calling cmd_Dispatch");
exit(code);
}
/* 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 */
/* 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",
"\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",
/* 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;
}
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;
}
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;
}
(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 {
code = rxkst_StartClient(cParms);
if (code) {
- com_err(whoami, code, "StartClient returned");
+ afs_com_err(whoami, code, "StartClient returned");
return code;
}
} else {
|| 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;
}
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
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;
}
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;
}
(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;
}
}
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;
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;
}
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);
}
}
}
#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;
#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;
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.
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. */
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;
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;
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 */
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;
}
(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
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
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");
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
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;
multi_Select;
multi_Init;
multi_Finalize_Ignore;
- add_to_error_table;
+ afs_add_to_error_table;
xdr_afsUUID;
xdr_afs_int32;
xdr_afs_uint32;
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 {
code = 0;
} else {
printf("Cannot create %s (%s)\n", destpath,
- error_message(code));
+ afs_error_message(code));
if (code)
goto Fail_dconn;
}
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;
}
}
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;
}
}
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;
}
}
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)
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);
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) {
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)
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);
}
}
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);
}
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);
}
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);
}
}
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);
}
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);
}
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);
}
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);
}
}
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);
}
}
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);
}
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);
}
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);
}
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);
}
}
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);
}