]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/test/test-fs-util.c
copy: wrap some unlink() calls in (void) casts
[thirdparty/systemd.git] / src / test / test-fs-util.c
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
c270684a
RC
2/***
3 This file is part of systemd.
4
5 Copyright 2010 Lennart Poettering
6
7 systemd is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
11
12 systemd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with systemd; If not, see <http://www.gnu.org/licenses/>.
19***/
20
21#include <unistd.h>
22
23#include "alloc-util.h"
c270684a 24#include "fd-util.h"
1ed34d75 25#include "fd-util.h"
d944dc95 26#include "fileio.h"
c270684a 27#include "fs-util.h"
1ed34d75 28#include "id128-util.h"
c270684a
RC
29#include "macro.h"
30#include "mkdir.h"
d944dc95 31#include "path-util.h"
c270684a 32#include "rm-rf.h"
1ed34d75 33#include "stdio-util.h"
c270684a
RC
34#include "string-util.h"
35#include "strv.h"
f14f1806 36#include "user-util.h"
c270684a
RC
37#include "util.h"
38
d944dc95
LP
39static void test_chase_symlinks(void) {
40 _cleanup_free_ char *result = NULL;
41 char temp[] = "/tmp/test-chase.XXXXXX";
b12d25a8 42 const char *top, *p, *pslash, *q, *qslash;
1ed34d75 43 int r, pfd;
d944dc95
LP
44
45 assert_se(mkdtemp(temp));
46
47 top = strjoina(temp, "/top");
48 assert_se(mkdir(top, 0700) >= 0);
49
50 p = strjoina(top, "/dot");
51 assert_se(symlink(".", p) >= 0);
52
53 p = strjoina(top, "/dotdot");
54 assert_se(symlink("..", p) >= 0);
55
56 p = strjoina(top, "/dotdota");
57 assert_se(symlink("../a", p) >= 0);
58
59 p = strjoina(temp, "/a");
60 assert_se(symlink("b", p) >= 0);
61
62 p = strjoina(temp, "/b");
63 assert_se(symlink("/usr", p) >= 0);
64
65 p = strjoina(temp, "/start");
66 assert_se(symlink("top/dot/dotdota", p) >= 0);
67
df878e68
ZJS
68 /* Paths that use symlinks underneath the "root" */
69
c4f4fce7 70 r = chase_symlinks(p, NULL, 0, &result);
a9fb0867 71 assert_se(r > 0);
d944dc95 72 assert_se(path_equal(result, "/usr"));
b12d25a8 73 result = mfree(result);
d944dc95 74
b12d25a8
ZJS
75 pslash = strjoina(p, "/");
76 r = chase_symlinks(pslash, NULL, 0, &result);
77 assert_se(r > 0);
78 assert_se(path_equal(result, "/usr/"));
d944dc95 79 result = mfree(result);
b12d25a8 80
c4f4fce7 81 r = chase_symlinks(p, temp, 0, &result);
d944dc95
LP
82 assert_se(r == -ENOENT);
83
b12d25a8
ZJS
84 r = chase_symlinks(pslash, temp, 0, &result);
85 assert_se(r == -ENOENT);
86
d944dc95 87 q = strjoina(temp, "/usr");
a9fb0867 88
cb638b5e 89 r = chase_symlinks(p, temp, CHASE_NONEXISTENT, &result);
a9fb0867
LP
90 assert_se(r == 0);
91 assert_se(path_equal(result, q));
b12d25a8 92 result = mfree(result);
a9fb0867 93
b12d25a8 94 qslash = strjoina(q, "/");
d944dc95 95
b12d25a8
ZJS
96 r = chase_symlinks(pslash, temp, CHASE_NONEXISTENT, &result);
97 assert_se(r == 0);
98 assert_se(path_equal(result, qslash));
f4b85a0f 99 result = mfree(result);
b12d25a8
ZJS
100
101 assert_se(mkdir(q, 0700) >= 0);
102
c4f4fce7 103 r = chase_symlinks(p, temp, 0, &result);
a9fb0867 104 assert_se(r > 0);
d944dc95 105 assert_se(path_equal(result, q));
b12d25a8
ZJS
106 result = mfree(result);
107
108 r = chase_symlinks(pslash, temp, 0, &result);
109 assert_se(r > 0);
110 assert_se(path_equal(result, qslash));
111 result = mfree(result);
d944dc95
LP
112
113 p = strjoina(temp, "/slash");
114 assert_se(symlink("/", p) >= 0);
115
c4f4fce7 116 r = chase_symlinks(p, NULL, 0, &result);
a9fb0867 117 assert_se(r > 0);
d944dc95 118 assert_se(path_equal(result, "/"));
d944dc95 119 result = mfree(result);
b12d25a8 120
c4f4fce7 121 r = chase_symlinks(p, temp, 0, &result);
a9fb0867 122 assert_se(r > 0);
d944dc95 123 assert_se(path_equal(result, temp));
b12d25a8 124 result = mfree(result);
d944dc95 125
df878e68
ZJS
126 /* Paths that would "escape" outside of the "root" */
127
128 p = strjoina(temp, "/6dots");
129 assert_se(symlink("../../..", p) >= 0);
130
c4f4fce7 131 r = chase_symlinks(p, temp, 0, &result);
a9fb0867 132 assert_se(r > 0 && path_equal(result, temp));
b12d25a8 133 result = mfree(result);
df878e68
ZJS
134
135 p = strjoina(temp, "/6dotsusr");
136 assert_se(symlink("../../../usr", p) >= 0);
137
c4f4fce7 138 r = chase_symlinks(p, temp, 0, &result);
a9fb0867 139 assert_se(r > 0 && path_equal(result, q));
b12d25a8 140 result = mfree(result);
df878e68
ZJS
141
142 p = strjoina(temp, "/top/8dotsusr");
143 assert_se(symlink("../../../../usr", p) >= 0);
144
c4f4fce7 145 r = chase_symlinks(p, temp, 0, &result);
a9fb0867 146 assert_se(r > 0 && path_equal(result, q));
b12d25a8 147 result = mfree(result);
df878e68
ZJS
148
149 /* Paths that contain repeated slashes */
150
d944dc95
LP
151 p = strjoina(temp, "/slashslash");
152 assert_se(symlink("///usr///", p) >= 0);
153
c4f4fce7 154 r = chase_symlinks(p, NULL, 0, &result);
a9fb0867 155 assert_se(r > 0);
d944dc95 156 assert_se(path_equal(result, "/usr"));
d944dc95 157 result = mfree(result);
b12d25a8 158
c4f4fce7 159 r = chase_symlinks(p, temp, 0, &result);
a9fb0867 160 assert_se(r > 0);
d944dc95 161 assert_se(path_equal(result, q));
b12d25a8 162 result = mfree(result);
d944dc95 163
df878e68
ZJS
164 /* Paths using . */
165
c4f4fce7 166 r = chase_symlinks("/etc/./.././", NULL, 0, &result);
a9fb0867 167 assert_se(r > 0);
d944dc95 168 assert_se(path_equal(result, "/"));
d944dc95 169 result = mfree(result);
b12d25a8 170
c4f4fce7 171 r = chase_symlinks("/etc/./.././", "/etc", 0, &result);
a9fb0867 172 assert_se(r > 0 && path_equal(result, "/etc"));
d944dc95 173 result = mfree(result);
b12d25a8 174
95f35ccc
YW
175 r = chase_symlinks("/../.././//../../etc", NULL, 0, &result);
176 assert_se(r > 0);
177 assert_se(streq(result, "/etc"));
178 result = mfree(result);
179
180 r = chase_symlinks("/../.././//../../test-chase.fsldajfl", NULL, CHASE_NONEXISTENT, &result);
181 assert_se(r == 0);
182 assert_se(streq(result, "/test-chase.fsldajfl"));
183 result = mfree(result);
184
185 r = chase_symlinks("/../.././//../../etc", "/", CHASE_PREFIX_ROOT, &result);
186 assert_se(r > 0);
187 assert_se(streq(result, "/etc"));
188 result = mfree(result);
189
190 r = chase_symlinks("/../.././//../../test-chase.fsldajfl", "/", CHASE_PREFIX_ROOT|CHASE_NONEXISTENT, &result);
191 assert_se(r == 0);
192 assert_se(streq(result, "/test-chase.fsldajfl"));
193 result = mfree(result);
194
c4f4fce7 195 r = chase_symlinks("/etc/machine-id/foo", NULL, 0, &result);
d944dc95 196 assert_se(r == -ENOTDIR);
b12d25a8 197 result = mfree(result);
d944dc95 198
df878e68
ZJS
199 /* Path that loops back to self */
200
d944dc95
LP
201 p = strjoina(temp, "/recursive-symlink");
202 assert_se(symlink("recursive-symlink", p) >= 0);
c4f4fce7 203 r = chase_symlinks(p, NULL, 0, &result);
d944dc95
LP
204 assert_se(r == -ELOOP);
205
a9fb0867
LP
206 /* Path which doesn't exist */
207
208 p = strjoina(temp, "/idontexist");
209 r = chase_symlinks(p, NULL, 0, &result);
210 assert_se(r == -ENOENT);
211
cb638b5e 212 r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
a9fb0867
LP
213 assert_se(r == 0);
214 assert_se(path_equal(result, p));
215 result = mfree(result);
216
217 p = strjoina(temp, "/idontexist/meneither");
218 r = chase_symlinks(p, NULL, 0, &result);
219 assert_se(r == -ENOENT);
220
cb638b5e 221 r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
a9fb0867
LP
222 assert_se(r == 0);
223 assert_se(path_equal(result, p));
224 result = mfree(result);
225
226 /* Path which doesn't exist, but contains weird stuff */
227
228 p = strjoina(temp, "/idontexist/..");
229 r = chase_symlinks(p, NULL, 0, &result);
230 assert_se(r == -ENOENT);
231
cb638b5e 232 r = chase_symlinks(p, NULL, CHASE_NONEXISTENT, &result);
a9fb0867
LP
233 assert_se(r == -ENOENT);
234
877777d7
CCW
235 p = strjoina(temp, "/target");
236 q = strjoina(temp, "/top");
237 assert_se(symlink(q, p) >= 0);
238 p = strjoina(temp, "/target/idontexist");
239 r = chase_symlinks(p, NULL, 0, &result);
240 assert_se(r == -ENOENT);
241
f14f1806
LP
242 if (geteuid() == 0) {
243 p = strjoina(temp, "/priv1");
244 assert_se(mkdir(p, 0755) >= 0);
245
246 q = strjoina(p, "/priv2");
247 assert_se(mkdir(q, 0755) >= 0);
248
249 assert_se(chase_symlinks(q, NULL, CHASE_SAFE, NULL) >= 0);
250
251 assert_se(chown(q, UID_NOBODY, GID_NOBODY) >= 0);
252 assert_se(chase_symlinks(q, NULL, CHASE_SAFE, NULL) >= 0);
253
254 assert_se(chown(p, UID_NOBODY, GID_NOBODY) >= 0);
255 assert_se(chase_symlinks(q, NULL, CHASE_SAFE, NULL) >= 0);
256
257 assert_se(chown(q, 0, 0) >= 0);
258 assert_se(chase_symlinks(q, NULL, CHASE_SAFE, NULL) == -EPERM);
259
260 assert_se(rmdir(q) >= 0);
261 assert_se(symlink("/etc/passwd", q) >= 0);
262 assert_se(chase_symlinks(q, NULL, CHASE_SAFE, NULL) == -EPERM);
263
264 assert_se(chown(p, 0, 0) >= 0);
265 assert_se(chase_symlinks(q, NULL, CHASE_SAFE, NULL) >= 0);
266 }
267
1ed34d75
LP
268 p = strjoina(temp, "/machine-id-test");
269 assert_se(symlink("/usr/../etc/./machine-id", p) >= 0);
270
271 pfd = chase_symlinks(p, NULL, CHASE_OPEN, NULL);
272 if (pfd != -ENOENT) {
273 char procfs[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(pfd) + 1];
274 _cleanup_close_ int fd = -1;
275 sd_id128_t a, b;
276
277 assert_se(pfd >= 0);
278
279 xsprintf(procfs, "/proc/self/fd/%i", pfd);
280
281 fd = open(procfs, O_RDONLY|O_CLOEXEC);
282 assert_se(fd >= 0);
283
284 safe_close(pfd);
285
286 assert_se(id128_read_fd(fd, ID128_PLAIN, &a) >= 0);
287 assert_se(sd_id128_get_machine(&b) >= 0);
288 assert_se(sd_id128_equal(a, b));
289 }
290
d944dc95
LP
291 assert_se(rm_rf(temp, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);
292}
293
c270684a
RC
294static void test_unlink_noerrno(void) {
295 char name[] = "/tmp/test-close_nointr.XXXXXX";
296 int fd;
297
646853bd 298 fd = mkostemp_safe(name);
c270684a
RC
299 assert_se(fd >= 0);
300 assert_se(close_nointr(fd) >= 0);
301
302 {
303 PROTECT_ERRNO;
304 errno = -42;
305 assert_se(unlink_noerrno(name) >= 0);
306 assert_se(errno == -42);
307 assert_se(unlink_noerrno(name) < 0);
308 assert_se(errno == -42);
309 }
310}
311
312static void test_readlink_and_make_absolute(void) {
313 char tempdir[] = "/tmp/test-readlink_and_make_absolute";
314 char name[] = "/tmp/test-readlink_and_make_absolute/original";
315 char name2[] = "test-readlink_and_make_absolute/original";
316 char name_alias[] = "/tmp/test-readlink_and_make_absolute-alias";
317 char *r = NULL;
cd76d4c2 318 _cleanup_free_ char *pwd = NULL;
c270684a 319
c31ad024 320 assert_se(mkdir_safe(tempdir, 0755, getuid(), getgid(), false) >= 0);
c270684a
RC
321 assert_se(touch(name) >= 0);
322
323 assert_se(symlink(name, name_alias) >= 0);
324 assert_se(readlink_and_make_absolute(name_alias, &r) >= 0);
325 assert_se(streq(r, name));
326 free(r);
327 assert_se(unlink(name_alias) >= 0);
328
d7249575 329 assert_se(safe_getcwd(&pwd) >= 0);
cd76d4c2 330
c270684a
RC
331 assert_se(chdir(tempdir) >= 0);
332 assert_se(symlink(name2, name_alias) >= 0);
333 assert_se(readlink_and_make_absolute(name_alias, &r) >= 0);
334 assert_se(streq(r, name));
335 free(r);
336 assert_se(unlink(name_alias) >= 0);
337
cd76d4c2
YW
338 assert_se(chdir(pwd) >= 0);
339
c270684a
RC
340 assert_se(rm_rf(tempdir, REMOVE_ROOT|REMOVE_PHYSICAL) >= 0);
341}
342
343static void test_get_files_in_directory(void) {
344 _cleanup_strv_free_ char **l = NULL, **t = NULL;
345
346 assert_se(get_files_in_directory("/tmp", &l) >= 0);
347 assert_se(get_files_in_directory(".", &t) >= 0);
348 assert_se(get_files_in_directory(".", NULL) >= 0);
349}
350
34a8f081 351static void test_var_tmp(void) {
4245eb50 352 _cleanup_free_ char *tmpdir_backup = NULL, *temp_backup = NULL, *tmp_backup = NULL;
992e8f22 353 const char *tmp_dir = NULL, *t;
34a8f081 354
992e8f22
LP
355 t = getenv("TMPDIR");
356 if (t) {
357 tmpdir_backup = strdup(t);
358 assert_se(tmpdir_backup);
359 }
34a8f081 360
4245eb50
MAP
361 t = getenv("TEMP");
362 if (t) {
363 temp_backup = strdup(t);
364 assert_se(temp_backup);
365 }
366
367 t = getenv("TMP");
368 if (t) {
369 tmp_backup = strdup(t);
370 assert_se(tmp_backup);
371 }
372
85e55d14
YW
373 assert_se(unsetenv("TMPDIR") >= 0);
374 assert_se(unsetenv("TEMP") >= 0);
375 assert_se(unsetenv("TMP") >= 0);
34a8f081 376
992e8f22
LP
377 assert_se(var_tmp_dir(&tmp_dir) >= 0);
378 assert_se(streq(tmp_dir, "/var/tmp"));
34a8f081 379
992e8f22
LP
380 assert_se(setenv("TMPDIR", "/tmp", true) >= 0);
381 assert_se(streq(getenv("TMPDIR"), "/tmp"));
34a8f081 382
992e8f22
LP
383 assert_se(var_tmp_dir(&tmp_dir) >= 0);
384 assert_se(streq(tmp_dir, "/tmp"));
34a8f081 385
992e8f22
LP
386 assert_se(setenv("TMPDIR", "/88_does_not_exist_88", true) >= 0);
387 assert_se(streq(getenv("TMPDIR"), "/88_does_not_exist_88"));
34a8f081 388
992e8f22
LP
389 assert_se(var_tmp_dir(&tmp_dir) >= 0);
390 assert_se(streq(tmp_dir, "/var/tmp"));
34a8f081 391
992e8f22
LP
392 if (tmpdir_backup) {
393 assert_se(setenv("TMPDIR", tmpdir_backup, true) >= 0);
394 assert_se(streq(getenv("TMPDIR"), tmpdir_backup));
34a8f081 395 }
4245eb50
MAP
396
397 if (temp_backup) {
398 assert_se(setenv("TEMP", temp_backup, true) >= 0);
399 assert_se(streq(getenv("TEMP"), temp_backup));
400 }
401
402 if (tmp_backup) {
403 assert_se(setenv("TMP", tmp_backup, true) >= 0);
404 assert_se(streq(getenv("TMP"), tmp_backup));
405 }
34a8f081
OW
406}
407
49bfc877
LP
408static void test_dot_or_dot_dot(void) {
409 assert_se(!dot_or_dot_dot(NULL));
410 assert_se(!dot_or_dot_dot(""));
411 assert_se(!dot_or_dot_dot("xxx"));
412 assert_se(dot_or_dot_dot("."));
413 assert_se(dot_or_dot_dot(".."));
414 assert_se(!dot_or_dot_dot(".foo"));
415 assert_se(!dot_or_dot_dot("..foo"));
416}
417
57a4359e
LP
418static void test_access_fd(void) {
419 _cleanup_(rmdir_and_freep) char *p = NULL;
420 _cleanup_close_ int fd = -1;
421
422 assert_se(mkdtemp_malloc("/tmp/access-fd.XXXXXX", &p) >= 0);
423
424 fd = open(p, O_RDONLY|O_DIRECTORY|O_CLOEXEC);
425 assert_se(fd >= 0);
426
427 assert_se(access_fd(fd, R_OK) >= 0);
428 assert_se(access_fd(fd, F_OK) >= 0);
429 assert_se(access_fd(fd, W_OK) >= 0);
430
431 assert_se(fchmod(fd, 0000) >= 0);
432
433 assert_se(access_fd(fd, F_OK) >= 0);
434
435 if (geteuid() == 0) {
436 assert_se(access_fd(fd, R_OK) >= 0);
437 assert_se(access_fd(fd, W_OK) >= 0);
438 } else {
439 assert_se(access_fd(fd, R_OK) == -EACCES);
440 assert_se(access_fd(fd, W_OK) == -EACCES);
441 }
442}
443
9e3fa6e8
LP
444static void test_touch_file(void) {
445 uid_t test_uid, test_gid;
446 _cleanup_(rm_rf_physical_and_freep) char *p = NULL;
447 struct stat st;
448 const char *a;
449 usec_t test_mtime;
450
451 test_uid = geteuid() == 0 ? 65534 : getuid();
452 test_gid = geteuid() == 0 ? 65534 : getgid();
453
454 test_mtime = usec_sub_unsigned(now(CLOCK_REALTIME), USEC_PER_WEEK);
455
456 assert_se(mkdtemp_malloc("/dev/shm/touch-file-XXXXXX", &p) >= 0);
457
458 a = strjoina(p, "/regular");
459 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
460 assert_se(lstat(a, &st) >= 0);
461 assert_se(st.st_uid == test_uid);
462 assert_se(st.st_gid == test_gid);
463 assert_se(S_ISREG(st.st_mode));
464 assert_se((st.st_mode & 0777) == 0640);
465 assert_se(timespec_load(&st.st_mtim) == test_mtime);
466
467 a = strjoina(p, "/dir");
468 assert_se(mkdir(a, 0775) >= 0);
469 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
470 assert_se(lstat(a, &st) >= 0);
471 assert_se(st.st_uid == test_uid);
472 assert_se(st.st_gid == test_gid);
473 assert_se(S_ISDIR(st.st_mode));
474 assert_se((st.st_mode & 0777) == 0640);
475 assert_se(timespec_load(&st.st_mtim) == test_mtime);
476
477 a = strjoina(p, "/fifo");
478 assert_se(mkfifo(a, 0775) >= 0);
479 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
480 assert_se(lstat(a, &st) >= 0);
481 assert_se(st.st_uid == test_uid);
482 assert_se(st.st_gid == test_gid);
483 assert_se(S_ISFIFO(st.st_mode));
484 assert_se((st.st_mode & 0777) == 0640);
485 assert_se(timespec_load(&st.st_mtim) == test_mtime);
486
487 a = strjoina(p, "/sock");
488 assert_se(mknod(a, 0775 | S_IFSOCK, 0) >= 0);
489 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
490 assert_se(lstat(a, &st) >= 0);
491 assert_se(st.st_uid == test_uid);
492 assert_se(st.st_gid == test_gid);
493 assert_se(S_ISSOCK(st.st_mode));
494 assert_se((st.st_mode & 0777) == 0640);
495 assert_se(timespec_load(&st.st_mtim) == test_mtime);
496
497 if (geteuid() == 0) {
498 a = strjoina(p, "/cdev");
499 assert_se(mknod(a, 0775 | S_IFCHR, makedev(0, 0)) >= 0);
500 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
501 assert_se(lstat(a, &st) >= 0);
502 assert_se(st.st_uid == test_uid);
503 assert_se(st.st_gid == test_gid);
504 assert_se(S_ISCHR(st.st_mode));
505 assert_se((st.st_mode & 0777) == 0640);
506 assert_se(timespec_load(&st.st_mtim) == test_mtime);
507
508 a = strjoina(p, "/bdev");
509 assert_se(mknod(a, 0775 | S_IFBLK, makedev(0, 0)) >= 0);
510 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
511 assert_se(lstat(a, &st) >= 0);
512 assert_se(st.st_uid == test_uid);
513 assert_se(st.st_gid == test_gid);
514 assert_se(S_ISBLK(st.st_mode));
515 assert_se((st.st_mode & 0777) == 0640);
516 assert_se(timespec_load(&st.st_mtim) == test_mtime);
517 }
518
519 a = strjoina(p, "/lnk");
520 assert_se(symlink("target", a) >= 0);
521 assert_se(touch_file(a, false, test_mtime, test_uid, test_gid, 0640) >= 0);
522 assert_se(lstat(a, &st) >= 0);
523 assert_se(st.st_uid == test_uid);
524 assert_se(st.st_gid == test_gid);
525 assert_se(S_ISLNK(st.st_mode));
526 assert_se((st.st_mode & 0777) == 0640);
527 assert_se(timespec_load(&st.st_mtim) == test_mtime);
528}
529
c270684a
RC
530int main(int argc, char *argv[]) {
531 test_unlink_noerrno();
c270684a 532 test_get_files_in_directory();
496c486f 533 test_readlink_and_make_absolute();
34a8f081 534 test_var_tmp();
d944dc95 535 test_chase_symlinks();
49bfc877 536 test_dot_or_dot_dot();
57a4359e 537 test_access_fd();
9e3fa6e8 538 test_touch_file();
c270684a
RC
539
540 return 0;
541}