[17566] in Athena Bugs
Re: matlab launch script under /bin/sh, NetBSD 1.4.1
daemon@ATHENA.MIT.EDU (Jacob Morzinski)
Sat Feb 19 01:41:39 2000
To: bugs@MIT.EDU
Cc: Brad Thompson <yak@MIT.EDU>
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
From: Jacob Morzinski <jmorzins@MIT.EDU>
Date: 19 Feb 2000 01:41:33 -0500
In-Reply-To: Brad Thompson's message of "Fri, 18 Feb 2000 18:36:03 -0500"
Message-ID: <w6mog9dbso2.fsf@hodge-podge.mit.edu>
I took a look at this, but my diagnosis is different from Brad's.
My conclusion is: run chmod 755 /mit/matlab/arch/share/bin/wrapper
I verified that trying to run "matlab" from /bin/sh prints
Can't execute /mit/matlab/arch/.../bin/matlab
and doesn't run the wrapper. I've reproduced this behavior with
Solaris's /bin/sh and Ultrix's /bin/sh -- it's not just a NetBSD
issue.
When searching for an executable file to run in response to a
typed command, /bin/sh checks the UFS file permissions of files
in the PATH. It has a variety of different error messages for
files which it thinks that user does not have permissions to run.
One sh's error messages is
Can't execute {FOO}
if the user somehow tricks it into chasing a symlink that points
to a file that the user doesn't have UFS permission to execute.
When testing with copies of the matlab and wrapper scripts on
local disk, I was able to reproduce the error message, and was
able to eliminate it by making sure that the target of the
symlink is executable by the user.
To fix this bug, make the "wrapper" script mode 755.
For Alex: if you put the command "umask 022" in your .cshrc.mine
file, you probably won't have to worry about this in the future.
Otherwise, you'll have to remember to verify filesystem permissions
each time you install something new.
<yak@MIT.EDU> (Brad Thompson) writes:
> The matlab startup script breaks under NetBSD 1.4.1 when launched
> by /bin/sh. It relies on the (common) behavior of shells to try
> to use themselves to execute programs that execl() fails on. One
> fix is for me to type "sh `which matlab`" whenever I want to run
> matlab. The other is to put a "#!/bin/sh" or "#!/usr/athena/bin/perl -w"
> line at top of the wrapper script, which should proably be there anyway.