From 6c36767acfbc6f72ad7ffed298200088b9bb123b Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Fri, 23 Nov 2012 17:21:33 +0200 Subject: [PATCH 1/2] libdm: add "|" to _is_whitelisted_char() The issue is that EVMS' lvm2 plugin would yield names like "/dev/mapper/lvm2|vg|lv" and the current libdevmapper will turn these down; this makes migrating legacy environments involving devmapper-aware tools in the target configuration a somewhat harder task than it might be. There's a potential security consideration with any faulty scripts which wouldn't get device names quoted as noted by asalor on #device-mapper; this is rather mitigated by the fact that one needs to have EVMS activated for the devices in question, even if these are USB flash ones. Speaking of such scripts, these are prone to misbehave upon "=" either. --- libdm/libdm-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index afdac89..e715629 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -320,7 +320,7 @@ static int _is_whitelisted_char(char c) if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || - strchr("#+-.:=@_", c) != NULL) + strchr("#+-.:=@_|", c) != NULL) return 1; return 0; -- 1.7.12.4