* The token has been retrieved successfully, initialize
* the rest of the token handle structure
*/
- strcpy(t_handle->cell, cellName);
+ strncpy(t_handle->cell, cellName, MAXCELLCHARS);
+ t_handle->cell[MAXCELLCHARS - 1] = '\0';
t_handle->afs_token_set = 1;
t_handle->from_kernel = 1;
t_handle->kas_token_set = 0;
if ((GetAFSToken(cellName, principal, password, t_handle, &tst))
&& (GetKASToken(cellName, principal, password, t_handle, &tst))) {
- strcpy(t_handle->cell, cellName);
+ strncpy(t_handle->cell, cellName, MAXCELLCHARS);
+ t_handle->cell[MAXCELLCHARS - 1] = '\0';
t_handle->from_kernel = 0;
t_handle->afs_token_set = 1;
t_handle->kas_token_set = 1;
* information for each server in the cell
*/
- strcpy(c_handle->working_cell, cellName);
+ strncpy(c_handle->working_cell, cellName, MAXCELLCHARS);
+ c_handle->working_cell[MAXCELLCHARS - 1] = '\0';
if (!(tdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
tst = ADMCLIENTBADCLIENTCONFIG;
goto fail_afsclient_CellOpen;
* We must copy the cellName here because afsconf_GetCellInfo
* actually writes over the cell name it is passed.
*/
- strncpy(copyCell, cellName, MAXCELLCHARS - 1);
+ strncpy(copyCell, cellName, MAXCELLCHARS);
+ copyCell[MAXCELLCHARS - 1] ='\0';
for (i = 0; (i < NUM_SERVER_TYPES); i++) {
if (i == KAS) {
tst =
if (host != NULL) {
strncpy(serv->server[iserv].serverName, host->h_name,
AFS_MAX_SERVER_NAME_LEN);
+ serv->server[iserv].serverName[AFS_MAX_SERVER_NAME_LEN - 1] = '\0';
}
}
UNLOCK_GLOBAL_MUTEX;
#undef ENCRYPT
-extern int ubik_Call();
-
typedef struct {
int begin_magic;
int is_valid;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
kas_server_p k_handle = (kas_server_p) serverHandle;
kas_server_t kaserver;
- struct kas_encryptionKey key;
+ EncryptionKey key;
+ struct kas_encryptionKey kas_key;
/*
* Validate input arguments and make rpc.
goto fail_kas_PrincipalCreate;
}
- if (!kas_StringToKey(kaserver.cell, password, &key, &tst)) {
+ if (!kas_StringToKey(kaserver.cell, password, &kas_key, &tst)) {
goto fail_kas_PrincipalCreate;
}
+ memcpy(&key, &kas_key, sizeof(key));
+
tst =
- ubik_Call(KAM_CreateUser, kaserver.servers, 0, who->principal,
+ ubik_KAM_CreateUser(kaserver.servers, 0, who->principal,
who->instance, key);
if (tst) {
goto fail_kas_PrincipalCreate;
goto fail_kas_PrincipalDelete;
}
tst =
- ubik_Call(KAM_DeleteUser, kaserver.servers, 0, who->principal,
+ ubik_KAM_DeleteUser(kaserver.servers, 0, who->principal,
who->instance);
if (tst) {
goto fail_kas_PrincipalDelete;
}
tst =
- ubik_Call(KAM_GetEntry, kaserver.servers, 0, who->principal,
+ ubik_KAM_GetEntry(kaserver.servers, 0, who->principal,
who->instance, KAMAJORVERSION, &entry);
if (tst) {
goto fail_kas_PrincipalGet;
principal_get_p prin = (principal_get_p) rpc_specific;
tst =
- ubik_Call(KAM_ListEntry, prin->kaserver.servers, 0, prin->current,
- &prin->next, &prin->count, &prin->principal[slot]);
+ ubik_KAM_ListEntry(prin->kaserver.servers, 0, prin->current,
+ &prin->next, &prin->count, (kaident *)&prin->principal[slot]);
if (tst == 0) {
prin->current = prin->next;
if (prin->next == 0) {
int ADMINAPI
kas_PrincipalKeySet(const void *cellHandle, const void *serverHandle,
const kas_identity_p who, int keyVersion,
- const kas_encryptionKey_p key, afs_status_p st)
+ const kas_encryptionKey_p kas_keyp, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
kas_server_p k_handle = (kas_server_p) serverHandle;
kas_server_t kaserver;
+ EncryptionKey key;
/*
* Validate input arguments and make rpc.
goto fail_kas_PrincipalKeySet;
}
- if (key == NULL) {
+ if (kas_keyp == NULL) {
tst = ADMKASKEYNULL;
goto fail_kas_PrincipalKeySet;
}
goto fail_kas_PrincipalKeySet;
}
+ memcpy(&key, kas_keyp, sizeof(key));
+
tst =
- ubik_Call(KAM_SetPassword, kaserver.servers, 0, who->principal,
- who->instance, keyVersion, *key);
+ ubik_KAM_SetPassword(kaserver.servers, 0, who->principal,
+ who->instance, keyVersion, key);
+ memset(&key, 0, sizeof(key));
if (tst) {
goto fail_kas_PrincipalKeySet;
}
}
tst =
- ubik_Call(KAM_GetEntry, kaserver.servers, 0, who->principal,
+ ubik_KAM_GetEntry(kaserver.servers, 0, who->principal,
who->instance, KAMAJORVERSION, &tentry);
if (tst == 0) {
*cur_flags = tentry.flags;
goto fail_kas_PrincipalFieldsSet;
}
tst =
- ubik_Call(KAM_SetFields, kaserver.servers, 0, who->principal,
+ ubik_KAM_SetFields(kaserver.servers, 0, who->principal,
who->instance, flags, expiration, lifetime, -1,
was_spare, 0);
if (tst == 0) {
}
tst =
- ubik_Call(KAM_GetStats, kaserver.servers, 0, KAMAJORVERSION, &admins,
+ ubik_KAM_GetStats(kaserver.servers, 0, KAMAJORVERSION, &admins,
&statics, &dynamics);
if (tst) {
goto fail_kas_ServerStatsGet;
if (!ChooseValidServer(c_handle, k_handle, &kaserver, &tst)) {
goto fail_kas_ServerDebugGet;
}
- tst = ubik_Call(KAM_Debug, kaserver.servers, 0, KAMAJORVERSION, 0, &info);
+ tst = ubik_KAM_Debug(kaserver.servers, 0, KAMAJORVERSION, 0, &info);
if (tst) {
goto fail_kas_ServerDebugGet;
}
int ADMINAPI
kas_ServerRandomKeyGet(const void *cellHandle, const void *serverHandle,
- kas_encryptionKey_p key, afs_status_p st)
+ kas_encryptionKey_p kas_keyp, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
kas_server_p k_handle = (kas_server_p) serverHandle;
kas_server_t kaserver;
+ EncryptionKey key;
/*
* Validate input arguments and make rpc.
*/
- if (key == NULL) {
+ if (kas_keyp == NULL) {
tst = ADMKASKEYNULL;
goto fail_kas_ServerRandomKeyGet;
}
goto fail_kas_ServerRandomKeyGet;
}
- tst = ubik_Call(KAM_GetRandomKey, kaserver.servers, 0, key);
+ tst = ubik_KAM_GetRandomKey(kaserver.servers, 0, &key);
if (tst) {
goto fail_kas_ServerRandomKeyGet;
}
+ memcpy(kas_keyp, &key, sizeof(*kas_keyp));
rc = 1;
fail_kas_ServerRandomKeyGet:
}
}
- tst = ubik_Call(PR_NameToID, cellHandle->pts, 0, names, ids);
+ tst = ubik_PR_NameToID(cellHandle->pts, 0, names, ids);
if (tst) {
goto fail_TranslatePTSNames;
names.namelist_val = (prname *) & tmp_array[0];
strncpy(names.namelist_val[0], id1, PTS_MAX_NAME_LEN);
+ names.namelist_val[0][PTS_MAX_NAME_LEN - 1] = '\0';
strncpy(names.namelist_val[1], id2, PTS_MAX_NAME_LEN);
+ names.namelist_val[1][PTS_MAX_NAME_LEN - 1] = '\0';
ids->idlist_val = 0;
ids->idlist_len = 0;
names[0].namelist_len = 1;
names[0].namelist_val = (prname *) & tmp_array[0];
- strncpy(names[0].namelist_val, ptsName, PTS_MAX_NAME_LEN);
+ strncpy((char *)names[0].namelist_val, ptsName, PTS_MAX_NAME_LEN);
+ ((char *)names[0].namelist_val)[PTS_MAX_NAME_LEN - 1] = '\0';
ids.idlist_val = 0;
ids.idlist_len = 0;
int rc = 0;
afs_status_t tst = 0;
- tst = ubik_Call(PR_IDToName, cellHandle->pts, 0, ids, names);
+ tst = ubik_PR_IDToName(cellHandle->pts, 0, ids, names);
if (tst) {
goto fail_TranslatePTSIds;
*/
tst =
- ubik_Call(PR_AddToGroup, c_handle->pts, 0, ids.idlist_val[0],
+ ubik_PR_AddToGroup(c_handle->pts, 0, ids.idlist_val[0],
ids.idlist_val[1]);
if (tst != 0) {
*/
tst =
- ubik_Call(PR_ChangeEntry, c_handle->pts, 0, ids.idlist_val[1], "",
+ ubik_PR_ChangeEntry(c_handle->pts, 0, ids.idlist_val[1], "",
ids.idlist_val[0], 0);
if (tst != 0) {
if (*newGroupId != 0) {
tst =
- ubik_Call(PR_INewEntry, c_handle->pts, 0, newGroup, *newGroupId,
+ ubik_PR_INewEntry(c_handle->pts, 0, newGroup, *newGroupId,
newOwnerId);
} else {
tst =
- ubik_Call(PR_NewEntry, c_handle->pts, 0, newGroup, PRGRP,
+ ubik_PR_NewEntry(c_handle->pts, 0, newGroup, PRGRP,
newOwnerId, newGroupId);
}
* Retrieve information about the group
*/
- tst = ubik_Call(PR_ListEntry, c_handle->pts, 0, groupId, &groupEntry);
+ tst = ubik_PR_ListEntry(c_handle->pts, 0, groupId, &groupEntry);
if (tst != 0) {
goto fail_pts_GroupGet;
groupP->nameUid = groupEntry.id;
groupP->ownerUid = groupEntry.owner;
groupP->creatorUid = groupEntry.creator;
- strcpy(groupP->name, groupEntry.name);
+ strncpy(groupP->name, groupEntry.name, PTS_MAX_NAME_LEN);
+ groupP->name[PTS_MAX_NAME_LEN - 1] = '\0';
/*
* Set the access rights based upon the value of the flags member
* of the groupEntry struct.
goto fail_pts_GroupGet;
}
- strcpy(groupP->owner, names.namelist_val[0]);
- strcpy(groupP->creator, names.namelist_val[1]);
+ strncpy(groupP->owner, names.namelist_val[0], PTS_MAX_NAME_LEN);
+ groupP->owner[PTS_MAX_NAME_LEN - 1] = '\0';
+ strncpy(groupP->creator, names.namelist_val[1], PTS_MAX_NAME_LEN);
+ groupP->creator[PTS_MAX_NAME_LEN - 1] = '\0';
free(names.namelist_val);
rc = 1;
* Make the rpc
*/
- tst = ubik_Call(PR_Delete, c_handle->pts, 0, entryId);
+ tst = ubik_PR_Delete(c_handle->pts, 0, entryId);
if (tst != 0) {
goto fail_EntryDelete;
goto fail_pts_GroupMaxGet;
}
- tst = ubik_Call(PR_ListMax, c_handle->pts, 0, &maxUserId, maxGroupId);
+ tst = ubik_PR_ListMax(c_handle->pts, 0, &maxUserId, maxGroupId);
if (tst != 0) {
goto fail_pts_GroupMaxGet;
goto fail_pts_GroupMaxSet;
}
- tst = ubik_Call(PR_SetMax, c_handle->pts, 0, maxGroupId, PRGRP);
+ tst = ubik_PR_SetMax(c_handle->pts, 0, maxGroupId, PRGRP);
if (tst != 0) {
goto fail_pts_GroupMaxSet;
iter->ids.prlist_val = 0;
tst =
- ubik_Call(PR_ListElements, c_handle->pts, 0, groupId, &iter->ids,
+ ubik_PR_ListElements(c_handle->pts, 0, groupId, &iter->ids,
&exceeded);
if (tst != 0) {
*/
tst =
- ubik_Call(PR_RemoveFromGroup, c_handle->pts, 0, ids.idlist_val[0],
+ ubik_PR_RemoveFromGroup(c_handle->pts, 0, ids.idlist_val[0],
ids.idlist_val[1]);
if (tst != 0) {
* Make the rpc
*/
- tst = ubik_Call(PR_ChangeEntry, c_handle->pts, 0, groupId, newName, 0, 0);
+ tst = ubik_PR_ChangeEntry(c_handle->pts, 0, groupId, newName, 0, 0);
if (tst != 0) {
goto fail_pts_GroupRename;
*/
tst =
- ubik_Call(PR_SetFieldsEntry, c_handle->pts, 0, groupId, PR_SF_ALLBITS,
+ ubik_PR_SetFieldsEntry(c_handle->pts, 0, groupId, PR_SF_ALLBITS,
flags, 0, 0, 0, 0);
if (tst != 0) {
if (*newUserId != 0) {
tst =
- ubik_Call(PR_INewEntry, c_handle->pts, 0, userName, *newUserId,
+ ubik_PR_INewEntry(c_handle->pts, 0, userName, *newUserId,
0);
} else {
tst =
- ubik_Call(PR_NewEntry, c_handle->pts, 0, userName, 0, 0,
+ ubik_PR_NewEntry(c_handle->pts, 0, userName, 0, 0,
newUserId);
}
goto fail_IsAdministrator;
}
tst =
- ubik_Call(PR_IsAMemberOf, c_handle->pts, 0, userId, adminId,
+ ubik_PR_IsAMemberOf(c_handle->pts, 0, userId, adminId,
&isAdmin);
if (tst != 0) {
goto fail_IsAdministrator;
* Retrieve information about the group
*/
- tst = ubik_Call(PR_ListEntry, c_handle->pts, 0, userId, &userEntry);
+ tst = ubik_PR_ListEntry(c_handle->pts, 0, userId, &userEntry);
if (tst != 0) {
goto fail_pts_UserGet;
userP->nameUid = userEntry.id;
userP->ownerUid = userEntry.owner;
userP->creatorUid = userEntry.creator;
- strcpy(userP->name, userEntry.name);
+ strncpy(userP->name, userEntry.name, PTS_MAX_NAME_LEN);
+ userP->name[PTS_MAX_NAME_LEN - 1] = '\0';
/*
* The permission bits are described in the GroupGet function above.
goto fail_pts_UserGet;
}
- strcpy(userP->owner, names.namelist_val[0]);
- strcpy(userP->creator, names.namelist_val[1]);
+ strncpy(userP->owner, names.namelist_val[0], PTS_MAX_NAME_LEN);
+ userP->owner[PTS_MAX_NAME_LEN - 1] ='\0';
+ strncpy(userP->creator, names.namelist_val[1], PTS_MAX_NAME_LEN);
+ userP->creator[PTS_MAX_NAME_LEN - 1] = '\0';
free(names.namelist_val);
rc = 1;
* Make the rpc
*/
- tst = ubik_Call(PR_ChangeEntry, c_handle->pts, 0, userId, newName, 0, 0);
+ tst = ubik_PR_ChangeEntry(c_handle->pts, 0, userId, newName, 0, 0);
if (tst != 0) {
goto fail_pts_UserRename;
*/
tst =
- ubik_Call(PR_SetFieldsEntry, c_handle->pts, 0, userId, mask, flags,
+ ubik_PR_SetFieldsEntry(c_handle->pts, 0, userId, mask, flags,
newQuota, 0, 0, 0);
if (tst != 0) {
goto fail_pts_UserMaxGet;
}
- tst = ubik_Call(PR_ListMax, c_handle->pts, 0, maxUserId, &maxGroupId);
+ tst = ubik_PR_ListMax(c_handle->pts, 0, maxUserId, &maxGroupId);
if (tst != 0) {
goto fail_pts_UserMaxGet;
goto fail_pts_UserMaxSet;
}
- tst = ubik_Call(PR_SetMax, c_handle->pts, 0, maxUserId, 0);
+ tst = ubik_PR_SetMax(c_handle->pts, 0, maxUserId, 0);
if (tst != 0) {
goto fail_pts_UserMaxSet;
if ((!list->finished_retrieving) && (list->owned_names.namelist_len == 0)) {
tst =
- ubik_Call(PR_ListOwned, list->c_handle->pts, 0, list->owner,
+ ubik_PR_ListOwned(list->c_handle->pts, 0, list->owner,
&list->owned_ids, &list->more);
if (tst != 0) {
goto fail_GetOwnedGroupRPC;
bulkentries.prentries_len = 0;
tst =
- ubik_Call(PR_ListEntries, list->c_handle->pts, 0, list->flag,
+ ubik_PR_ListEntries(list->c_handle->pts, 0, list->flag,
start, &bulkentries, &(list->nextstartindex));
if (tst != 0) {
#include <afs/param.h>
#include <afs/afs_Admin.h>
-#define PTS_MAX_NAME_LEN 64
-#define PTS_MAX_GROUPS 5000
+#define PTS_MAX_NAME_LEN 64 /* must equal PR_MAXNAMELEN */
+#define PTS_MAX_GROUPS 5000 /* must equal PR_MAXGROUPS */
typedef enum {
PTS_USER_OWNER_ACCESS,
if (tst) {
goto fail_vos_PartitionGet;
}
- strcpy(partitionP->name, part_info.name);
- strcpy(partitionP->deviceName, part_info.devName);
+ strncpy(partitionP->name, part_info.name, VOS_MAX_PARTITION_NAME_LEN);
+ partitionP->name[VOS_MAX_PARTITION_NAME_LEN-1] = '\0';
+ strncpy(partitionP->deviceName, part_info.devName, VOS_MAX_PARTITION_NAME_LEN);
+ partitionP->deviceName[VOS_MAX_PARTITION_NAME_LEN-1] = '\0';
partitionP->lockFileDescriptor = part_info.lock_fd;
partitionP->totalSpace = part_info.minFree;
partitionP->totalFreeSpace = part_info.free;
addr_multi.bulkaddrs_val = 0;
addr_multi.bulkaddrs_len = 0;
tst =
- ubik_Call(VL_GetAddrsU, serv->vldb, 0, &m_attrs, &m_uuid,
+ ubik_VL_GetAddrsU(serv->vldb, 0, &m_attrs, &m_uuid,
&m_unique, &total_multi, &addr_multi);
if (tst) {
goto fail_GetServerRPC;
dest->status |= VOS_VLDB_ENTRY_BACKEXISTS;
}
- strcpy(dest->name, source->name);
+ strncpy(dest->name, source->name, VOS_MAX_VOLUME_NAME_LEN);
+ dest->name[VOS_MAX_VOLUME_NAME_LEN - 1] = '\0';
for (i = 0; i < VOS_MAX_REPLICA_SITES; i++) {
dest->volumeSites[i].serverAddress = source->serverNumber[i];
dest->volumeSites[i].serverPartition = source->serverPartition[i];
*/
if (volumeId != NULL) {
- tst = ubik_Call(VL_DeleteEntry, c_handle->vos, 0, *volumeId, -1);
+ tst = ubik_VL_DeleteEntry(c_handle->vos, 0, *volumeId, -1);
if (tst != 0) {
goto fail_vos_VLDBEntryRemove;
}
}
for (i = 0; i < nentries; i++) {
- ubik_Call(VL_DeleteEntry, c_handle->vos, 0,
- entries.nbulkentries_val[i].volumeId[RWVOL]);
+ ubik_VL_DeleteEntry(c_handle->vos, 0,
+ entries.nbulkentries_val[i].volumeId[RWVOL], -1);
}
rc = 1;
goto fail_vos_VLDBEntryLock;
}
- tst = ubik_Call(VL_SetLock, c_handle->vos, 0, volumeId, -1, VLOP_DELETE);
+ tst = ubik_VL_SetLock(c_handle->vos, 0, volumeId, -1, VLOP_DELETE);
if (tst != 0) {
goto fail_vos_VLDBEntryLock;
}
tst =
- ubik_Call(VL_ReleaseLock, c_handle->vos, 0, volumeId, -1,
+ ubik_VL_ReleaseLock(c_handle->vos, 0, volumeId, -1,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (tst != 0) {
goto fail_vos_VLDBEntryUnlock;
*/
if (dest->status == VOS_OK) {
- strcpy(dest->name, source->name);
+ strncpy(dest->name, source->name, VOS_MAX_VOLUME_NAME_LEN);
+ dest->name[VOS_MAX_VOLUME_NAME_LEN - 1] = '\0';
dest->id = source->volid;
if (source->type == 0) {
dest->type = VOS_READ_WRITE_VOLUME;
do {
if (cellHandle->vos_new) {
- tst = ubik_Call(VL_CreateEntryN, cellHandle->vos, 0, entryp);
+ tst = ubik_VL_CreateEntryN(cellHandle->vos, 0, entryp);
if (tst) {
if (tst == RXGEN_OPCODE) {
cellHandle->vos_new = 0;
}
} else {
if (NewVLDB_to_OldVLDB(entryp, &oentry, &tst)) {
- tst = ubik_Call(VL_CreateEntry, cellHandle->vos, 0, &oentry);
+ tst = ubik_VL_CreateEntry(cellHandle->vos, 0, &oentry);
if (!tst) {
rc = 1;
}
do {
if (cellHandle->vos_new) {
tst =
- ubik_Call(VL_GetEntryByIDN, cellHandle->vos, 0, volid,
+ ubik_VL_GetEntryByIDN(cellHandle->vos, 0, volid,
voltype, entryp);
if (tst) {
if (tst == RXGEN_OPCODE) {
}
} else {
tst =
- ubik_Call(VL_GetEntryByID, cellHandle->vos, 0, volid, voltype,
+ ubik_VL_GetEntryByID(cellHandle->vos, 0, volid, voltype,
&oentry);
if (tst == 0) {
rc = OldVLDB_to_NewVLDB(&oentry, entryp, &tst);
do {
if (cellHandle->vos_new) {
tst =
- ubik_Call(VL_GetEntryByNameN, cellHandle->vos, 0, namep,
+ ubik_VL_GetEntryByNameN(cellHandle->vos, 0, namep,
entryp);
if (tst) {
if (tst == RXGEN_OPCODE) {
}
} else {
tst =
- ubik_Call(VL_GetEntryByNameO, cellHandle->vos, 0, namep,
+ ubik_VL_GetEntryByNameO(cellHandle->vos, 0, namep,
&oentry);
if (tst == 0) {
rc = OldVLDB_to_NewVLDB(&oentry, entryp, &tst);
do {
if (cellHandle->vos_new) {
tst =
- ubik_Call(VL_ReplaceEntryN, cellHandle->vos, 0, volid,
+ ubik_VL_ReplaceEntryN(cellHandle->vos, 0, volid,
voltype, entryp, releasetype);
if (tst) {
if (tst == RXGEN_OPCODE) {
} else {
if (NewVLDB_to_OldVLDB(entryp, &oentry, &tst)) {
tst =
- ubik_Call(VL_ReplaceEntry, cellHandle->vos, 0, volid,
+ ubik_VL_ReplaceEntry(cellHandle->vos, 0, volid,
voltype, &oentry, releasetype);
if (!tst) {
rc = 1;
do {
if (cellHandle->vos_new) {
tst =
- ubik_Call(VL_ListAttributesN, cellHandle->vos, 0, attrp,
+ ubik_VL_ListAttributesN(cellHandle->vos, 0, attrp,
entriesp, blkentriesp);
if (tst) {
if (tst == RXGEN_OPCODE) {
} else {
memset((void *)&arrayEntries, 0, sizeof(arrayEntries));
tst =
- ubik_Call(VL_ListAttributes, cellHandle->vos, 0, attrp,
- entriesp, arrayEntries);
+ ubik_VL_ListAttributes(cellHandle->vos, 0, attrp,
+ entriesp, &arrayEntries);
if (tst == 0) {
blkentriesp->nbulkentries_val =
(nvldbentry *) malloc(*entriesp * sizeof(*blkentriesp));
afs_status_t tst = 0;
tst =
- ubik_Call(VL_ListAttributesN2, cellHandle->vos, 0, attrp,
+ ubik_VL_ListAttributesN2(cellHandle->vos, 0, attrp,
(name ? name : ""), thisindex, nentriesp, blkentriesp,
nextindexp);
if (!tst) {
memset(&addrs, 0, sizeof(addrs));
memset(&uuid, 0, sizeof(uuid));
tst =
- ubik_Call(VL_GetAddrsU, cellHandle->vos, 0, &attrs, &uuid, &unique,
+ ubik_VL_GetAddrsU(cellHandle->vos, 0, &attrs, &uuid, &unique,
&nentries, &addrs);
if (tst) {
*equal = 0;
char sname[32];
size_t total;
- strcpy(sname, name);
+ strncpy(sname, name, 32);
+ sname[31] ='\0';
total = strlen(sname);
if ((total > 9) && (!strcmp(&sname[total - 9], ".readonly"))) {
/*discard the last 8 chars */
tstatus.maxquota = quota;
/* next the next 3 available ids from the VLDB */
- tst = ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 3, volumeId);
+ tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 3, volumeId);
if (tst) {
goto fail_UV_CreateVolume;
}
/* Find and read the VLDB entry for this volume */
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, volumeId, avoltype,
+ ubik_VL_SetLock(cellHandle->vos, 0, volumeId, avoltype,
VLOP_DELETE);
if (tst) {
if (tst != VL_NOENT) {
}
if ((entry.nServers <= 0) || !(entry.flags & (RO_EXISTS | RW_EXISTS))) {
- tst = ubik_Call(VL_DeleteEntry, cellHandle->vos, 0, volumeId, vtype);
+ tst = ubik_VL_DeleteEntry(cellHandle->vos, 0, volumeId, vtype);
if (tst) {
goto fail_UV_DeleteVolume;
}
if (islocked) {
temp =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, volumeId, -1,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, volumeId, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (temp) {
if (!tst)
}
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, afromvol, RWVOL, VLOP_MOVE);
+ ubik_VL_SetLock(cellHandle->vos, 0, afromvol, RWVOL, VLOP_MOVE);
if (tst) {
goto fail_UV_MoveVolume;
}
if (!Lp_Match(cellHandle, &entry, atoserver, atopart, &tst)) {
/* the to server and partition do not exist in the vldb entry corresponding to volid */
tst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID |
LOCKREL_TIMESTAMP));
if (tst) {
/* Get a clone id */
newVol = 0;
- tst = ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, &newVol);
+ tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, &newVol);
if (tst) {
goto fail_UV_MoveVolume;
}
if (islocked) {
etst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (etst) {
if (!tst)
/* unlock VLDB entry */
if (islocked)
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (clonetid)
}
/* unlock VLDB entry */
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
done: /* routine cleanup */
/* no assigned backup volume id */
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, avolid, RWVOL,
+ ubik_VL_SetLock(cellHandle->vos, 0, avolid, RWVOL,
VLOP_BACKUP);
if (tst) {
goto fail_UV_BackupVolume;
/* Get a backup volume id from the VLDB and update the vldb
* entry with it.
*/
- tst = ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, &backupID);
+ tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, &backupID);
if (tst) {
goto fail_UV_BackupVolume;
}
}
} else {
temp =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, avolid, RWVOL,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, avolid, RWVOL,
(LOCKREL_OPCODE | LOCKREL_AFSID |
LOCKREL_TIMESTAMP));
if (temp) {
/* Get the RO volume id. Allocate a new one if need to */
*rovidp = entry->volumeId[ROVOL];
if (*rovidp == INVALID_BID) {
- tst = ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, rovidp);
+ tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, rovidp);
if (tst) {
goto fail_CloneVol;
}
memset((char *)&results, 0, sizeof(results));
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, afromvol, RWVOL,
+ ubik_VL_SetLock(cellHandle->vos, 0, afromvol, RWVOL,
VLOP_RELEASE);
if ((tst) && (tst != VL_RERELEASE)) {
goto fail_UV_ReleaseVolume;
/* Make sure we have a RO volume id to work with */
if (entry.volumeId[ROVOL] == INVALID_BID) {
/* need to get a new RO volume id */
- tst = ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, &roVolId);
+ tst = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, &roVolId);
if (tst) {
goto fail_UV_ReleaseVolume;
}
}
if (islocked) {
tst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, afromvol, RWVOL,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, afromvol, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (tst) {
rc = 0;
if (islocked) {
etst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, afromvol, -1,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (etst) {
if (!tst)
aVLDB_GetEntryByName(cellHandle, tovolname, &entry, &tst);
if (tst == VL_NOENT) {
tst =
- ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 1, &pvolid);
+ ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 1, &pvolid);
if (tst) {
goto fail_UV_RestoreVolume;
}
islocked = 0;
} else { /*update the existing entry */
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, pvolid, RWVOL,
+ ubik_VL_SetLock(cellHandle->vos, 0, pvolid, RWVOL,
VLOP_RESTORE);
if (tst) {
goto fail_UV_RestoreVolume;
}
if (islocked) {
etst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, pvolid, RWVOL,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, pvolid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (etst) {
if (!tst)
int same = 0;
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, volid, RWVOL, VLOP_ADDSITE);
+ ubik_VL_SetLock(cellHandle->vos, 0, volid, RWVOL, VLOP_ADDSITE);
if (tst) {
goto fail_UV_AddSite;
}
if (islocked) {
tst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
}
int islocked = 0;
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, volid, RWVOL, VLOP_ADDSITE);
+ ubik_VL_SetLock(cellHandle->vos, 0, volid, RWVOL, VLOP_ADDSITE);
if (tst) {
goto fail_UV_RemoveSite;
}
if ((entry.nServers == 1) && (entry.flags & RW_EXISTS))
entry.flags &= ~RO_EXISTS;
if (entry.nServers < 1) { /*this is the last ref */
- tst = ubik_Call(VL_DeleteEntry, cellHandle->vos, 0, volid, ROVOL);
+ tst = ubik_VL_DeleteEntry(cellHandle->vos, 0, volid, ROVOL);
if (tst) {
goto fail_UV_RemoveSite;
}
if (islocked) {
afs_status_t t;
- t = ubik_Call(VL_ReleaseLock, cellHandle->vos, 0, volid, RWVOL,
+ t = ubik_VL_ReleaseLock(cellHandle->vos, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (tst == 0) {
tst = t;
counter = 0;
/* get the next available id's from the vldb server */
- vcode = ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, 0, &maxVolid);
+ vcode = ubik_VL_GetNewVolumeId(cellHandle->vos, 0, 0, &maxVolid);
if (vcode) {
return (vcode);
}
temp2 = elem.ids[RWVOL] - maxVolid + 1;
maxVolid = 0;
vcode =
- ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, temp2,
+ ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
&maxVolid);
maxVolid += temp2;
temp2 = elem.ids[ROVOL] - maxVolid + 1;
maxVolid = 0;
vcode =
- ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, temp2,
+ ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
&maxVolid);
maxVolid += temp2;
temp2 = elem.ids[BACKVOL] - temp1 + 1;
maxVolid = 0;
vcode =
- ubik_Call(VL_GetNewVolumeId, cellHandle->vos, 0, temp2,
+ ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
&maxVolid);
maxVolid += temp2;
totalUE++;
vcode =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0,
elem.ids[RWVOL], RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID |
LOCKREL_TIMESTAMP);
*/
if (++pass == 2) {
tst =
- ubik_Call(VL_SetLock, cellHandle->vos, 0, entry->volumeId[RWVOL],
+ ubik_VL_SetLock(cellHandle->vos, 0, entry->volumeId[RWVOL],
RWVOL, VLOP_DELETE);
if (tst) {
goto fail_CheckVldb;
&& !(entry->flags & RO_EXISTS)) {
/* The RW, BK, nor RO volumes do not exist. Delete the VLDB entry */
tst =
- ubik_Call(VL_DeleteEntry, cellHandle->vos, 0,
+ ubik_VL_DeleteEntry(cellHandle->vos, 0,
entry->volumeId[RWVOL], RWVOL);
if (tst) {
goto fail_CheckVldb;
if (islocked) {
vcode =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0,
entry->volumeId[RWVOL], RWVOL,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP),
&tst);
tid = 0;
islocked = 0;
- tst = ubik_Call(VL_SetLock, cellHandle->vos, 0, entry->volumeId[RWVOL], RWVOL, VLOP_ADDSITE); /*last param is dummy */
+ tst = ubik_VL_SetLock(cellHandle->vos, 0, entry->volumeId[RWVOL], RWVOL, VLOP_ADDSITE); /*last param is dummy */
if (tst) {
goto fail_UV_RenameVolume;
}
if (islocked) {
etst =
- ubik_Call(VL_ReleaseLock, cellHandle->vos, 0,
+ ubik_VL_ReleaseLock(cellHandle->vos, 0,
entry->volumeId[RWVOL], RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (etst) {