[PATCH] orinoco: misc fixes
[safe/jmp/linux-2.6] / fs / exec.c
index a839449..e56ee24 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -197,7 +197,8 @@ static int count(char __user * __user * argv, int max)
  * memory to free pages in kernel mem. These are in a format ready
  * to be put directly into the top of new user memory.
  */
-int copy_strings(int argc,char __user * __user * argv, struct linux_binprm *bprm)
+static int copy_strings(int argc, char __user * __user * argv,
+                       struct linux_binprm *bprm)
 {
        struct page *kmapped_page = NULL;
        char *kaddr = NULL;
@@ -868,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;