Listing 1
static inline int do_load_bloom_binary(struct
linux_binprm *bprm, struct pt_regs *regs)
{
int retval;
if ( /* the format is not one of ours */ )
return -ENOEXEC;
/* release the inode, it will be opened
* as argument */
iput(bprm->inode);
bprm->dont_iput = 1;
/* replace argv[0] with the full pathname */
remove_arg_zero(bprm);
bprm->p = copy_strings(1, &bprm->filename,
bprm->page, bprm->p, 2);
bprm->argc++;
/* and push the viewer's basename to the top
* of the command line */
bprm->p = copy_strings(1, &viewer_name,
bprm->page, bprm->p, 2);
bprm->argc++;
/* very unlikely it's more than 32 pages... */
if (!bprm->p)
return -E2BIG;
/* ok, now open the interpreter, and reenter
* the loop */
retval = open_namei(viewer, 0, 0,
&bprm->inode, NULL);
if (retval)
return retval;
bprm->dont_iput = 0;
retval = prepare_binprm(bprm);
if (retval<0)
return retval;
return search_binary_handler(bprm,regs);
}
Copyright © 1994 - 2019 Linux Journal. All rights reserved.