From 66af9edb6e38c78300f1795201644cfea7c08c2c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 4 Sep 2014 13:44:08 +0000 Subject: [PATCH] Forbid using '.' in PR and mode page file names (merge r5702 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5775 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 9f242ac53..3baead81b 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1345,8 +1345,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; }