[disorderfs] 01/01: Support absolute paths by transforming ROOTDIR on startup.

Chris Lamb chris at chris-lamb.co.uk
Tue Sep 13 16:03:41 UTC 2016


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

lamby pushed a commit to branch master
in repository disorderfs.

commit 9e4e2dec1616b49d15e62ff48f905ad9d0d54cc8
Author: Chris Lamb <lamby at debian.org>
Date:   Tue Sep 13 17:03:33 2016 +0100

    Support absolute paths by transforming ROOTDIR on startup.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 disorderfs.cpp | 8 +-------
 tests/common   | 2 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/disorderfs.cpp b/disorderfs.cpp
index 75d38db..3f25398 100644
--- a/disorderfs.cpp
+++ b/disorderfs.cpp
@@ -251,13 +251,7 @@ int	main (int argc, char** argv)
 		return 2;
 	}
 
-	root = bare_arguments[0];
-
-	if (root[0] != '/') {
-		// TODO: support absolute paths by using *at syscalls everywhere, instead of string concatenation.
-		std::clog << "disorderfs: error: ROOTDIR is not an absolute path" << std::endl;
-		return 1;
-	}
+	root = realpath(bare_arguments[0].c_str(), NULL);
 
 	// Add some of our own hard-coded FUSE options:
 	fuse_opt_add_arg(&fargs, "-o");
diff --git a/tests/common b/tests/common
index 17f4f61..3566b3c 100644
--- a/tests/common
+++ b/tests/common
@@ -3,7 +3,7 @@ trap "Unmount 2>/dev/null" EXIT
 Mount () {
 	Unmount
 	mkdir -p target
-	../disorderfs "${@}" "$(pwd)/fixtures/" target/
+	../disorderfs "${@}" fixtures/ target/
 }
 
 Unmount () {

-- 
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