# # 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. # --- a/tests/api/misc.c +++ b/tests/api/misc.c @@ -313,7 +313,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); ck_assert_msg(res == 0, "Failed to symlink '%s' to '%s': %s", path, dst_path, @@ -424,7 +424,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); @@ -443,7 +443,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); @@ -460,7 +460,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); @@ -479,9 +479,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); @@ -1364,8 +1364,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); @@ -1375,8 +1375,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); @@ -1386,8 +1386,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); @@ -1397,8 +1397,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); @@ -1409,7 +1409,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(); @@ -1421,7 +1421,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(); @@ -1433,7 +1433,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();