Skip to content
This repository was archived by the owner on Mar 22, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions fs/src/fs/org/jnode/fs/ntfs/FileRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,26 +500,7 @@ public Iterator<NTFSAttribute> findAttributesByTypeAndName(final int attrTypeID,
if (log.isDebugEnabled()) {
log.debug("findAttributesByTypeAndName(0x" + NumberUtils.hex(attrTypeID, 4) + "," + name + ")");
}

Iterator<NTFSAttribute> attributeIterator;

if (attrTypeID == NTFSAttribute.Types.DATA && referenceNumber == MasterFileTable.SystemFiles.MFT) {
List<NTFSAttribute> attributes = new ArrayList<NTFSAttribute>();
attributes.addAll(getAllStoredAttributes());
attributes.addAll(readAttributeListAttributes(new FileRecordSupplier() {
@Override
public FileRecord getRecord(long referenceNumber) {
// When trying to get the $DATA attribute of the MFT, don't attempt to look up any other records
// to avoid possible infinite recursion
return null;
}
}));
attributeIterator = attributes.iterator();
} else {
attributeIterator = getAllAttributes().iterator();
}

return new FilteredAttributeIterator(attributeIterator) {
return new FilteredAttributeIterator(getAllAttributes().iterator()) {
@Override
protected boolean matches(NTFSAttribute attr) {
if (attr.getAttributeType() == attrTypeID) {
Expand Down