From a201ac2cf99eb94fe50b73099da49ff5fbcc1757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 25 Mar 2007 12:42:30 +0000 Subject: [PATCH] The kernel no longer allows anyone to rename a thread unless you're the current owner of that thread - this fixes the kernel part of bug #1122. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20419 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/thread.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/thread.c b/src/system/kernel/thread.c index eabf6953c6..336a26cb9a 100644 --- a/src/system/kernel/thread.c +++ b/src/system/kernel/thread.c @@ -1876,8 +1876,11 @@ rename_thread(thread_id id, const char *name) thread = thread_get_thread_struct_locked(id); if (thread != NULL) { - strlcpy(thread->name, name, B_OS_NAME_LENGTH); - status = B_OK; + if (thread->team == thread_get_current_thread()->team) { + strlcpy(thread->name, name, B_OS_NAME_LENGTH); + status = B_OK; + } else + status = B_NOT_ALLOWED; } RELEASE_THREAD_LOCK();