Register FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Fri May 24, 2013 17:18



Post new topic Reply to topic  [ 24 posts ] 
EFS, cannot open for reading, permission denied 
Author Message

Joined: Thu Jan 29, 2009 19:17
Posts: 1
Post EFS, cannot open for reading, permission denied
I am getting an error code "-13" on files which may well be encrypted on an ntfs partition. Is it likely that this is the reason?

Christopher


Thu Jan 29, 2009 20:16
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1645
Post Re: EFS, cannot open for reading, permission denied
Correct. EFS is not supported at the moment.


Thu Jan 29, 2009 20:21
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
I'm trying to use ntfs-3g (on lvm snapshot of a vmware disk image) for backup; as stated above, backup for EFS encrypted files fails with "access denied" at the moment.

Actual decryption of an encrypted file is neither required nor actually wanted behaviour. Instead it would be optimal to backup encrypted data + encryption metadata so a restore of encrypted data + attributes would allow decryption for authorized users in windows.

would the "the backing up ntfs file attributes" thread also cover the encryption metadata? and if so: what's still missing for this usecase be at the moment?

Thanks for your time,

Martin


Fri Feb 27, 2009 15:40
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi,

Quote:
Actual decryption of an encrypted file is neither required nor actually wanted behaviour. Instead it would be optimal to backup encrypted data + encryption metadata so a restore of encrypted data + attributes would allow decryption for authorized users in windows.

AFAIK most encryption metadata are appended to the file itself : signatures and symmetric encryptions keys encrypted with the public keys of all users allowed to decrypt. The secret keys needed to decrypt the symmetric key is withheld by their owners and are not associated to the file. The only thing missing is probably a flag mentioning this a an EFS encrypted file.
Quote:
would the "the backing up ntfs file attributes" thread also cover the encryption metadata?

Not exactly, though it would cover the encryption flags mentioned above.
Quote:
what's still missing for this usecase be at the moment?

The ability to make a raw copy of data and to restore it, keeping track of the encryption status. For instance in a "tar" format there is nothing to record the encryption format.

Regards

Jean-Pierre


Fri Feb 27, 2009 16:07
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi

Quote:
AFAIK most encryption metadata are appended to the file itself : signatures and symmetric encryptions keys encrypted with the public keys of all users allowed to decrypt. The secret keys needed to decrypt the symmetric key is withheld by their owners and are not associated to the file.

Just wanting to fix my mislocated plurals which may cause confusion (there is one signature, one symmetric encryption key and several encrypted symmetric encryption keys) :

"AFAIK most encryption metadata are appended to the file itself : the signature and the symmetric encryption key encrypted with the public keys of all users allowed to decrypt. The secret keys needed to decrypt the symmetric key are withheld by their owners and are not associated to the file."

Regards

Jean-Pierre


Fri Feb 27, 2009 16:21
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
jpa wrote:
AFAIK most encryption metadata are appended to the file itself
doesn't seem to be the case - filesize (both in windows and viewed via NTFS-3G) stays the same as for the unencrypted version.
could the encryption header also be an attribute?

jpa wrote:
Not exactly, though it would cover the encryption flags mentioned above.
I'll see if I can convince the driver to give me access to the raw data first; keeping track of the attributes using a seperate metadata extraction process (using getfattr/setfattr for proof of concept) works just fine for me.

Thanks, Martin


Fri Feb 27, 2009 16:31
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi,

Quote:
doesn't seem to be the case - filesize (both in windows and viewed via NTFS-3G) stays the same as for the unencrypted version

It should. The file size is related to bytes returned to an application. You should check the space on disk (with du, for a file of 4095 bytes, are you getting 4 ? - mind the storage alignment)

Regards

Jean-Pierre


Fri Feb 27, 2009 17:08
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,
Quote:
It should. The file size is related to bytes returned to an application. You should check the space on disk (with du, for a file of 4095 bytes, are you getting 4 ? - mind the storage alignment)

Yes, I'm getting 4 in this case. both from NTFS-3G and from windows properties (size on disk)

