diff options
author | Nikolay Sturm <sturm@cvs.openbsd.org> | 2003-05-17 03:10:00 +0000 |
---|---|---|
committer | Nikolay Sturm <sturm@cvs.openbsd.org> | 2003-05-17 03:10:00 +0000 |
commit | 4ed43aa9c5649a159fa81dfa121248884f0e3f75 (patch) | |
tree | f989866d99da090ec034b1dfeef072c5c9ceb610 /bin/systrace | |
parent | e03bd61e42229e0b651f7ba7500ac995088f43c5 (diff) |
pull in a bugfix from systrace-current to let systrace deal with creating
directories correctly
OK itojun@, thanks to niels for the help
Diffstat (limited to 'bin/systrace')
-rw-r--r-- | bin/systrace/intercept.c | 10 | ||||
-rw-r--r-- | bin/systrace/register.c | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c index 6b1a57981d6..e5b23123d99 100644 --- a/bin/systrace/intercept.c +++ b/bin/systrace/intercept.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intercept.c,v 1.38 2003/02/20 22:03:31 art Exp $ */ +/* $OpenBSD: intercept.c,v 1.39 2003/05/17 03:09:59 sturm Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -661,11 +661,11 @@ intercept_filename(int fd, pid_t pid, void *addr, int userp) * At this point, filename has to exist and has to * be a directory. */ - if (lstat(rcwd, &st) == -1) - failed = 1; - else if (userp != ICLINK_NOLAST && - !(st.st_mode & S_IFDIR)) + if (userp != ICLINK_NOLAST) { + if (lstat(rcwd, &st) == -1 || + !(st.st_mode & S_IFDIR)) failed = 1; + } } out: if (failed) diff --git a/bin/systrace/register.c b/bin/systrace/register.c index 5535d19daa8..d68ddc22117 100644 --- a/bin/systrace/register.c +++ b/bin/systrace/register.c @@ -1,4 +1,4 @@ -/* $OpenBSD: register.c,v 1.13 2002/11/16 14:27:17 itojun Exp $ */ +/* $OpenBSD: register.c,v 1.14 2003/05/17 03:09:59 sturm Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -117,7 +117,8 @@ systrace_initcb(void) systrace_alias_add_trans(alias, tl); X(intercept_register_sccb("native", "mkdir", trans_cb, NULL)); - tl = intercept_register_transfn("native", "mkdir", 0); + tl = intercept_register_translation("native", "mkdir", 0, + &ic_translate_unlinkname); alias = systrace_new_alias("native", "mkdir", "native", "fswrite"); systrace_alias_add_trans(alias, tl); X(intercept_register_sccb("native", "rmdir", trans_cb, NULL)); @@ -126,7 +127,8 @@ systrace_initcb(void) systrace_alias_add_trans(alias, tl); X(intercept_register_sccb("native", "rename", trans_cb, NULL)); - intercept_register_transfn("native", "rename", 0); + intercept_register_translation("native", "rename", 0, + &ic_translate_unlinkname); intercept_register_transfn("native", "rename", 1); X(intercept_register_sccb("native", "symlink", trans_cb, NULL)); intercept_register_transstring("native", "symlink", 0); |