Skip to content

Commit

Permalink
Some minor fixes and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnivan committed Aug 1, 2014
1 parent ed199fa commit d25387b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/efs.c
Expand Up @@ -117,6 +117,7 @@ static int encrypt_storage(char *storage_path, char *passwd)
key_storage_path);
if (ret < 0) {
LOGE("Error mounting %s", private_dir_path);
remove_dir(key_storage_path);
return ret;
}

Expand All @@ -125,10 +126,9 @@ static int encrypt_storage(char *storage_path, char *passwd)
LOGE("Error copy data to private storage %s",
private_dir_path);
/* Try to fail gracefully */
remove_dir_content(private_dir_path);
umount_ecryptfs(private_dir_path);
remove(private_dir_path);
remove(key_storage_path);
remove_dir(private_dir_path);
remove_dir(key_storage_path);
return ret;
}

Expand Down Expand Up @@ -516,6 +516,7 @@ int EFS_recover_data_and_remove(char *storage_path, char *passwd)
if (ret < 0) {
LOGE("Error mounting private storage %s to %s",
private_dir_path, recovery_path);
remove_dir(recovery_path);
return ret;
}

Expand Down
5 changes: 5 additions & 0 deletions src/file_utils.c
Expand Up @@ -620,6 +620,11 @@ static int copy_files(file_info ** file_list, const char *src_path, const char *

iter = iter->next;
}

ret = property_set(property, "100");
if (ret < 0) {
LOGE("property_set");
}
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/key_chain.c
Expand Up @@ -88,7 +88,7 @@ int add_ecryptfs_key(unsigned char *key, char *sig, unsigned char *salt)
if (ret == -1) {
ret = -errno;
LOGE("Error adding key with sig %s; ret = [%d]\n : %s", sig,
errno, strerror(ret));
errno, strerror(errno));
if (ret == -EDQUOT)
LOGE("Error adding key to keyring - keyring is full\n");
return ret;
Expand Down

0 comments on commit d25387b

Please sign in to comment.