Reading of raw data works after disabling the checks for NAttrEncrypted; mapping of NTFS attributes related to Encryption doesn't work yet, have to spend some time on that


Fri Feb 27, 2009 17:31
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi again,

Quote:
Yes, I'm getting 4 in this case. both from NTFS-3G and from windows properties (size on disk)

Strange, and complex to backup.
There is a view of the structure of an encrypted file on
http://technet.microsoft.com/en-us/libr ... 57116.aspx
but I can have wrongly interpreted where the "file header" is located.

Regards

Jean-Pierre


Fri Feb 27, 2009 17:43
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,

Quote:
but I can have wrongly interpreted where the "file header" is located.
there's quite a lot of info regarding the fields & data structures of EFS files already present in layout.h
Code:
/**
* struct LOGGED_UTILITY_STREAM - Attribute: Logged utility stream (0x100).
*
* NOTE: Can be resident or non-resident.
*
* Operations on this attribute are logged to the journal ($LogFile) like
* normal metadata changes.
*
* Used by the Encrypting File System (EFS).  All encrypted files have this
* attribute with the name $EFS.  See below for the relevant structures.
*/

let's see what I manage to break trying to make this visible.

Thanks, Martin


Fri Feb 27, 2009 18:02
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,
Quote:
let's see what I manage to break trying to make this visible.
OK, update:
* reading system.ntfs_attrib to determine if a file is encrypted works just fine:
Code:
[root@filer1 /]# getfattr -e hex -n system.ntfs_attrib mnt/snapshots/sicherung/test_crypto/adr.txt
# file: mnt/snapshots/sicherung/test_crypto/adr.txt
system.ntfs_attrib=0x20400000
400000 is FILE_ATTR_ENCRYPTED

* I've added a new system attribute ntfs_efsinfo that returns the contents of AT_LOGGED_UTILITY_STREAM where NTFS is storing its EFS metadata; it's almost identical to the ntfs_get_ntfs_reparse_data function used for mapping reparse data to an extended attribute.

Code:
[root@filer1 /]# getfattr -e hex -n system.ntfs_efsinfo /mnt/snapshots/sicherung/test_crypto/adr.txt
# file: mnt/snapshots/sicherung/test_crypto/adr.txt
system.ntfs_efsinfo=0xa8040000000000000200000000000000140868e7c75b444fa6648fe98d3532110000000000
[...]
046c12b6629a42f0701329aa4f6448446078fa8591aa71852476443d7fb4577a1c1577d20a3426e887334f29a026c9
b0e20b646d64e43b99cea3c1305155eec9b8e56000000000000

Looks promising so far - haven't done the 2nd part (adding EFS info to a file) - if this actually works, it's one more thing that clonig a volume via ntfs-3g can handle. I'll be back:-)


Mon Mar 02, 2009 16:17
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,
Quote:
Looks promising so far - haven't done the 2nd part (adding EFS info to a file) - if this actually works, it's one more thing that clonig a volume via ntfs-3g can handle. I'll be back:-)

Sigh - that would have been too easy; first effort doesn't work. Comparing the information from ntfsinfo for the original and the copied inode shows a few obvious differences: FILE_ATTR_ENCRYPTED is set not just for the inode itself but also for a couple of other attributes:

Code:
Dumping attribute $STANDARD_INFORMATION (0x10) from mft record 41 (0x29)
        File attributes:         ARCHIVE ENCRYPTED (0x00000000)
Dumping attribute $FILE_NAME (0x30) from mft record 41 (0x29)
        File attributes:         ARCHIVE ENCRYPTED (0x00000000)
        Namespace:               DOS
        Filename:                'ADR_KO~1.TXT'
Dumping attribute $FILE_NAME (0x30) from mft record 41 (0x29)
        File attributes:         ARCHIVE ENCRYPTED (0x00000000)
        Namespace:               Win32
        Filename:                'adr_kopiert.txt'
