binfmt_java problems

H. Peter Anvin (hpa@freya.yggdrasil.com)
15 May 1996 05:26:25 GMT


[I would have sent this to the author, but I couldn't find his email
address.]

Dear friends,

Im my opinion there is a very serious problems with binfmt_java as
implemented in the pre2.0 series kernels. This is particularly
disturbing given the timings, although the problem is technically
fairly trivial.

The problem is that it assumes *way* too much about the user space
environment. All of the following are assumed:

1. A /usr partition exists, is writable and/or the version of java
installed there is appropriate;
2. /bin/bash (not even /bin/sh) exists and is appropriate for running
shell scripts;
3. /usr/bin/java and /usr/bin/appletviewer are shell scripts.
4. It appears to me that it will not properly handle executing it from
anywhere but the current directory, since it strips the path from
the front.

I would suggest one of the following approaches:

1. Easiest: define /sbin/kjavad as a wrapper program which knows about
the appropriate paths (/sbin/kjavad can of course be a symlink off
the root partition if need be, but the key is that the kernel
should not know of paths on the /usr partition which may not exist
and/or be writable.)

Require /sbin/kjavad to be a compiled binary.

2. Somewhat harder: use /(s)bin/{java,appletviewer}, make #! work in
those programs.

3. Hardest/most flexible: set the appropriate paths through /proc/sys;
disable Java binaries unless the paths are set.

I'll try to hack up #3.

-hpa
--=20
PGP public key available - finger hpa@zytor.com
"The earth is but one country, and mankind its citizens." -- Bah=E1'u=
'll=E1h
I don't work for Yggdrasil, but they sponsor the linux.* hierarchy.