================================================================== Using the 1999 S&P Symposium Proceedings CD on UNIX ================================================================== At the Oakland symposium this year, I heard some complaints that the CD-ROM distributed at the 1999 meeting containing the first 20 years of proceedings does not work properly on Unix platforms. When the proof copy of the CD came in last spring, I tried it briefly on a Solaris platform and thought it worked, so I was surprised and dismayed to hear this. Happily (with Lee Badger's help), I found Doug Kilpatrick of NAI Labs who was running Linux on his laptop. Doug tried it out and found that the problem seems to stem from case-sensitive operations: Acrobat Reader tries to open a file named "DATA/01234567.PDF" when the file on the CD is actually "data/01234567.pdf". In Unix, case matters, so the operation fails. Doug proposes several alternative solutions for Unix users to try. Thanks very much to Doug for his work on this problem. --Carl Landwehr Doug Kilpatrick's advice: 1. For Linux, the iso9660 fs driver takes some options that might help. Try mounting the cd with a command similar to: mount -t iso9660 -o norock,map=n,check=r /dev/cdrom /mnt/cdrom Other versions of Unix may have similar options. 2. Copy the file tree to your hard drive and rename all the files in the tree. For example: $ mkdir ~/oakland99 $ cd /mnt/cdrom $ tar -cf - . | (cd ~/oakland99 ; tar -xf -) $ cat > ~/bin/tolower #!/bin/bash if [ $# -ne 1 ]; then echo "useage: tolower " echo "renames the file, changeing any upper case" echo "characters to lower-case" return 1 fi mv $1 $(dirname $1)/$(basename $1 | tr 'A-Z' 'a-z') ^D $ chmod u+x ~/bin/tolower $ cd ~/oakland99 $ find * | sort -r | xargs -r -n 1 ~/bin/tolower 3. Use LD_PRELOAD to replace the open() call with code that does conditional case-smashing before executing the system call. (I've attached some x86 glibc-linux-specific sample code. Its painfully ugly, at least partially due to some GNU-ism's that make this more difficult.) #include #include #include #include #include #include #include #include #include /* * gcc -shared -O2 -Wall -g -c case-smash-open.c * ld -Bsymbolic -shared -o case-smash-open.so case-smash-open.o * export LD_PRELOAD=`pwd`/case-smash-open.so * * unset LD_PRELOAD */ int errno; int trap_open(const char *pathname, int flags, mode_t mode) { long __res; __asm__ volatile ("int $0x80" : "=a" (__res) : "0" (__NR_open),"b" ((long)(pathname)),"c" ((long)(flags)), "d" ((long)(mode))); do { if ((unsigned long)(__res) >= (unsigned long)(-125)) { errno = -(__res); __res = -1; } } while (0); return __res; } int open(const char *pathname, int flags, ...) { va_list ap; char newpath[4096]; mode_t mode; int i; int retval; int smash = 0; for (i = 0; pathname[i] != '\0' && i < (sizeof(newpath)-1); ++i) { if (pathname[i] >= 'A' && pathname[i] <= 'Z') newpath[i] = pathname[i] - ('A' - 'a'); else newpath[i] = pathname[i]; } newpath[i] = '\0'; if (newpath[i-1] == 'f' && newpath[i-2] == 'd' && newpath[i-3] == 'p') smash = 1; if (flags & O_CREAT) { va_start(ap, flags); mode = va_arg(ap, mode_t); retval = trap_open(smash?newpath:pathname,flags,mode); va_end(ap); } else { retval = trap_open(smash?newpath:pathname,flags,0); } return retval; } =================================================================== Exercise for the reader: does the above make this issue of Cipher into an example of mobile code? ===================================================================