Changes by: szaka
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16921/ntfsprogs
Modified Files:
ntfsdecrypt.c
Log Message:
cleanup: use ntfs_attr_readall()
Index: ntfsdecrypt.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsdecrypt.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- ntfsdecrypt.c 18 Dec 2005 16:27:21 -0000 1.27
+++ ntfsdecrypt.c 27 Mar 2006 20:10:39 -0000 1.28
@@ -1128,30 +1128,16 @@ static ntfs_fek *ntfs_df_array_fek_get(E
static ntfs_fek *ntfs_inode_fek_get(ntfs_inode *inode,
ntfs_rsa_private_key rsa_key)
{
- ntfs_attr *na;
EFS_ATTR_HEADER *efs;
EFS_DF_ARRAY_HEADER *df_array;
ntfs_fek *fek = NULL;
/* Obtain the $EFS contents. */
- na = ntfs_attr_open(inode, AT_LOGGED_UTILITY_STREAM, EFS, 4);
- if (!na) {
- ntfs_log_perror("Failed to open $EFS attribute");
- return NULL;
- }
- efs = malloc(na->data_size);
+ efs = ntfs_attr_readall(inode, AT_LOGGED_UTILITY_STREAM, EFS, 4, NULL);
if (!efs) {
- ntfs_log_perror("Failed to allocate internal buffer");
- ntfs_attr_close(na);
- return NULL;
- }
- if (ntfs_attr_pread(na, 0, na->data_size, efs) != na->data_size) {
ntfs_log_perror("Failed to read $EFS attribute");
- free(efs);
- ntfs_attr_close(na);
return NULL;
}
- ntfs_attr_close(na);
/* Iterate through the DDFs & DRFs until we obtain a key. */
if (efs->offset_to_ddf_array) {
df_array = (EFS_DF_ARRAY_HEADER*)((u8*)efs +
|