Skip to content

Commit

Permalink
creator/find_file(): fix an incorrect error that gets raised.
Browse files Browse the repository at this point in the history
In find_file(), when we're trying to find the device that matches a
mountpoint, we incorrectly raise an error when we find an entry that's
got a longer name than the one we want.  This is incorrect - it's a
special case of what Lans Zhang was fixing in 8eac2d5, in fact.

This case should just reject *that* entry, not set an error and end the
iteration.

Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed Aug 5, 2016
1 parent 1dc6d57 commit 086eeb1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/creator.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ find_file(const char * const filepath, char **devicep, char **relpathp)

if (dsb.st_rdev == fsb.st_dev) {
ssize_t mntlen = strlen(me->mnt_dir);
if (mntlen >= linklen) {
errno = ENAMETOOLONG;
goto err;
}
if (mntlen != linklen)
continue;
if (strncmp(linkbuf, me->mnt_dir, mntlen))
continue;
*devicep = strdup(me->mnt_fsname);
Expand Down

0 comments on commit 086eeb1

Please sign in to comment.