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
This commit is contained in:
Axel Dörfler
2007-03-25 12:42:30 +00:00
parent 3ad50dab2e
commit a201ac2cf9
+5 -2
View File
@@ -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();