diff options
author | dillon <dillon@FreeBSD.org> | 2000-04-26 20:58:40 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2000-04-26 20:58:40 +0000 |
commit | ce08285d5ac062de6a96e6491313b81bea80ecaa (patch) | |
tree | 9c48fa81d6c9503f7a1fd3b5440dc0d58696221e /sys/sys/imgact.h | |
parent | c816580dfb530d84c2396d9f0d10a9f8e44d4ea4 (diff) | |
download | FreeBSD-src-ce08285d5ac062de6a96e6491313b81bea80ecaa.zip FreeBSD-src-ce08285d5ac062de6a96e6491313b81bea80ecaa.tar.gz |
Fix #! script exec under linux emulation. If a script is exec'd from a
program running under linux emulation, the script binary is checked for
in /compat/linux first. Without this patch the wrong script binary
(i.e. the FreeBSD binary) will be run instead of the linux binary.
For example, #!/bin/sh, thus breaking out of linux compatibility mode.
This solves a number of problems people have had installing linux
software on FreeBSD boxes.
Diffstat (limited to 'sys/sys/imgact.h')
-rw-r--r-- | sys/sys/imgact.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index 9cb2e35..c13d81f 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -36,6 +36,8 @@ #ifndef _SYS_IMGACT_H_ #define _SYS_IMGACT_H_ +#define MAXSHELLCMDLEN 64 + struct image_params { struct proc *proc; /* our process struct */ struct execve_args *uap; /* syscall arguments */ @@ -51,7 +53,7 @@ struct image_params { unsigned long entry_addr; /* entry address of target executable */ char vmspace_destroyed; /* flag - we've blown away original vm space */ char interpreted; /* flag - this executable is interpreted */ - char interpreter_name[64]; /* name of the interpreter */ + char interpreter_name[MAXSHELLCMDLEN]; /* name of the interpreter */ void *auxargs; /* ELF Auxinfo structure pointer */ struct vm_page *firstpage; /* first page that we mapped */ char *fname; /* pointer to filename of executable (user space) */ @@ -62,6 +64,7 @@ struct image_params { int exec_check_permissions __P((struct image_params *)); int exec_extract_strings __P((struct image_params *)); int exec_new_vmspace __P((struct image_params *)); +int exec_shell_imgact __P((struct image_params *)); #endif #endif /* !_SYS_IMGACT_H_ */ |