Dumping attribute $DATA (0x80) from mft record 41 (0x29)
        Attribute flags:         0x4000
Dumping attribute $LOGGED_UTILITY_STREAM (0x100) from mft record 41 (0x29)
        Attribute flags:         0x0000
        Data size:               1192 (0x4a8)
End of inode reached


New file:
Code:
Dumping attribute $STANDARD_INFORMATION (0x10) from mft record 68 (0x44)
        File attributes:         ENCRYPTED (0x00000000)
Dumping attribute $FILE_NAME (0x30) from mft record 68 (0x44)
        File attributes:         (0x00000000)
        Namespace:               POSIX
        Filename:                'adr.txt'
Dumping attribute $DATA (0x80) from mft record 68 (0x44)
        Resident:                No
        Attribute flags:         0x0000
        Attribute instance:      2 (0x2)
        Compression unit:        0 (0x0)
        Data size:               71130 (0x115da)
        Allocated size:          73728 (0x12000)
        Initialized size:        71130 (0x115da)
Dumping attribute $LOGGED_UTILITY_STREAM (0x100) from mft record 69 (0x45)
        Attribute flags:         0x0000
        Data size:               1192 (0x4a8)
End of inode reached


Any pointers on how to change the missing encryption flags would be apreciated :-)

Thanks, Martin


Mon Mar 02, 2009 18:44
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,
mabene wrote:
Code:
Dumping attribute $DATA (0x80) from mft record 41 (0x29)
        Attribute flags:         0x4000

Looks like that was the major problem left.

After adding the AT_ENCRYPTED bit to the flags for the unnamed AT_DATA attribute windows can successfully decrypt the copied file, so backing up/cloning EFS encrypted files actually works.

one difference remains: In windows, the files created on linux don't get get the color coding for encrypted files; instead they show up just like "normal" files - once I select them in file explorer, the color changes and they show up as encrypted.

Currently, the xattr containing the efs info is in the system namespace and does not get returned by listxattr; saving encryped data without the corresponding xattr is however not useful, i.e I wonder if the efs xattr should be listed so rsync/tar w/ xattr support can be used on efs encrypted files?

One known problem so far: handling of encrypted files with resident AT_DATA doesn't seem to work - I end up seeing encrypted data in windows :-(

I've attached a patch with the changes I've made up to now.


Attachments:
File comment: Patch to enable handling of efs encrypted files against ntfs-3g-2009.2.1AR.3
efs.patch.gz [2.8 KiB]
Downloaded 107 times
Tue Mar 31, 2009 16:35
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi,

Quote:
After adding the AT_ENCRYPTED bit to the flags for the unnamed AT_DATA attribute windows can successfully decrypt the copied file, so backing up/cloning EFS encrypted files actually works.

Congratulations !
Quote:
one difference remains: In windows, the files created on linux don't get get the color coding for encrypted files; instead they show up just like "normal" files - once I select them in file explorer, the color changes and they show up as encrypted.

So there must be some residual difference. Can you check whether this is related to the flags in parent directory :
a) clone an encrypted file into a directory which was already marked by Windows as encrypted applied to contained objects,
b) move by Windows an encrypted file into another directory not marked for encryption.
Quote:
Currently, the xattr containing the efs info is in the system namespace and does not get returned by listxattr

It would be reasonable to list the efs info in a listxattr. The ACLs and the reparse point are not because this would lead to contradictions in the saved data, which should not happen with efs.
You have however to check the sequence of actions when restoring by tar or rsync. I suppose you first have to restore the data as if the file was not encrypted, then you set the efs info, which implies the flags.
Quote:
handling of encrypted files with resident AT_DATA doesn't seem to work - I end up seeing encrypted data in windows

Have you checked this to be possible on Windows : create a small file (eg less than 100 bytes) and check whether Windows stores the data as resident and encrypted.

Regards

Jean-Pierre


