mount: check for target before source on remount

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=737091
Reported-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-09-13 22:59:39 +02:00
parent 3a18db62e6
commit 277a6dd535
1 changed files with 7 additions and 2 deletions

View File

@ -272,10 +272,15 @@ getmntfilebackward (const char *name, struct mntentchn *mcprev) {
mc0 = mtab_head();
if (!mcprev)
mcprev = mc0;
for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
if (streq(mc->m.mnt_dir, name) ||
streq(mc->m.mnt_fsname, name))
if (streq(mc->m.mnt_dir, name))
return mc;
for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
if (streq(mc->m.mnt_fsname, name))
return mc;
return NULL;
}