X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmount.c;h=ac33787e61e42c8307a3386419dcc7056b566a1d;hb=1afbdcb06b2333c1f5852c049bd5e73b729aa6f0;hp=e0ca5bb5d0dd16f4a015282503dc7aa6c167592e;hpb=c4e2ceae941d02de5574becbfd3b4db15de2eda3;p=elogind.git diff --git a/src/mount.c b/src/mount.c index e0ca5bb5d..ac33787e6 100644 --- a/src/mount.c +++ b/src/mount.c @@ -1175,7 +1175,7 @@ fail: } static char *fstab_node_to_udev_node(char *p) { - char *dn, *t; + char *dn, *t, *u; int r; /* FIXME: to follow udev's logic 100% we need to leave valid @@ -1183,7 +1183,13 @@ static char *fstab_node_to_udev_node(char *p) { if (startswith(p, "LABEL=")) { - if (!(t = xescape(p+6, "/ "))) + if (!(u = unquote(p+6, '"'))) + return NULL; + + t = xescape(u, "/ "); + free(u); + + if (!t) return NULL; r = asprintf(&dn, "/dev/disk/by-label/%s", t); @@ -1197,7 +1203,13 @@ static char *fstab_node_to_udev_node(char *p) { if (startswith(p, "UUID=")) { - if (!(t = xescape(p+5, "/ "))) + if (!(u = unquote(p+5, '"'))) + return NULL; + + t = xescape(u, "/ "); + free(u); + + if (!t) return NULL; r = asprintf(&dn, "/dev/disk/by-uuid/%s", ascii_strlower(t));