extern int DoLogging;
extern struct afsconf_dir *tdir;
extern int DoPreserveVolumeStats;
+extern int restrictedQueryLevel;
extern void LogError(afs_int32 errcode);
{
struct DiskPartition64 *dp;
-/*
- if (!afsconf_SuperUser(tdir, acid, caller)) return VOLSERBAD_ACCESS;
-*/
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
VResetDiskUsage();
dp = VGetPartition(pname, 0);
if (dp) {
VCreateVolume(&error, originalvp->partition->name, newId,
V_parentId(originalvp));
if (error) {
- Log("1 Volser: Clone: Couldn't create new volume; clone aborted\n");
+ Log("1 Volser: Clone: Couldn't create new volume %" AFS_VOLID_FMT " for parent %" AFS_VOLID_FMT "; clone aborted\n",
+ afs_printable_VolumeId_lu(newId), afs_printable_VolumeId_lu(V_parentId(originalvp)));
newvp = (Volume *) 0;
goto fail;
}
VolGetNthVolume(struct rx_call *acid, afs_int32 aindex, afs_uint32 *avolume,
afs_int32 *apart)
{
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
Log("1 Volser: GetNthVolume: Not yet implemented\n");
return VOLSERNO_OP;
}
{
struct volser_trans *tt;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
tt = FindTrans(atid);
if (!tt)
return ENOENT;
struct VolumeDiskData *td;
struct volser_trans *tt;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
tt = FindTrans(atrans);
if (!tt)
struct volser_trans *tt;
int len;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
/* We need to at least fill it in */
*aname = malloc(1);
if (!*aname)
char namehead[9];
int i;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
strcpy(namehead, "/vicep"); /*7 including null terminator */
/* Just return attached partitions. */
struct DiskPartition64 *dp;
int i, j = 0;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
strcpy(namehead, "/vicep"); /*7 including null terminator */
/* Only report attached partitions */
int found = 0;
volint_info_handle_t handle;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
volumeInfo->volEntries_val = calloc(1, sizeof(volintInfo));
if (!volumeInfo->volEntries_val)
return ENOMEM;
int found = 0; /*Did we find the volume we need? */
volint_info_handle_t handle;
+ if (!afsconf_CheckRestrictedQuery(tdir, a_rxCidP, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
/*
* Set up our pointers for action, marking our structure to hold exactly
* one entry. Also, assume we'll fail in our quest.
int code;
volint_info_handle_t handle;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
volumeInfo->volEntries_val = calloc(allocSize, sizeof(volintInfo));
if (!volumeInfo->volEntries_val)
return ENOMEM;
int code;
volint_info_handle_t handle;
+ if (!afsconf_CheckRestrictedQuery(tdir, a_rxCidP, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
/*
* Allocate a large array of extended volume info structures, then
* set it up for action.
afs_int32 allocSize = 50;
struct volser_trans *tt, *nt, *allTrans;
+ if (!afsconf_CheckRestrictedQuery(tdir, acid, restrictedQueryLevel))
+ return VOLSERBAD_ACCESS;
+
transInfo->transDebugEntries_val =
malloc(allocSize * sizeof(transDebugInfo));
if (!transInfo->transDebugEntries_val)
}
afs_int32
-SAFSVolSplitVolume(struct rx_call *acall, afs_uint32 vid, afs_uint32 new,
+SAFSVolSplitVolume(struct rx_call *acall, afs_uint32 ovid, afs_uint32 onew,
afs_uint32 where, afs_int32 verbose)
{
#if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
struct volser_trans *tt = 0, *tt2 = 0;
char caller[MAXKTCNAMELEN];
char line[128];
+ VolumeId new = onew;
+ VolumeId vid = ovid;
if (!afsconf_SuperUser(tdir, acall, caller))
return EPERM;
if (V_device(vol) != V_device(newvol)
|| V_uniquifier(newvol) != 2) {
if (V_device(vol) != V_device(newvol)) {
- sprintf(line, "Volumes %u and %u are not in the same partition, aborted.\n",
- vid, new);
+ sprintf(line, "Volumes %" AFS_VOLID_FMT " and %" AFS_VOLID_FMT " are not in the same partition, aborted.\n",
+ afs_printable_VolumeId_lu(vid),
+ afs_printable_VolumeId_lu(new));
rx_Write(acall, line, strlen(line));
}
if (V_uniquifier(newvol) != 2) {
- sprintf(line, "Volume %u is not freshly created, aborted.\n", new);
+ sprintf(line, "Volume %" AFS_VOLID_FMT " is not freshly created, aborted.\n",
+ afs_printable_VolumeId_lu(new));
rx_Write(acall, line, strlen(line));
}
line[0] = 0;
}
tt = NewTrans(vid, V_device(vol));
if (!tt) {
- sprintf(line, "Couldn't create transaction for %u, aborted.\n", vid);
+ sprintf(line, "Couldn't create transaction for %" AFS_VOLID_FMT ", aborted.\n",
+ afs_printable_VolumeId_lu(vid));
rx_Write(acall, line, strlen(line));
line[0] = 0;
rx_Write(acall, line, 1);
tt2 = NewTrans(new, V_device(newvol));
if (!tt2) {
- sprintf(line, "Couldn't create transaction for %u, aborted.\n", new);
+ sprintf(line, "Couldn't create transaction for %" AFS_VOLID_FMT ", aborted.\n",
+ afs_printable_VolumeId_lu(new));
rx_Write(acall, line, strlen(line));
line[0] = 0;
rx_Write(acall, line, 1);