Lines Matching refs:id

73 char *VolumeManager::asecHash(const char *id, char *buffer, size_t len) {
82 } else if (id == NULL) {
93 MD5(reinterpret_cast<const unsigned char*>(id), strlen(id), sig);
198 int VolumeManager::getAsecMountPath(const char *id, char *buffer, int maxlen) {
200 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
208 snprintf(buffer, maxlen, "%s/%s", Volume::ASECDIR, id);
212 int VolumeManager::getAsecFilesystemPath(const char *id, char *buffer, int maxlen) {
214 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
226 int VolumeManager::createAsec(const char *id, unsigned int numSectors,
240 if (lookupVolume(id)) {
241 SLOGE("ASEC id '%s' currently exists", id);
247 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
273 if (!asecHash(id, idHash, sizeof(idHash))) {
274 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
359 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
383 SLOGI("Created raw secure container %s (no filesystem)", id);
386 mActiveContainers->push_back(new ContainerData(strdup(id), ASEC));
390 int VolumeManager::finalizeAsec(const char *id) {
395 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
398 if (!asecHash(id, idHash, sizeof(idHash))) {
399 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
404 SLOGE("Unable to finalize %s (%s)", id, strerror(errno));
408 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
416 SLOGD("ASEC %s finalized", id);
466 int VolumeManager::unmountAsec(const char *id, bool force) {
470 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
471 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
474 if (!asecHash(id, idHash, sizeof(idHash))) {
475 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
479 return unmountLoopImage(id, idHash, asecFileName, mountPoint, force);
496 int VolumeManager::unmountLoopImage(const char *id, const char *idHash,
499 SLOGE("Unmount request for %s when not mounted", id);
511 SLOGI("Container %s unmounted OK", id);
516 id, i, strerror(errno));
533 SLOGE("Failed to unmount container %s (%s)", id, strerror(errno));
566 if (!strcmp(cd->id, id)) {
578 int VolumeManager::destroyAsec(const char *id, bool force) {
582 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
583 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
589 if (unmountAsec(id, force)) {
590 SLOGE("Failed to unmount asec %s for destroy (%s)", id, strerror(errno));
601 SLOGD("ASEC %s destroyed", id);
606 int VolumeManager::mountAsec(const char *id, const char *key, int ownerUid) {
610 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
611 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
614 SLOGE("ASEC %s already mounted", id);
620 if (!asecHash(id, idHash, sizeof(idHash))) {
621 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
732 mActiveContainers->push_back(new ContainerData(strdup(id), ASEC));
734 SLOGD("ASEC %s mounted", id);
1163 SLOGI("Unmounting ASEC %s (dependant on %s)", cd->id, v->getMountpoint());
1165 if (unmountAsec(cd->id, force)) {
1166 SLOGE("Failed to unmount ASEC %s (%s)", cd->id, strerror(errno));
1170 if (unmountObb(cd->id, force)) {
1171 SLOGE("Failed to unmount OBB %s (%s)", cd->id, strerror(errno));