summaryrefslogtreecommitdiff
path: root/bin/systrace/openbsd-syscalls.c
diff options
context:
space:
mode:
authormarius eriksen <marius@cvs.openbsd.org>2004-06-23 05:16:36 +0000
committermarius eriksen <marius@cvs.openbsd.org>2004-06-23 05:16:36 +0000
commit528bd53c0cc743655a6747db3a4d672c6098ca67 (patch)
treeb1d6879de63ee62cdb2c8342dff0c4f0fba6cd19 /bin/systrace/openbsd-syscalls.c
parent2ff9215ae085c0961f6425b9bbae0fc6b5e5d9a0 (diff)
a few fixes to systrace
- add an exec message so that whenever a set-uid/gid process exec's a new image which we may control, the exec does not go by unnoticed. - take special care to check for P_SUGIDEXEC as well as P_SUGID, corresponding to the same changes that were made in the ptrace code a while ago ok niels@, sturm@; thanks to naddy for testing
Diffstat (limited to 'bin/systrace/openbsd-syscalls.c')
-rw-r--r--bin/systrace/openbsd-syscalls.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/systrace/openbsd-syscalls.c b/bin/systrace/openbsd-syscalls.c
index 6e275c2a245..d806b0784ce 100644
--- a/bin/systrace/openbsd-syscalls.c
+++ b/bin/systrace/openbsd-syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openbsd-syscalls.c,v 1.23 2003/10/22 21:03:35 sturm Exp $ */
+/* $OpenBSD: openbsd-syscalls.c,v 1.24 2004/06/23 05:16:35 marius Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -621,6 +621,19 @@ obsd_read(int fd)
intercept_child_info(msg.msg_pid,
msg.msg_data.msg_child.new_pid);
break;
+#ifdef SYSTR_MSG_EXECVE
+ case SYSTR_MSG_EXECVE: {
+ struct str_msg_execve *msg_execve = &msg.msg_data.msg_execve;
+
+ intercept_newimage(fd, pid, msg.msg_policy, current->name,
+ msg_execve->path, NULL);
+
+ if (obsd_answer(fd, pid, seqnr, 0, 0, 0, NULL) == -1)
+ err(1, "%s:%d: answer", __func__, __LINE__);
+ break;
+ }
+#endif
+
#ifdef SYSTR_MSG_POLICYFREE
case SYSTR_MSG_POLICYFREE:
intercept_policy_free(msg.msg_policy);