lkml.org 
[lkml]   [1998]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectargv[0] fix for DU binaries and linux-alpha
This patch (attached and at
ftp://draal.physics.wisc.edu/pub/kernel/exec.c.patch) fixes the argv[0]
problem with Digital Unix binaries under linux-alpha. I have personally
tested it with Netscape, Maple, and some executables I compiled myself, and
several other people with alphas have tested it as well.

I've posted this before, but it's been tested more now, and doesn't seem to
have any problems.

Please include this patch in the next release of the kernel.

thanks!
-- Bob

./'^`\._./'~`\._./'~`\._./'~`\._./'#`\._./'~`\._./'~`\._./'~`\._./'^`\.
/ Rube Goldberg? Bah! Amateur! I give you..Windows 98! Linux everywhere \
| Linux, because everyone's work is mission critical. ANYTHING inside. |
|_Bob McElrath (mcelrath@wisconsin.cern.ch) Univ. of Wisconsin at Madison_|
\.___________________________________________________________________./
--- fs/exec.c.orig Thu Aug 27 16:30:50 1998
+++ fs/exec.c Fri Oct 23 22:39:53 1998
@@ -746,12 +746,13 @@
*/
int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
{
- int try,retval=0;
+ int try,retval=0, i;
struct linux_binfmt *fmt;
#ifdef __alpha__
/* handle /sbin/loader.. */
{
struct exec * eh = (struct exec *) bprm->buf;
+ struct linux_binprm bprm_loader;

if (!bprm->loader && eh->fh.f_magic == 0x183 &&
(eh->fh.f_flags & 0x3000) == 0x3000)
@@ -761,15 +762,17 @@

dput(bprm->dentry);
bprm->dentry = NULL;
- remove_arg_zero(bprm);
- bprm->p = copy_strings(1, dynloader, bprm->page, bprm->p, 2);
- bprm->argc++;
- bprm->loader = bprm->p;
+
+ bprm_loader.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
+ for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */
+ bprm_loader.page[i] = 0;
+
dentry = open_namei(dynloader[0], 0, 0);
retval = PTR_ERR(dentry);
if (IS_ERR(dentry))
return retval;
bprm->dentry = dentry;
+ bprm->loader = bprm_loader.p;
retval = prepare_binprm(bprm);
if (retval<0)
return retval;
\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.090 / U:0.356 seconds]
©2003-2014 Jasper Spaans. Advertise on this site