Tue Mar 31, 2009 21:52
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,
jpa wrote:
So there must be some residual difference. Can you check whether this is related to the flags in parent directory :
a) clone an encrypted file into a directory which was already marked by Windows as encrypted applied to contained objects,
b) move by Windows an encrypted file into another directory not marked for encryption.

Tried that - no difference; the files created by linux show up as normal files and change color once I select them in windows. Tried comparing ntfsinfo data before/after windows access: we get a new attribute (+ a new entry in the attribute list)
Code:
Dumping attribute $OBJECT_ID (0x40) from mft record 100 (0x64)
        Attribute length:        40 (0x28)
        Resident:                Yes
        Name length:             0 (0x0)
        Name offset:             0 (0x0)
        Attribute flags:         0x0000
        Attribute instance:      5 (0x5)
        Data size:               16 (0x10)
        Data offset:             24 (0x18)
        Resident flags:          0x00
        ReservedR:               0 (0x0)
        Object ID:               33a9a1ce-8a1e-de11-bf8a-000c2995dda3
        Birth Volume ID:         missing
        Birth Object ID:         missing
        Domain ID:               missing

I don't really see why existence of an object ID would change how a file is displayed but I'll try to see what happens if I add one..

Quote:
You have however to check the sequence of actions when restoring by tar or rsync. I suppose you first have to restore the data as if the file was not encrypted, then you set the efs info, which implies the flags.

Good point, have to see how tar/rsync handle this. I tried adding an entry to list in ntfs_fuse_listxattr (src/ntfs3g.c) - looks like I'm trying something stupid here, I get a segfault when using getfattr --dump.

Quote:
Have you checked this to be possible on Windows : create a small file (eg less than 100 bytes) and check whether Windows stores the data as resident and encrypted.
It doesn't. Looks like encrypted data MUST be non-resident. Created a small file, data is resident. encrypt it ==> data is no longer resident. looks like I need to make the data atrribute non-resident when adding efs data as well - should be easy using ntfs_attr_make_non_resident, right?

Thanks for your feedback

Martin


Wed Apr 01, 2009 11:39
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi Martin,

Quote:
Tried comparing ntfsinfo data before/after windows access: we get a new attribute (+ a new entry in the attribute list)

Hum, this is an unknown area to me. The object ID could be related to some other data.
Quote:
I tried adding an entry to list in ntfs_fuse_listxattr (src/ntfs3g.c) - looks like I'm trying something stupid here, I get a segfault when using getfattr --dump.

Should be easy to fix. But I remember fuse filters non-user extended-attributes, so you might be in a dead end !
Quote:
I need to make the data atrribute non-resident when adding efs data as well - should be easy using ntfs_attr_make_non_resident, right?

Yes, that is the way to do it.

Regards

Jean-Pierre


Wed Apr 01, 2009 11:59
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi Jean-Pierre,
jpa wrote:
Hum, this is an unknown area to me. The object ID could be related to some other data.
I know now that the object ID isn't relevant. The Info used for choosing the directory color in windows comes from the index entry in the directory inode:
Code:
                Entry length:            120 (0x78)
                Key length:              104 (0x68)
                Index entry flags:       0x00
                FILE record number:      88 (0x58)
                Parent directory:        73 (0x49)
                File Creation Time:      Tue Mar 31 13:52:19 2009
                File Altered Time:       Fri Jun 17 14:44:22 2005
                MFT Changed Time:        Tue Mar 31 13:52:53 2009
                Last Accessed Time:      Wed Apr  1 09:00:35 2009
                Allocated Size:          4096 (0x1000)
                Data Size:               39 (0x27)
                Filename Length:         19 (0x13)
                File attributes:         ARCHIVE ENCRYPTED (0x00000000)
                Namespace:               Win32
                Filename:                'encrypted_testfile.txt'
So far, I haven't set the ENCRYPTED Flag in the Index entry, and I'm not sure yet how to go about that. renaming an encrypted file results in an index entry with correctly set flags btw, so copies made by rsync turn out OK (rsync writes a temp file, restores xattrs to the temp file and finaly renames it). Display color in windows is correct.

