diff options
author | Nikolay Sturm <sturm@cvs.openbsd.org> | 2004-01-30 17:21:17 +0000 |
---|---|---|
committer | Nikolay Sturm <sturm@cvs.openbsd.org> | 2004-01-30 17:21:17 +0000 |
commit | 816707c18d9d182a27d94ba70ddd004597217b6d (patch) | |
tree | 55a266acda9e97a2771b42acf68c3e10a05e55b0 /bin | |
parent | d3fd98825907f06bc5e7cdba792f9979a78ae400 (diff) |
The empty filename does not receive normalization.
System calls are supposed to fail on it.
from provos@, ok markus@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/systrace/intercept.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c index 5777c4de36d..eef9bebfa24 100644 --- a/bin/systrace/intercept.c +++ b/bin/systrace/intercept.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intercept.c,v 1.44 2003/10/18 19:26:00 jmc Exp $ */ +/* $OpenBSD: intercept.c,v 1.45 2004/01/30 17:21:16 sturm Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -613,6 +613,13 @@ normalize_filename(int fd, pid_t pid, char *name, int userp) static char cwd[2*MAXPATHLEN]; int havecwd = 0; + /* + * The empty filename does not receive normalization. + * System calls are supposed to fail on it. + */ + if (strcmp(name, "") == 0) + return (name); + if (fd != -1 && intercept.setcwd(fd, pid) == -1) { if (errno == EBUSY) return (NULL); |