From fbdfa8dd64e0ce138a787ed9e3bc53ee334d1a11 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 23 Jul 2014 02:00:06 +0000 Subject: [PATCH] Prevent possible collisions between saved PR and mode pages backup files From now on '.' is illegal character in SCST device names Reported-by Ken Raeburn git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5702 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index a4c999696..97bf90fea 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1353,8 +1353,18 @@ static int scst_check_device_name(const char *dev_name) PRINT_ERROR("Dev name %s contains illegal character '/'", dev_name); res = -EINVAL; + goto out; } + /* To prevent collision with saved PR and mode pages backup files */ + if (strchr(dev_name, '.') != NULL) { + PRINT_ERROR("Dev name %s contains illegal character '.'", + dev_name); + res = -EINVAL; + goto out; + } + +out: TRACE_EXIT_RES(res); return res; }