Re: [PATCH] mount: use canonicalize in getfs_by_devname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthias Koenig <mkoenig@xxxxxxx> writes:

> Fixes a problem when you define a device via a persistent
> udev device name in /etc/fstab but use the real block device
> name on mount invocation.
>
> Signed-off-by: Matthias Koenig <mkoenig@xxxxxxx>
> ---
>
>  mount/fstab.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/mount/fstab.c b/mount/fstab.c
> index 03ddf4e..9ed4e5d 100644
> --- a/mount/fstab.c
> +++ b/mount/fstab.c
> @@ -418,11 +418,17 @@ getfs_by_spec (const char *spec) {
>  struct mntentchn *
>  getfs_by_devname (const char *devname) {
>  	struct mntentchn *mc, *mc0;
> +	char *name;
>  
>  	mc0 = fstab_head();
> -	for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
> -		if (streq(mc->m.mnt_fsname, devname))
> +	for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) {
> +		name = canonicalize(mc->m.mnt_fsname);
> +		if (streq(name, devname)) {
> +			free(name);
>  			return mc;
> +		}
> +		free(name);
> +	}
>  	return NULL;
>  }
>  
>

I am dumb, please ignore this patch.
New patch will follow.

Matthias
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux