aboutsummaryrefslogtreecommitdiff
path: root/src/lib/fs/dir.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-27 09:40:21 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-27 12:30:11 -0400
commit1e2e0f7e461b4518b123c4050c3dbc786ac422c4 (patch)
tree65fd14c74582fe2edccba0cc865c347d8b79712b /src/lib/fs/dir.h
parent3246c114a20da44064f7fae8eb6b6712e708a700 (diff)
downloadtor-1e2e0f7e461b4518b123c4050c3dbc786ac422c4.tar.gz
tor-1e2e0f7e461b4518b123c4050c3dbc786ac422c4.zip
Extract functions from compat.c and util.h into a new fs library
Diffstat (limited to 'src/lib/fs/dir.h')
-rw-r--r--src/lib/fs/dir.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/fs/dir.h b/src/lib/fs/dir.h
new file mode 100644
index 0000000000..925211fbd6
--- /dev/null
+++ b/src/lib/fs/dir.h
@@ -0,0 +1,27 @@
+/* Copyright (c) 2003-2004, Roger Dingledine
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef TOR_DIR_H
+#define TOR_DIR_H
+
+#include "lib/cc/compat_compiler.h"
+#include "lib/testsupport/testsupport.h"
+
+/** Possible behaviors for check_private_dir() on encountering a nonexistent
+ * directory; see that function's documentation for details. */
+typedef unsigned int cpd_check_t;
+#define CPD_NONE 0
+#define CPD_CREATE (1u << 0)
+#define CPD_CHECK (1u << 1)
+#define CPD_GROUP_OK (1u << 2)
+#define CPD_GROUP_READ (1u << 3)
+#define CPD_CHECK_MODE_ONLY (1u << 4)
+#define CPD_RELAX_DIRMODE_CHECK (1u << 5)
+MOCK_DECL(int, check_private_dir, (const char *dirname, cpd_check_t check,
+ const char *effective_user));
+
+MOCK_DECL(struct smartlist_t *, tor_listdir, (const char *dirname));
+
+#endif