Exemple #1
0
int
pr_CheckEntryById(prname name, afs_int32 id, prname owner, prname creator)
{
    /* struct prcheckentry returns other things, which aren't useful to show at this time. */
    afs_int32 code;
    struct prcheckentry aentry;

    /* XXX ListEntry RPC gives us the name back so should avoid extra RPC */
    code = pr_SIdToName(id, name);
    if (code)
	return code;
    if (id == ANONYMOUSID)
	return PRNOENT;
    code = ubik_PR_ListEntry(pruclient, 0, id, &aentry);
    if (code)
	return code;
    /* this should be done in one RPC, but I'm lazy. */
    code = pr_SIdToName(aentry.owner, owner);
    if (code)
	return code;
    code = pr_SIdToName(aentry.creator, creator);
    if (code)
	return code;
    return PRSUCCESS;
}
Exemple #2
0
int
pr_CheckEntryByName(prname name, afs_int32 *id, prname owner, prname creator)
{
    /* struct prcheckentry returns other things, which aren't useful to show at this time. */
    afs_int32 code;
    struct prcheckentry aentry;

    /* pr_SNameToId will check name's length. */
    code = pr_SNameToId(name, id);
    if (code)
	return code;
    if (*id == ANONYMOUSID)
	return PRNOENT;
    code = ubik_PR_ListEntry(pruclient, 0, *id, &aentry);
    if (code)
	return code;
    /* this should be done in one RPC, but I'm lazy. */
    code = pr_SIdToName(aentry.owner, owner);
    if (code)
	return code;
    code = pr_SIdToName(aentry.creator, creator);
    if (code)
	return code;
    return PRSUCCESS;
}
Exemple #3
0
int
pr_ListEntry(afs_int32 id, struct prcheckentry *aentry)
{
    afs_int32 code;

    code = ubik_PR_ListEntry(pruclient, 0, id, aentry);
    return code;
}
Exemple #4
0
int
pr_ListEntry(afs_int32 id, struct prcheckentry *aentry)
{
    afs_int32 code;

    code = ubik_PR_ListEntry(pruclient, 0, id, aentry);
    if (code)
	return code;
    return check_length(aentry->name);
}
Exemple #5
0
int
pr_CheckEntryById(char *name, afs_int32 id, char *owner, char *creator)
{
    /* struct prcheckentry returns other things, which aren't useful to show at this time. */
    register afs_int32 code;
    struct prcheckentry aentry;

    code = pr_SIdToName(id, name);
    if (code)
	return code;
    if (id == ANONYMOUSID)
	return PRNOENT;
    code = ubik_PR_ListEntry(pruclient, 0, id, &aentry);
    if (code)
	return code;
    /* this should be done in one RPC, but I'm lazy. */
    code = pr_SIdToName(aentry.owner, owner);
    if (code)
	return code;
    code = pr_SIdToName(aentry.creator, creator);
    if (code)
	return code;
    return PRSUCCESS;
}