#include <afs/procmgmt.h>
#include <roken.h>
-#include <rx/xdr.h>
+#include <afs/opr.h>
#include <rx/rx.h>
#include <afs/afsint.h>
-#include <afs/afs_assert.h>
#include <afs/prs_fs.h>
#include <afs/nfs.h>
#include <lwp.h>
int
callPermitted(struct rx_call *call)
{
- /* before this code can be used, the rx connection, on the bucoord side, must */
- /* be changed so that it will set up for token passing instead of using a */
- /* simple rx connection that, below, returns a value of 0 from rx_SecurityClassOf */
+ /*
+ * Before this code can be used, the rx connection, on the bucoord side,
+ * must be changed so that it will set up for token passing instead of
+ * using a simple rx connection that, below, returns a value of
+ * RX_SECIDX_NULL from rx_SecurityClassOf.
+ */
return 1;
}
if (callPermitted(acid) == 0)
return (TC_NOTPERMITTED);
- ptr = (struct labelTapeIf *)malloc(sizeof(*ptr));
+ ptr = malloc(sizeof(*ptr));
if (!ptr)
ERROR_EXIT(TC_NOMEMORY);
memcpy(&ptr->label, label, sizeof(ptr->label));
/*set up the parameters in the node, to be used by LWP */
strcpy(newNode->dumpSetName, tcdiPtr->dumpName);
- newNode->dumpName = (char *)malloc(strlen(tcdiPtr->dumpPath) + 1);
- strcpy(newNode->dumpName, tcdiPtr->dumpPath);
-
- newNode->volumeSetName =
- (char *)malloc(strlen(tcdiPtr->volumeSetName) + 1);
- strcpy(newNode->volumeSetName, tcdiPtr->volumeSetName);
+ newNode->dumpName = strdup(tcdiPtr->dumpPath);
+ newNode->volumeSetName = strdup(tcdiPtr->volumeSetName);
CopyTapeSetDesc(&(newNode->tapeSetDesc), &tcdiPtr->tapeSet);
- newNode->dumps = (struct tc_dumpDesc *)
- malloc(sizeof(struct tc_dumpDesc) *
- tc_dumpArrayPtr->tc_dumpArray_len);
+ newNode->dumps = malloc(sizeof(struct tc_dumpDesc) *
+ tc_dumpArrayPtr->tc_dumpArray_len);
newNode->arraySize = tc_dumpArrayPtr->tc_dumpArray_len;
CopyDumpDesc(newNode->dumps, tc_dumpArrayPtr);
/* this creates a node in list, alots an id for it and prepares it for locking */
CreateNode(&newNode);
- newNode->restores = (struct tc_restoreDesc *)
- malloc(sizeof(struct tc_restoreDesc) *
- arestores->tc_restoreArray_len);
+ newNode->restores = malloc(sizeof(struct tc_restoreDesc) *
+ arestores->tc_restoreArray_len);
newNode->arraySize = arestores->tc_restoreArray_len;
CopyRestoreDesc(newNode->restores, arestores);
*taskID = newNode->taskID;
{
afs_int32 code;
+ memset(label, 0, sizeof(*label));
+ /* Synchronous, so no "real" ID; don't send stack garbage on the wire */
+ *taskId = 0;
#ifdef xbsa
if (CONF_XBSA)
return (TC_BADTASK); /* ReadLabel does not apply if XBSA */
*taskId = allocTaskId();
- ptr = (struct saveDbIf *)malloc(sizeof(struct saveDbIf));
+ ptr = malloc(sizeof(struct saveDbIf));
if (!ptr)
ERROR_EXIT(TC_NOMEMORY);
ptr->archiveTime = archiveTime;
*taskId = allocTaskId();
- ptr = (struct scanTapeIf *)malloc(sizeof(*ptr));
+ ptr = malloc(sizeof(*ptr));
if (!ptr)
ERROR_EXIT(TC_NOMEMORY);
ptr->addDbFlag = addDbFlag;
if (callPermitted(acid) == 0)
return (TC_NOTPERMITTED);
- ptr = (struct deleteDumpIf *)malloc(sizeof(*ptr));
+ ptr = malloc(sizeof(*ptr));
if (!ptr)
ERROR_EXIT(TC_NOMEMORY);