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

Unified Diff: base/file_util.h

Issue 7718021: Add external extensions json source in proper mac location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sss Created 9 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 | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
diff --git a/base/file_util.h b/base/file_util.h
index 133854b5c7c66906cddea171dc15bf98d2a88678..f4f8756bc5505d2a3bfa9aa33712e8f6c1342529 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -43,6 +43,41 @@ class Time;
namespace file_util {
+
+
+
+
+
+
+
Evan Martin 2011/09/21 18:15:24 Probably didn't mean for so much whitespace here a
Sam Kerner (Chrome) 2011/09/21 18:57:07 Trybots have been failing to patch changes to this
+#if defined(OS_POSIX)
+// Test that |path| can only be changed by a specific user and group.
+// Specifically, test that all parts of |path| under and including |base|
+// exist, are owned by a specific user and group, are not writable by all
+// users, and are not symbolic links. This is useful for checking that a
+// config file is administrator-controlled. |base| must contain |path|.
+BASE_EXPORT bool VerifyPathControlledByUser(const FilePath& base,
+ const FilePath* path,
Evan Martin 2011/09/21 18:15:24 Why is this a pointer? If it being NULL has a mea
Sam Kerner (Chrome) 2011/09/21 18:57:07 Fixed.
+ uid_t owner_uid,
+ gid_t group_gid);
+#endif // defined(OS_POSIX)
+
+#if defined(OS_MACOSX)
+// Is |path|writable only by a user with administrator privlages?
+// This function uses Mac OS conventions. It assumes that the superuser
+// has uid 0, and the administrator group is named "admin". Test that
+// |path| and every parent directory (including the root of the
+// filesystem) are owned by the superuser, controlled by the admin
+// group, are not writable by all users, and contain no symbolic links.
+// Will return false if |path| does not exist.
+BASE_EXPORT bool VerifyPathControlledByAdmin(const FilePath& path);
+#endif // defined(OS_MACOSX)
+
+
+
+
+
+
//-----------------------------------------------------------------------------
// Functions that operate purely on a path string w/o touching the filesystem:
Evan Martin 2011/09/21 18:15:24 It looks like this file might be organized into ca
Sam Kerner (Chrome) 2011/09/21 18:57:07 Put them with functions that touch the filesystem.
« no previous file with comments | « no previous file | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698