extern struct bc_dumpTask bc_dumpTasks[BC_MAXSIMDUMPS];
extern struct ubik_client *cstruct;
extern char *whoami;
-extern struct ktc_token ttoken;
char *loadFile;
extern afs_int32 lastTaskCode;
return (0);
} /*EvalVolumeSet1 */
-/* compactDateString
- * print out a date in compact format, 16 chars, format is
- * mm/dd/yyyy hh:mm
- * entry:
- * date_long - ptr to a long containing the time
- * exit:
- * ptr to a string containing a representation of the date
- */
char *
-compactDateString(afs_uint32 *date_long, char *string, afs_int32 size)
+compactTimeString(time_t *date, char *string, afs_int32 size)
{
struct tm *ltime;
if (!string)
- return 0;
+ return NULL;
- if (*date_long == NEVERDATE) {
+ if (*date == NEVERDATE) {
sprintf(string, "NEVER");
} else {
- time_t t = *date_long;
- ltime = localtime(&t);
- /* prints date in U.S. format of mm/dd/yyyy */
+ ltime = localtime(date);
strftime(string, size, "%m/%d/%Y %H:%M", ltime);
}
return (string);
}
+/* compactDateString
+ * print out a date in compact format, 16 chars, format is
+ * mm/dd/yyyy hh:mm
+ * entry:
+ * date_long - ptr to a long containing the time
+ * exit:
+ * ptr to a string containing a representation of the date
+ */
+char *
+compactDateString(afs_uint32 *date_long, char *string, afs_int32 size)
+{
+ time_t t = *date_long;
+ return compactTimeString(&t, string, size);
+}
+
+
afs_int32
bc_SafeATOI(char *anum)
{
}
/* Print token expiration time */
- if ((ttoken.endTime > prevTime)
- && (ttoken.endTime <= youngest->scheduledDump) && as
- && (ttoken.endTime != NEVERDATE)) {
- if (ttoken.endTime > time(0)) {
- compactDateString(&ttoken.endTime, ds, 50);
+ if ((tokenExpires > prevTime)
+ && (tokenExpires <= youngest->scheduledDump) && as
+ && (tokenExpires != NEVERDATE)) {
+ if (tokenExpires > time(0)) {
+ compactTimeString(&tokenExpires, ds, 50);
printf(" %16s: TOKEN EXPIRATION\n", ds);
} else {
printf(" TOKEN HAS EXPIRED\n");
}
/* Print token expiration time if havn't already */
- if ((ttoken.endTime == NEVERDATE) && as)
+ if ((tokenExpires == NEVERDATE) && as)
printf(" : TOKEN NEVER EXPIRES\n");
- else if ((ttoken.endTime > prevTime) && as) {
- if (ttoken.endTime > time(0)) {
- compactDateString(&ttoken.endTime, ds, 50);
+ else if ((tokenExpires > prevTime) && as) {
+ if (tokenExpires > time(0)) {
+ compactTimeString(&tokenExpires, ds, 50);
printf(" %16s: TOKEN EXPIRATION\n", ds);
} else {
printf(" : TOKEN HAS EXPIRED\n");
strcat(statusPtr->cmdLine, " -n");
printf("Add scheduled dump as job %d\n", statusPtr->jobNumber);
- if ((atTime > ttoken.endTime) && (ttoken.endTime != NEVERDATE))
+ if ((atTime > tokenExpires) && (tokenExpires != NEVERDATE))
afs_com_err(whoami, 0,
"Warning: job %d starts after expiration of AFS token",
statusPtr->jobNumber);
afs_int32 rcode = 0;
afs_int32 groupId = 0, havegroupid, sflags, noexecute;
struct cmd_item *ti;
- afs_uint32 fromTime = 0, toTime = 0, havetime = 0;
+ afs_int32 fromTime = 0, toTime = 0, havetime = 0;
char *timeString;
budb_dumpsList dumps, flags;
int i;
int
vldbClientInit(int noAuthFlag, int localauth, char *cellName,
struct ubik_client **cstruct,
- struct ktc_token *ttoken)
+ time_t *expires)
{
afs_int32 code = 0;
struct afsconf_dir *acdir;
afs_int32 i, scIndex = 0; /* Index of Rx security object - noauth */
struct afsconf_cell info;
struct ktc_principal sname;
+ struct ktc_token *ttoken = NULL;
struct rx_connection *serverconns[VLDB_MAXSERVERS];
/*
* Grab tickets if we care about authentication.
*/
- ttoken->endTime = 0;
+ *expires = 0;
if (localauth) {
code = afsconf_GetLatestKey(acdir, 0, 0);
if (code) {
ERROR(code);
}
- ttoken->endTime = NEVERDATE;
+ *expires = NEVERDATE;
}
} else {
if (!noAuthFlag) {
afs_com_err(whoami, 0,
"Funny kvno (%d) in ticket, proceeding",
ttoken->kvno);
-
+ *expires = ttoken->endTime;
scIndex = 2;
}
}
register afs_int32 code;
struct rx_securityClass *(securityObjects[3]);
struct rx_service *service;
- struct ktc_token ttoken;
+ time_t tokenExpires;
char cellName[64];
int localauth;
/*process arguments */
#else
PROCESS dbWatcherPid;
#endif
- time_t t;
afs_uint32 host = htonl(INADDR_ANY);
debugLevel = 0;
rx_SetRxDeadTime(150);
/* Establish connection with the vldb server */
- code = vldbClientInit(0, localauth, cellName, &cstruct, &ttoken);
+ code = vldbClientInit(0, localauth, cellName, &cstruct, &tokenExpires);
if (code) {
TapeLog(0, 0, code, 0, "Can't access vldb\n");
return code;
TLog(0, "Starting Tape Coordinator: Port offset %u Debug level %u\n",
portOffset, debugLevel);
- t = ttoken.endTime;
- TLog(0, "Token expires: %s\n", cTIME(&t));
+ TLog(0, "Token expires: %s\n", cTIME(&tokenExpires));
rx_StartServer(1); /* Donate this process to the server process pool */
TLog(0, "Error: StartServer returned");