Quote:
But I remember fuse filters non-user extended-attributes, so you might be in a dead end !
You're quite right there. I haven't actually seen where this filtering takes place yet, but "system." attributes definitely don't show up in listxattr while "user." attributes do. Currently I've just changed the attribute name to user.ntfs_efsinfo which does not match the other special attributes. On the other hand, I've just seen that rsync also filters xattrs: system xattrs are never copied, non-user xatrrs are copied only for user root. So I guess puting the attribute into user space might be best after all?

With the attribute in user namesapce and the bug in ntfs_fuse_listxattr fixed, I can now copy efs encrypted files/directories using rsync.

Found that directory inodes can also have an LOGGED_UTILITY_STREAM attribute, even though there's no encrypted data at this level; this seems to tell windows how to treat new files in the directory. Not a problem, just have to make sure I don't try to change a non-existing unnamed AT_DATA attribute for a directory inode.

Making resident $DATA attributes non-resident doesn't seem to be as easy as I thought: "na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0);" returns an error.
For the call ntfs_attr_make_non_resident I need both a search context and an ntfs_attr. Is the sequence (minus all checks)
Code:
na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0);
ctx = ntfs_attr_get_search_ctx(ni, NULL);
ntfs_attr_lookup(AT_DATA, AT_UNNAMED, 0, 0, 0, NULL, 0, ctx);
ntfs_attr_make_non_resident(na, ctx);
reasonable or am I trying something stupid here?

Thanks, Martin

-


Tue Apr 07, 2009 17:04
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi Martin,

Quote:
The Info used for choosing the directory color in windows comes from the index entry in the directory inode:

Which field ? Could it be the attribute flag in the $INDEX_ROOT of parent directory ?
Quote:
renaming an encrypted file results in an index entry with correctly set flags btw, so copies made by rsync turn out OK

The exact criterion must still be understood. You would not want your files be made unusable by some process (eg chkdisk).
Quote:
Currently I've just changed the attribute name to user.ntfs_efsinfo which does not match the other special attributes

user namespace is meant for user applications and not supposed to be file system dependent. But you might view encryption as an user application service also meaningful on ext3. Anyway you may have no choice.
Quote:
Making resident $DATA attributes non-resident doesn't seem to be as easy as I thought: "na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0);" returns an error.

Which error and what is your sequence of actions ? Has your data been entered before you make the attribute non-resident ? Is this before you set the encryption flags ? You may violate some constraint not applicable to encrypted files.
Quote:
Is the sequence [...] reasonable or am I trying something stupid here?

This is roughly what is done in ntfs_resident_attr_resize(), you probably need to search deeper.

Regards

Jean-Pierre


Wed Apr 08, 2009 10:48
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi Jean-Pierre,
jpa wrote:
Which field ? Could it be the attribute flag in the $INDEX_ROOT of parent directory ?
I'm talking about the directory entries for the actual files (found in $INDEX_ALLOCATION in my case). The dump in my previous message is one of the index entries from the index block. Each directory entry has a copy of the referenced inodes File attributes. Turns out to be quite easy to fix: I just added a call to NInoFileNameSetDirty, which results in these flags being updated.
jpa wrote:
The exact criterion must still be understood. You would not want your files be made unusable by some process (eg chkdisk).
Definitely. I'd say we can tag this as understood. Windows currently seems to be quite tolerant about mismatched info in the directory entry and the inode itself but we sure don't want to depend on this.
jpa wrote:
user namespace is meant for user applications and not supposed to be file system dependent. But you might view encryption as an user application service also meaningful on ext3. Anyway you may have no choice.
Looks like I've got no choice. The efs info needs to be preserved across different filesystems (i.e: backup efs encrypted files to ext3 or to xfs). This + fuse filtering of system attributes in listxattr + rsync not replicating system attributes means I'm stuck with a user attribute.
jpa wrote:
Which error and what is your sequence of actions
sequence of actions turns out to have been the culprit. I ran into a sanity check in attrib.c (Inode 138 has corrupt attribute flags (0x0 <> 0x4000): Input/output error) because I had set the encrypted flag on the inode too early.
Current code now handles:
- EFS Info at directory level (display color, automaticaly encrypt new files added to the directory)
- add EFS info to files with resident AT_DATA Attribute (make non-resident)
- list efs attribute so tar/rsync can transparently handle it
I'd say this has now reached "works for me" status, i.e I can use ntfs-3g for backups and restore the backed up data even if it's been encrypted using efs.
I've attached a patch with my efs related changes.

