diff --git a/ChangeLog b/ChangeLog index 94fe6811..7dd7c838 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ xx/xx/2005 - 1.12.2-WIP - Fix bogus le16_to_cpu() which shouldbe le32_to_cpu() when accessing the attribute list entry attribute type in some places in libntfs/attrib.c. (Anton) + - Fix silly bug introduced in 1.12.0 which breaks ntfsfix (and others + possibly) when calling ntfs_attr_lookup() with AT_UNNAMED name and + no ntfs inode in the search context. (Anton) 10/10/2005 - 1.12.1 - Minor fix to location of mount.ntfs-fuse and mkfs.ntfs. diff --git a/libntfs/attrib.c b/libntfs/attrib.c index 8ca7e857..4578f3ad 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -1576,7 +1576,7 @@ static int ntfs_attr_find(const ATTR_TYPES type, const ntfschar *name, upcase = vol->upcase; upcase_len = vol->upcase_len; } else { - if (name) { + if (name && name != AT_UNNAMED) { errno = EINVAL; return -1; } @@ -2187,9 +2187,9 @@ int ntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name, ntfs_volume *vol; ntfs_inode *base_ni; - if (!ctx || !ctx->mrec || !ctx->attr || (name && (!ctx->ntfs_ino || - !(vol = ctx->ntfs_ino->vol) || !vol->upcase || - !vol->upcase_len))) { + if (!ctx || !ctx->mrec || !ctx->attr || (name && name != AT_UNNAMED && + (!ctx->ntfs_ino || !(vol = ctx->ntfs_ino->vol) || + !vol->upcase || !vol->upcase_len))) { errno = EINVAL; return -1; }