p7zip: assorted fixes
[oi-userland.git] / components / network / proftpd / patches / 024.dir_readlink_test.user_dir.patch
blob888de24a78cc3276ff32e304dbeb0c4274e9cc91
2 # the unit test on Oracle Solaris should not try to create
3 # directories under /home. Moving everything under /tmp
4 # allows it to work on all our test systems. Patch has been
5 # sent to upstream:
6 # https://github.com/proftpd/proftpd/pull/714
7 # the patch will eventually die with future re-sync.
8 # it depends on whether our change will get accepted.
10 diff --git a/tests/api/misc.c b/tests/api/misc.c
11 index 199883488..23bc3a479 100644
12 --- a/tests/api/misc.c
13 +++ b/tests/api/misc.c
14 @@ -307,7 +307,7 @@ START_TEST (dir_readlink_test) {
16 /* Not chrooted, absolute dst path */
17 memset(buf, '\0', bufsz);
18 - dst_path = "/home/user/file.dat";
19 + dst_path = "/tmp/home/user/file.dat";
20 dst_pathlen = strlen(dst_path);
21 res = symlink(dst_path, path);
22 fail_unless(res == 0, "Failed to symlink '%s' to '%s': %s", path, dst_path,
23 @@ -377,7 +377,7 @@ START_TEST (dir_readlink_test) {
24 dst_path, buf);
26 /* Chrooted, absolute destination path shorter than chroot path */
27 - session.chroot_path = "/home/user";
28 + session.chroot_path = "/tmp/home/user";
29 memset(buf, '\0', bufsz);
30 dst_path = "/foo";
31 dst_pathlen = strlen(dst_path);
32 @@ -396,7 +396,7 @@ START_TEST (dir_readlink_test) {
34 /* Chrooted, overlapping chroot to non-dir */
35 memset(buf, '\0', bufsz);
36 - dst_path = "/home/user2";
37 + dst_path = "/tmp/home/user2";
38 dst_pathlen = strlen(dst_path);
40 (void) unlink(path);
41 @@ -413,7 +413,7 @@ START_TEST (dir_readlink_test) {
43 /* Chrooted, absolute destination within chroot */
44 memset(buf, '\0', bufsz);
45 - dst_path = "/home/user/file.txt";
46 + dst_path = "/tmp/home/user/file.txt";
47 dst_pathlen = strlen(dst_path);
48 expected_path = "/file.txt";
49 expected_pathlen = strlen(expected_path);
50 @@ -432,9 +432,9 @@ START_TEST (dir_readlink_test) {
52 /* Chrooted, absolute destination outside of chroot */
53 memset(buf, '\0', bufsz);
54 - dst_path = "/home/user/../file.txt";
55 + dst_path = "/tmp/home/user/../file.txt";
56 dst_pathlen = strlen(dst_path);
57 - expected_path = "/home/file.txt";
58 + expected_path = "/tmp/home/file.txt";
59 expected_pathlen = strlen(expected_path);
61 (void) unlink(path);
62 @@ -1068,8 +1068,8 @@ START_TEST (path_subst_uservar_test) {
63 res);
65 session.user = "user";
66 - original = "/home/%u";
67 - expected = "/home/user";
68 + original = "/tmp/home/%u";
69 + expected = "/tmp/home/user";
70 path = pstrdup(p, original);
71 mark_point();
72 res = path_subst_uservar(p, &path);
73 @@ -1079,8 +1079,8 @@ START_TEST (path_subst_uservar_test) {
74 res);
76 session.user = "user";
77 - original = "/home/%u[";
78 - expected = "/home/user[";
79 + original = "/tmp/home/%u[";
80 + expected = "/tmp/home/user[";
81 path = pstrdup(p, original);
82 mark_point();
83 res = path_subst_uservar(p, &path);
84 @@ -1090,8 +1090,8 @@ START_TEST (path_subst_uservar_test) {
85 res);
87 session.user = "user";
88 - original = "/home/%u[]";
89 - expected = "/home/user[]";
90 + original = "/tmp/home/%u[]";
91 + expected = "/tmp/home/user[]";
92 path = pstrdup(p, original);
93 mark_point();
94 res = path_subst_uservar(p, &path);
95 @@ -1101,8 +1101,8 @@ START_TEST (path_subst_uservar_test) {
96 res);
98 session.user = "user";
99 - original = "/home/users/%u[0]/%u[0]%u[1]/%u";
100 - expected = "/home/users/u/us/user";
101 + original = "/tmp/home/users/%u[0]/%u[0]%u[1]/%u";
102 + expected = "/tmp/home/users/u/us/user";
103 path = pstrdup(p, original);
104 mark_point();
105 res = path_subst_uservar(p, &path);
106 @@ -1113,7 +1113,7 @@ START_TEST (path_subst_uservar_test) {
108 /* Attempt to use an invalid index */
109 session.user = "user";
110 - original = "/home/users/%u[a]/%u[b]%u[c]/%u";
111 + original = "/tmp/home/users/%u[a]/%u[b]%u[c]/%u";
112 expected = original;
113 path = pstrdup(p, original);
114 mark_point();
115 @@ -1125,7 +1125,7 @@ START_TEST (path_subst_uservar_test) {
117 /* Attempt to use an out-of-bounds index */
118 session.user = "user";
119 - original = "/home/users/%u[0]/%u[-1]%u[1]/%u";
120 + original = "/tmp/home/users/%u[0]/%u[-1]%u[1]/%u";
121 expected = original;
122 path = pstrdup(p, original);
123 mark_point();
124 @@ -1137,7 +1137,7 @@ START_TEST (path_subst_uservar_test) {
126 /* Attempt to use an out-of-bounds index */
127 session.user = "user";
128 - original = "/home/users/%u[0]/%u[0]%u[4]/%u";
129 + original = "/tmp/home/users/%u[0]/%u[0]%u[4]/%u";
130 expected = original;
131 path = pstrdup(p, original);
132 mark_point();