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 <raeburn@permabit.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5702 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-07-23 02:00:06 +00:00
parent 209a825360
commit fbdfa8dd64

View File

@@ -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;
}