예제 #1
0
int
STEST_NewCanI(struct rx_call *call, afs_int32 *result)
{
    *result = 0;
    if (!afsconf_SuperIdentity(globalDir, call, NULL)) {
	return EPERM;
    }
    return 0;
}
예제 #2
0
파일: userok.c 프로젝트: bagdxk/openafs
int
afsconf_CheckRestrictedQuery(struct afsconf_dir *adir,
			     struct rx_call *acall,
			     int needed_level)
{
    if (needed_level == RESTRICTED_QUERY_ANYUSER)
	return 1;

    return afsconf_SuperIdentity(adir, acall, NULL);
}
예제 #3
0
int
STEST_NewWhoAmI(struct rx_call *call, char **result)
{
   struct rx_identity *id;

   if (!afsconf_SuperIdentity(globalDir, call, &id)) {
	*result = strdup("");
	return EPERM;
   }
   *result = strdup(id->displayName);

   return 0;
}
예제 #4
0
파일: userok.c 프로젝트: bagdxk/openafs
afs_int32
afsconf_SuperUser(struct afsconf_dir *adir, struct rx_call *acall,
		  char *namep)
{
    struct rx_identity *identity;
    int ret;

    if (namep) {
	ret = afsconf_SuperIdentity(adir, acall, &identity);
	if (ret) {
	    if (identity->kind == RX_ID_KRB4) {
		strlcpy(namep, identity->displayName, MAXKTCNAMELEN-1);
	    } else {
		snprintf(namep, MAXKTCNAMELEN-1, "eName: %s",
			 identity->displayName);
	    }
	    rx_identity_free(&identity);
	}
    } else {
	ret = afsconf_SuperIdentity(adir, acall, NULL);
    }

    return ret;
}