Lines Matching refs:id
79 char *VolumeManager::asecHash(const char *id, char *buffer, size_t len) { in asecHash() argument
88 } else if (id == NULL) { in asecHash()
99 MD5(reinterpret_cast<const unsigned char*>(id), strlen(id), sig); in asecHash()
208 int VolumeManager::getAsecMountPath(const char *id, char *buffer, int maxlen) { in getAsecMountPath() argument
211 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in getAsecMountPath()
212 SLOGE("Couldn't find ASEC %s", id); in getAsecMountPath()
222 int written = snprintf(buffer, maxlen, "%s/%s", Volume::ASECDIR, id); in getAsecMountPath()
224 SLOGE("getAsecMountPath failed for %s: couldn't construct path in buffer", id); in getAsecMountPath()
232 int VolumeManager::getAsecFilesystemPath(const char *id, char *buffer, int maxlen) { in getAsecFilesystemPath() argument
235 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in getAsecFilesystemPath()
236 SLOGE("Couldn't find ASEC %s", id); in getAsecFilesystemPath()
255 int VolumeManager::createAsec(const char *id, unsigned int numSectors, const char *fstype, in createAsec() argument
282 if (lookupVolume(id)) { in createAsec()
283 SLOGE("ASEC id '%s' currently exists", id); in createAsec()
290 if (!findAsec(id, asecFileName, sizeof(asecFileName))) { in createAsec()
299 int written = snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", asecDir, id); in createAsec()
329 if (!asecHash(id, idHash, sizeof(idHash))) { in createAsec()
330 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno)); in createAsec()
403 int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id); in createAsec()
471 SLOGI("Created raw secure container %s (no filesystem)", id); in createAsec()
474 mActiveContainers->push_back(new ContainerData(strdup(id), ASEC)); in createAsec()
478 int VolumeManager::finalizeAsec(const char *id) { in finalizeAsec() argument
483 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in finalizeAsec()
484 SLOGE("Couldn't find ASEC %s", id); in finalizeAsec()
489 if (!asecHash(id, idHash, sizeof(idHash))) { in finalizeAsec()
490 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno)); in finalizeAsec()
495 SLOGE("Unable to finalize %s (%s)", id, strerror(errno)); in finalizeAsec()
506 int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id); in finalizeAsec()
525 SLOGD("ASEC %s finalized", id); in finalizeAsec()
530 int VolumeManager::fixupAsecPermissions(const char *id, gid_t gid, const char* filename) { in fixupAsecPermissions() argument
540 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in fixupAsecPermissions()
541 SLOGE("Couldn't find ASEC %s", id); in fixupAsecPermissions()
546 if (!asecHash(id, idHash, sizeof(idHash))) { in fixupAsecPermissions()
547 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno)); in fixupAsecPermissions()
552 SLOGE("Unable fix permissions during lookup on %s (%s)", id, strerror(errno)); in fixupAsecPermissions()
563 int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id); in fixupAsecPermissions()
565 SLOGE("Unable remount to fix permissions for %s: couldn't construct mountpoint", id); in fixupAsecPermissions()
579 SLOGE("Unable remount to fix permissions for %s (%s)", id, strerror(errno)); in fixupAsecPermissions()
641 SLOGD("ASEC %s permissions fixed", id); in fixupAsecPermissions()
705 int VolumeManager::unmountAsec(const char *id, bool force) { in unmountAsec() argument
709 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in unmountAsec()
710 SLOGE("Couldn't find ASEC %s", id); in unmountAsec()
714 int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id); in unmountAsec()
716 SLOGE("ASEC unmount failed for %s: couldn't construct mountpoint", id); in unmountAsec()
721 if (!asecHash(id, idHash, sizeof(idHash))) { in unmountAsec()
722 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno)); in unmountAsec()
726 return unmountLoopImage(id, idHash, asecFileName, mountPoint, force); in unmountAsec()
747 int VolumeManager::unmountLoopImage(const char *id, const char *idHash, in unmountLoopImage() argument
750 SLOGE("Unmount request for %s when not mounted", id); in unmountLoopImage()
762 SLOGI("Container %s unmounted OK", id); in unmountLoopImage()
767 id, i, strerror(errno)); in unmountLoopImage()
784 SLOGE("Failed to unmount container %s (%s)", id, strerror(errno)); in unmountLoopImage()
817 if (!strcmp(cd->id, id)) { in unmountLoopImage()
829 int VolumeManager::destroyAsec(const char *id, bool force) { in destroyAsec() argument
833 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in destroyAsec()
834 SLOGE("Couldn't find ASEC %s", id); in destroyAsec()
838 int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id); in destroyAsec()
840 SLOGE("ASEC destroy failed for %s: couldn't construct mountpoint", id); in destroyAsec()
848 if (unmountAsec(id, force)) { in destroyAsec()
849 SLOGE("Failed to unmount asec %s for destroy (%s)", id, strerror(errno)); in destroyAsec()
860 SLOGD("ASEC %s destroyed", id); in destroyAsec()
883 int VolumeManager::findAsec(const char *id, char *asecPath, size_t asecPathLen, in findAsec() argument
886 const int idLen = strlen(id); in findAsec()
889 if (asprintf(&asecName, "%s.asec", id) < 0) { in findAsec()
911 SLOGE("findAsec failed for %s: couldn't construct ASEC path", id); in findAsec()
921 int VolumeManager::mountAsec(const char *id, const char *key, int ownerUid) { in mountAsec() argument
925 if (findAsec(id, asecFileName, sizeof(asecFileName))) { in mountAsec()
926 SLOGE("Couldn't find ASEC %s", id); in mountAsec()
930 int written = snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id); in mountAsec()
932 SLOGE("ASEC mount failed: couldn't construct mountpoint", id); in mountAsec()
937 SLOGE("ASEC %s already mounted", id); in mountAsec()
943 if (!asecHash(id, idHash, sizeof(idHash))) { in mountAsec()
944 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno)); in mountAsec()
1045 mActiveContainers->push_back(new ContainerData(strdup(id), ASEC)); in mountAsec()
1047 SLOGD("ASEC %s mounted", id); in mountAsec()
1491 char id[ID_BUF_LEN]; in unmountAllAsecsInDir() local
1492 strlcpy(id, dent->d_name, name_len - 4); in unmountAllAsecsInDir()
1493 if (unmountAsec(id, true)) { in unmountAllAsecsInDir()
1562 if (v == getVolumeForFile(cd->id)) { in cleanupAsec()
1572 SLOGI("Unmounting ASEC %s (dependant on %s)", cd->id, v->getMountpoint()); in cleanupAsec()
1573 if (unmountObb(cd->id, force)) { in cleanupAsec()
1574 SLOGE("Failed to unmount OBB %s (%s)", cd->id, strerror(errno)); in cleanupAsec()