Exemplo n.º 1
0
void objectCache(LCObjectRef object) {
  if (!object->data) {
    LCContextRef context = objectContext(object);
    if (context) {
      FILE* fp = storeReadData(context->store, objectType(object), _objectHash(object));
      objectDeserialize(object, fp);
      fclose(fp);
    }
  }
}
/*
 * Function: checkSELinuxAccess
 * Purpose: Check permissions between two security contexts.
 * Parameters: subjectContextStr: subject security context as a string
 *             objectContextStr: object security context as a string
 *             objectClassStr: object's security class name as a string
 *             permissionStr: permission name as a string
 * Returns: boolean: (true) if permission was granted, (false) otherwise
 * Exceptions: None
 */
static jboolean checkSELinuxAccess(JNIEnv *env, jobject, jstring subjectContextStr,
        jstring objectContextStr, jstring objectClassStr, jstring permissionStr) {
    if (isSELinuxDisabled) {
        return true;
    }

    ScopedUtfChars subjectContext(env, subjectContextStr);
    if (subjectContext.c_str() == NULL) {
        return false;
    }

    ScopedUtfChars objectContext(env, objectContextStr);
    if (objectContext.c_str() == NULL) {
        return false;
    }

    ScopedUtfChars objectClass(env, objectClassStr);
    if (objectClass.c_str() == NULL) {
        return false;
    }

    ScopedUtfChars permission(env, permissionStr);
    if (permission.c_str() == NULL) {
        return false;
    }

    char *tmp1 = const_cast<char *>(subjectContext.c_str());
    char *tmp2 = const_cast<char *>(objectContext.c_str());
    int accessGranted = selinux_check_access(tmp1, tmp2, objectClass.c_str(), permission.c_str(),
            NULL);

    ALOGV("checkSELinuxAccess(%s, %s, %s, %s) => %d", subjectContext.c_str(), objectContext.c_str(),
            objectClass.c_str(), permission.c_str(), accessGranted);

    return (accessGranted == 0) ? true : false;
}
Exemplo n.º 3
0
WRITE16_MEMBER(aerofgt_state::aerofgt_bg1scrollx_w)
{
	COMBINE_DATA(&m_bg1scrollx);
}

WRITE16_MEMBER(aerofgt_state::aerofgt_bg1scrolly_w)
{
	COMBINE_DATA(&m_bg1scrolly);
}

WRITE16_MEMBER(aerofgt_state::aerofgt_bg2scrollx_w)
{
	COMBINE_DATA(&m_bg2scrollx);
}

WRITE16_MEMBER(aerofgt_state::aerofgt_bg2scrolly_w)
{
	COMBINE_DATA(&m_bg2scrolly);
}

WRITE16_MEMBER(aerofgt_state::pspikes_palette_bank_w)
{
	if (ACCESSING_BITS_0_7)
	{
		m_spritepalettebank = data & 0x03;
		if (m_charpalettebank != (data & 0x1c) >> 2)
		{
			m_charpalettebank = (data & 0x1c) >> 2;
			m_bg1_tilemap->mark_all_dirty();
		}
	}
}


/***************************************************************************

  Display refresh

***************************************************************************/


UINT32 aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i, scrolly;