SUMMARY: Can't get suidperl working

From: Jonathan Rozes <jrozes_at_gumbo.tcs.tufts.edu>
Date: Tue, 9 Jul 1996 10:31:44 -0400

Hi--

The problem with suidperl is that the call to rewind() in perl.c does not
guarantee it will do anything on the underlying file descriptor. This was
causing the first 8k of any script to be ignored.

The solution is to replace the call to rewind with a call to lseek(). In
perl.c (on both 4.036 and 5.003), replace the line:

        rewind(rsfp);

With this:

        lseek(fileno(rsfp), (off_t)0, 0);

And recompile. Setuid scripts should now work...

Thanks to Tony Sanders and Larry Wall for the fix.

jonathan

-- 
+++ Jonathan Rozes, Unix Systems Administrator, Tufts University
++  jrozes_at_tcs.tufts.edu, http://rozes.tcs.tufts.edu/
+   Ultimately, thinking is a very inefficient method of processing
    data.... [Surfing the Himalayas, 0-312-14147-5]
Received on Tue Jul 09 1996 - 17:13:06 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT