From 3efe4b97fe8a65afbdfce812812e1acfd1b08433 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Thu, 5 May 2005 16:16:12 -0700 Subject: [PATCH] --- yaml --- r: 1035 b: refs/heads/master c: 3677209239ed71d2654e73eecfab1dbec2af11a9 h: refs/heads/master i: 1033: ea7dfc9281201f48c590d214f5bd4ed7cb5e1317 1031: d0efa329b996598cf4d9d5fe605950222f32bf03 v: v3 --- [refs] | 2 +- trunk/fs/exec.c | 4 +++- trunk/include/linux/sched.h | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index a193a1098f15..6e2d17569883 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 291c4a75ce7632ee5c565359fb875ba0597f76be +refs/heads/master: 3677209239ed71d2654e73eecfab1dbec2af11a9 diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 52acff3f44f0..e56ee2437025 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -869,9 +869,11 @@ int flush_old_exec(struct linux_binprm * bprm) if (current->euid == current->uid && current->egid == current->gid) current->mm->dumpable = 1; name = bprm->filename; + + /* Copies the binary name from after last slash */ for (i=0; (ch = *(name++)) != '\0';) { if (ch == '/') - i = 0; + i = 0; /* overwrite what we wrote */ else if (i < (sizeof(tcomm) - 1)) tcomm[i++] = ch; diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 5f868a588581..4dbb109022f3 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -578,7 +578,7 @@ struct task_struct { unsigned long flags; /* per process flags, defined below */ unsigned long ptrace; - int lock_depth; /* Lock depth */ + int lock_depth; /* BKL lock depth */ int prio, static_prio; struct list_head run_list; @@ -661,7 +661,10 @@ struct task_struct { struct key *thread_keyring; /* keyring private to this thread */ #endif int oomkilladj; /* OOM kill score adjustment (bit shift). */ - char comm[TASK_COMM_LEN]; + char comm[TASK_COMM_LEN]; /* executable name excluding path + - access with [gs]et_task_comm (which lock + it with task_lock()) + - initialized normally by flush_old_exec */ /* file system info */ int link_count, total_link_count; /* ipc stuff */