Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: net/base/net_util.h

Issue 23464037: Net: make IsSafePortableRelativePath look for reserved names on all components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.h
diff --git a/net/base/net_util.h b/net/base/net_util.h
index ecd7400cfa16e516a1d986ea76a807db5faa07a5..7e547d547e3b3c4e68dfddf8c3f61d3b00c7077c 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -298,20 +298,17 @@ NET_EXPORT base::FilePath GenerateFileName(
const std::string& mime_type,
const std::string& default_name);
-// Valid basenames:
+// Valid components:
// * are not empty
// * are not Windows reserved names (CON, NUL.zip, etc.)
-// * are just basenames
// * do not have trailing separators
// * do not equal kCurrentDirectory
// * do not reference the parent directory
-// * are valid path components, which:
-// - * are not the empty string
-// - * do not contain illegal characters
-// - * do not end with Windows shell-integrated extensions (even on posix)
-// - * do not begin with '.' (which would hide them in most file managers)
-// - * do not end with ' ' or '.'
-NET_EXPORT bool IsSafePortableBasename(const base::FilePath& path);
+// * do not contain illegal characters
+// * do not end with Windows shell-integrated extensions (even on posix)
+// * do not begin with '.' (which would hide them in most file managers)
+// * do not end with ' ' or '.'
+NET_EXPORT bool IsSafePortablePathComponent(const base::FilePath& component);
// Basenames of valid relative paths are IsSafePortableBasename(), and internal
// path components of valid relative paths are valid path components as
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698