From: Philip Mak Date: 2002-08-19T06:47:13+09:00 Subject: Re: How can I avoid "Insecure operation - stat (SecurityError) " On Mon, Aug 19, 2002 at 03:34:53AM +0900, JamesBritt wrote: > I'm trying to get some ruby code, running under mod_ruby, to retrieve the > mtime of a file. But calls to stat raise "Insecure operation - stat > (SecurityError)". > > $SAFE is at 1; trying to lower it raises an error. > The site runs ruby 1.6.7 (2002-07-11) [i386-freebsd4] > > How can I retrieve the last mod time of a file without raising security > errors? > untainintg the string variable holding the name of file doesn't help either. Try putting this in your httpd.conf and then restarting Apache: RubySafeLevel 0 There might be another way to get your code to work without decreasing the safe level (which is probably more secure). You might try asking on the modruby mailing list (http://www.modruby.net/#label:10).