#
# the unit test on Oracle Solaris should not try to create
# directories under /home. Moving everything under /tmp
# allows it to work on all our test systems. Patch has been
# sent to upstream:
#	https://github.com/proftpd/proftpd/pull/714
# the patch will eventually die with future re-sync.
# it depends on whether our change will get accepted.
#
diff --git a/tests/api/misc.c b/tests/api/misc.c
index 199883488..23bc3a479 100644
--- a/tests/api/misc.c
+++ b/tests/api/misc.c
@@ -307,7 +307,7 @@ START_TEST (dir_readlink_test) {
 
   /* Not chrooted, absolute dst path */
   memset(buf, '\0', bufsz);
-  dst_path = "/home/user/file.dat";
+  dst_path = "/tmp/home/user/file.dat";
   dst_pathlen = strlen(dst_path);
   res = symlink(dst_path, path);
   fail_unless(res == 0, "Failed to symlink '%s' to '%s': %s", path, dst_path,
@@ -377,7 +377,7 @@ START_TEST (dir_readlink_test) {
     dst_path, buf);
 
   /* Chrooted, absolute destination path shorter than chroot path */
-  session.chroot_path = "/home/user";
+  session.chroot_path = "/tmp/home/user";
   memset(buf, '\0', bufsz);
   dst_path = "/foo";
   dst_pathlen = strlen(dst_path);
@@ -396,7 +396,7 @@ START_TEST (dir_readlink_test) {
 
   /* Chrooted, overlapping chroot to non-dir */
   memset(buf, '\0', bufsz);
-  dst_path = "/home/user2";
+  dst_path = "/tmp/home/user2";
   dst_pathlen = strlen(dst_path);
 
   (void) unlink(path);
@@ -413,7 +413,7 @@ START_TEST (dir_readlink_test) {
 
   /* Chrooted, absolute destination within chroot */
   memset(buf, '\0', bufsz);
-  dst_path = "/home/user/file.txt";
+  dst_path = "/tmp/home/user/file.txt";
   dst_pathlen = strlen(dst_path);
   expected_path = "/file.txt";
   expected_pathlen = strlen(expected_path);
@@ -432,9 +432,9 @@ START_TEST (dir_readlink_test) {
 
   /* Chrooted, absolute destination outside of chroot */
   memset(buf, '\0', bufsz);
-  dst_path = "/home/user/../file.txt";
+  dst_path = "/tmp/home/user/../file.txt";
   dst_pathlen = strlen(dst_path);
-  expected_path = "/home/file.txt";
+  expected_path = "/tmp/home/file.txt";
   expected_pathlen = strlen(expected_path);
 
   (void) unlink(path);
@@ -1068,8 +1068,8 @@ START_TEST (path_subst_uservar_test) {
     res);
 
   session.user = "user";
-  original = "/home/%u";
-  expected = "/home/user";
+  original = "/tmp/home/%u";
+  expected = "/tmp/home/user";
   path = pstrdup(p, original);
   mark_point();
   res = path_subst_uservar(p, &path);
@@ -1079,8 +1079,8 @@ START_TEST (path_subst_uservar_test) {
     res);
 
   session.user = "user";
-  original = "/home/%u[";
-  expected = "/home/user[";
+  original = "/tmp/home/%u[";
+  expected = "/tmp/home/user[";
   path = pstrdup(p, original);
   mark_point();
   res = path_subst_uservar(p, &path);
@@ -1090,8 +1090,8 @@ START_TEST (path_subst_uservar_test) {
     res);
 
   session.user = "user";
-  original = "/home/%u[]";
-  expected = "/home/user[]";
+  original = "/tmp/home/%u[]";
+  expected = "/tmp/home/user[]";
   path = pstrdup(p, original);
   mark_point();
   res = path_subst_uservar(p, &path);
@@ -1101,8 +1101,8 @@ START_TEST (path_subst_uservar_test) {
     res);
 
   session.user = "user";
-  original = "/home/users/%u[0]/%u[0]%u[1]/%u";
-  expected = "/home/users/u/us/user";
+  original = "/tmp/home/users/%u[0]/%u[0]%u[1]/%u";
+  expected = "/tmp/home/users/u/us/user";
   path = pstrdup(p, original);
   mark_point();
   res = path_subst_uservar(p, &path);
@@ -1113,7 +1113,7 @@ START_TEST (path_subst_uservar_test) {
 
   /* Attempt to use an invalid index */
   session.user = "user";
-  original = "/home/users/%u[a]/%u[b]%u[c]/%u";
+  original = "/tmp/home/users/%u[a]/%u[b]%u[c]/%u";
   expected = original;
   path = pstrdup(p, original);
   mark_point();
@@ -1125,7 +1125,7 @@ START_TEST (path_subst_uservar_test) {
 
   /* Attempt to use an out-of-bounds index */
   session.user = "user";
-  original = "/home/users/%u[0]/%u[-1]%u[1]/%u";
+  original = "/tmp/home/users/%u[0]/%u[-1]%u[1]/%u";
   expected = original;
   path = pstrdup(p, original);
   mark_point();
@@ -1137,7 +1137,7 @@ START_TEST (path_subst_uservar_test) {
 
   /* Attempt to use an out-of-bounds index */
   session.user = "user";
-  original = "/home/users/%u[0]/%u[0]%u[4]/%u";
+  original = "/tmp/home/users/%u[0]/%u[0]%u[4]/%u";
   expected = original;
   path = pstrdup(p, original);
   mark_point();
