Ultrix 3.1 (VAX) #! interpreter symlink bug

Ian! D. Allen [CGL] idallen at watcgl.waterloo.edu
Mon Apr 15 06:16:59 AEST 1991


#!/bin/sh
# Ultrix-32 V3.1 (Rev. 11)
# Run this on Ultrix 3.1 and see how your #! path symlink messes up.
# idallen at watcgl.waterloo.edu

cd /tmp

# Create an executable file using the "/tmp/2" interpreter.
#
cat >1 <<'EOF'
#!/tmp/2
echo $0 hi there
EOF
chmod +x 1

# Create the "/tmp/2" interpreter as a symlink to a huge pathname.
#
long=/tmp/6789a123456789b123456789c123456789d
ln -s $long 2

# And put sh into the long pathname.
#
cp /bin/sh $long

# Try to execute the file.
# On Ultrix 3.1 (VAX) you'll see "456789d: 456789d: cannot open" here.
# No problem with other Unixes, or on other versions of Ultrix.
# The conjecture is that Ultrix 3.1 is putting a 32-byte limit on the
# *symlink* expansion of the #! interpreter.
#
./1

rm 1 2 $long
-- 
-IAN! (Ian! D. Allen) idallen at watcgl.uwaterloo.ca idallen at watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada



More information about the Comp.unix.ultrix mailing list