[Reproducible-commits] [disorderfs] 03/07: Require rootdir arg to be absolute path, and document in man page

Andrew Ayer agwa at andrewayer.name
Wed Aug 26 20:15:09 UTC 2015


This is an automated email from the git hooks/post-receive script.

agwa-guest pushed a commit to branch debian
in repository disorderfs.

commit a1b41d8771a7e5dcec23be24d7c5fcf8ae79b628
Author: Andrew Ayer <agwa at andrewayer.name>
Date:   Wed Aug 26 21:01:15 2015 +0200

    Require rootdir arg to be absolute path, and document in man page
---
 disorderfs.1.txt | 6 ++++--
 disorderfs.cpp   | 5 +++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/disorderfs.1.txt b/disorderfs.1.txt
index 7d72298..4abf2ef 100644
--- a/disorderfs.1.txt
+++ b/disorderfs.1.txt
@@ -20,8 +20,8 @@ into filesystem metadata.  For example, it can randomize the order
 in which directory entries are read.  This is useful for detecting
 non-determinism in the build process.
 
-'ROOTDIR' is the underlying directory that is to be mirrored, and 'MOUNTPOINT' is
-where the overlay should be mounted.
+'ROOTDIR' is the absolute path to the underlying directory that is to
+be mirrored, and 'MOUNTPOINT' is where the overlay should be mounted.
 
 
 OPTIONS
@@ -49,6 +49,8 @@ within disorderfs itself, but if one process accesses the underlying
 filesystem directly, and another process accesses through disorderfs,
 they won't see each others' locks.
 
+'ROOTDIR' must be specified as an absolute path.
+
 
 AUTHOR
 ------
diff --git a/disorderfs.cpp b/disorderfs.cpp
index 57a8535..c24c2a5 100644
--- a/disorderfs.cpp
+++ b/disorderfs.cpp
@@ -301,6 +301,11 @@ int	main (int argc, char** argv)
 
 	root = bare_arguments[0];
 
+	if (root[0] != '/') {
+		std::clog << "disorderfs: error: ROOTDIR is not an absolute path" << std::endl;
+		return 1;
+	}
+
 	// Add some of our own hard-coded FUSE options:
 	fuse_opt_add_arg(&fargs, "-o");
 	fuse_opt_add_arg(&fargs, "direct_io,atomic_o_trunc"); // XXX: other mount options?

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/disorderfs.git



More information about the Reproducible-commits mailing list