diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-20 02:46:15 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-20 02:46:15 +0200 |
commit | 11ce3427242b8b4ddf638ed5703d69041d719b4c (patch) | |
tree | 42470b61324288d4bc08f21c5126a32521ce3b76 /src/mount.c | |
parent | 049f86421bfe8afcbb00c7ee5a76fd14841f8bbf (diff) |
mount: properly handle LABEL="" in fstab
Diffstat (limited to 'src/mount.c')
-rw-r--r-- | src/mount.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mount.c b/src/mount.c index e0ca5bb5d0..ac33787e61 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)); |