Lines Matching refs:id

79 char *VolumeManager::asecHash(const char *id, char *buffer, size_t len) {
88 } else if (id == NULL) {
99 MD5(reinterpret_cast<const unsigned char*>(id), strlen(id), sig);
204 int VolumeManager::getAsecMountPath(const char *id, char *buffer, int maxlen) {
207 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
208 SLOGE("Couldn't find ASEC %s", id);
218 snprintf(buffer, maxlen, "%s/%s", Volume::ASECDIR, id);
222 int VolumeManager::getAsecFilesystemPath(const char *id, char *buffer, int maxlen) {
225 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
226 SLOGE("Couldn't find ASEC %s", id);
240 int VolumeManager::createAsec(const char *id, unsigned int numSectors, const char *fstype,
267 if (lookupVolume(id)) {
268 SLOGE("ASEC id '%s' currently exists", id);
275 if (!findAsec(id, asecFileName, sizeof(asecFileName))) {
284 snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", asecDir, id);
310 if (!asecHash(id, idHash, sizeof(idHash))) {
311 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
400 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
442 SLOGI("Created raw secure container %s (no filesystem)", id);
445 mActiveContainers->push_back(new ContainerData(strdup(id), ASEC));
449 int VolumeManager::finalizeAsec(const char *id) {
454 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
455 SLOGE("Couldn't find ASEC %s", id);
460 if (!asecHash(id, idHash, sizeof(idHash))) {
461 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
466 SLOGE("Unable to finalize %s (%s)", id, strerror(errno));
477 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
492 SLOGD("ASEC %s finalized", id);
497 int VolumeManager::fixupAsecPermissions(const char *id, gid_t gid, const char* filename) {
507 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
508 SLOGE("Couldn't find ASEC %s", id);
513 if (!asecHash(id, idHash, sizeof(idHash))) {
514 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
519 SLOGE("Unable fix permissions during lookup on %s (%s)", id, strerror(errno));
530 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
542 SLOGE("Unable remount to fix permissions for %s (%s)", id, strerror(errno));
604 SLOGD("ASEC %s permissions fixed", id);
658 int VolumeManager::unmountAsec(const char *id, bool force) {
662 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
663 SLOGE("Couldn't find ASEC %s", id);
667 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
670 if (!asecHash(id, idHash, sizeof(idHash))) {
671 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
675 return unmountLoopImage(id, idHash, asecFileName, mountPoint, force);
692 int VolumeManager::unmountLoopImage(const char *id, const char *idHash,
695 SLOGE("Unmount request for %s when not mounted", id);
707 SLOGI("Container %s unmounted OK", id);
712 id, i, strerror(errno));
729 SLOGE("Failed to unmount container %s (%s)", id, strerror(errno));
762 if (!strcmp(cd->id, id)) {
774 int VolumeManager::destroyAsec(const char *id, bool force) {
778 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
779 SLOGE("Couldn't find ASEC %s", id);
783 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
789 if (unmountAsec(id, force)) {
790 SLOGE("Failed to unmount asec %s for destroy (%s)", id, strerror(errno));
801 SLOGD("ASEC %s destroyed", id);
824 int VolumeManager::findAsec(const char *id, char *asecPath, size_t asecPathLen,
827 const int idLen = strlen(id);
830 if (asprintf(&asecName, "%s.asec", id) < 0) {
861 int VolumeManager::mountAsec(const char *id, const char *key, int ownerUid) {
865 if (findAsec(id, asecFileName, sizeof(asecFileName))) {
866 SLOGE("Couldn't find ASEC %s", id);
870 snprintf(mountPoint, sizeof(mountPoint), "%s/%s", Volume::ASECDIR, id);
873 SLOGE("ASEC %s already mounted", id);
879 if (!asecHash(id, idHash, sizeof(idHash))) {
880 SLOGE("Hash of '%s' failed (%s)", id, strerror(errno));
981 mActiveContainers->push_back(new ContainerData(strdup(id), ASEC));
983 SLOGD("ASEC %s mounted", id);
1418 char id[ID_BUF_LEN];
1419 strlcpy(id, dent->d_name, name_len - 4);
1420 if (unmountAsec(id, true)) {
1489 if (v == getVolumeForFile(cd->id)) {
1499 SLOGI("Unmounting ASEC %s (dependant on %s)", cd->id, v->getMountpoint());
1500 if (unmountObb(cd->id, force)) {
1501 SLOGE("Failed to unmount OBB %s (%s)", cd->id, strerror(errno));