From 6fd2ddb35068b114b8f4bf1ac0ad30fde0ab0eba Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 19 Jan 2017 11:00:21 +0000 Subject: [PATCH] daemon: Fix part-to-dev when the partition name includes p. If the device name ends with a number, Linux uses partition names of the form p. Handle this case by knocking off the 'p' character. --- daemon/devsparts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 5862ae242..b764f6386 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -203,6 +203,9 @@ do_part_to_dev (const char *part) return NULL; } + if (part[n-1] == 'p') + n--; + char *r = strndup (part, n); if (r == NULL) { reply_with_perror ("strdup");