Thanks again for your help & input!


Attachments:
File comment: patch for EFS copy/restore support, against ntfs-3g-2009.2.1AR.3
efs_02.patch.gz [3.37 KiB]
Downloaded 98 times
Wed Apr 08, 2009 13:55
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi again,

Quote:
I'm talking about the directory entries for the actual files (found in $INDEX_ALLOCATION in my case). The dump in my previous message is one of the index entries from the index block

Do you mean this field (in red) ?

File attributes: ARCHIVE ENCRYPTED (0x00000000)
Namespace: Win32
Filename: 'encrypted_testfile.txt'

Quote:
Current code now handles:
- EFS Info at directory level (display color, automaticaly encrypt new files added to the directory)
- add EFS info to files with resident AT_DATA Attribute (make non-resident)
- list efs attribute so tar/rsync can transparently handle it

This is a very nice achievement, congratulations.
Quote:
I'd say this has now reached "works for me" status, i.e I can use ntfs-3g for backups and restore the backed up data even if it's been encrypted using efs.
I've attached a patch with my efs related changes.

I would like to make my own tests in order to decide whether I include this in the advanced version together with data compression which shares parts of code (adaptations obviously needed). This is planned for June, so you have time to check the pre-release versions.
Can you post (or deposit on a server) a tar file with sample encrypted files for me to test ? Also a copyright notice to include into the modified source files). You can use the "pm" for confidential matters.

Regards

Jean-Pierre


Wed Apr 08, 2009 14:54
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,
Quote:
I'd say this has now reached "works for me" status, i.e I can use ntfs-3g for backups and restore the backed up data even if it's been encrypted using efs.
I've attached a patch with my efs related changes.

Guess what: it wasn't that easy. I found problems with the last few bytes of files created in linux being corrupted when reading/decrypting them in windows. A new patch should now fix this issue. Also, alternate data streams are now supported. To enable reading of encrypted files, you must specify the mount option "efs_read_raw".


Attachments:
File comment: Patch for efs backup/restore support based on ntfs-3g-2009.4.4AA.4.tgz
efs_04.patch.gz [5.31 KiB]
Downloaded 117 times
Wed Apr 15, 2009 13:30
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi Martin,

Very interesting.

Quote:
found problems with the last few bytes of files created in linux being corrupted when reading/decrypting them in windows. A new patch should now fix this issue.

Encryption schemes generally operate on fixed size blocks, so the last block has to be padded to appropriate size. As a consequence, after encryption, part of original information is located beyond the apparent file size.
Quote:
Guess what: it wasn't that easy.

Sure it was not. Congratulations.

Regards

Jean-Pierre


Wed Apr 15, 2009 15:06
Profile

Joined: Fri Feb 27, 2009 15:08
Posts: 12
Post Re: EFS, cannot open for reading, permission denied
Hi,

OK; another patch:
* efs_info xattr is just a simple dump of the logged_data_stream attribute
* info about number of padding bytes gets appended to the AT_DATA streams
* couple of bugfixes


Attachments:
File comment: Patch for efs backup/restore support based on ntfs-3g-2009.4.4AA.4.tgz
efs_07.patch.gz [6.56 KiB]
Downloaded 99 times
Fri Apr 17, 2009 16:30
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1010
Post Re: EFS, cannot open for reading, permission denied
Hi Martin,

Good job !

I will test your patch, and let you know what the tests show.

Regards

Jean-Pierre


Fri Apr 17, 2009 21:09
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.