From: Curtis D. <Cu...@Gr...> - 2001-06-20 00:32:33
|
>> >> I seem to have recently acquired a bug where I cannot do a remote url >> >> install of a module. >> >> >> >> So anyway, miniserv.pl is still hanging. Endless hourglass when >> >I attempt to >> >> install a module from local or remote source. It looks like >> >miniserv.pl is >> >> spinning and enlessly spawning rm, over and over. Any ideas on >> >how to debug? >> > >> >Odd .. what module were you trying to remotely install? >> >> I've figured it out. This problem stems from an earlier patch I >submitted to >> Jamie that overloads stat with objects via the File::stat >module. (I prefer >> $foo->mtime to $foo[4].) Anyways, what happened was inside >&tempname() where >> it never exited the while(1) loop because the array was actually >an object >> an thus it was never seeing the permissions it expected to see. >> >> I've updated the patch to use File::stat without overloading, and the >> problem went away. That module is part of the standard perl >distribution so >> I can only hope Jamie will consider it. > >I'm a bit reluctant to use perl modules when there is already a built-in >function for doing the same thing, in order to cut down on load time and >to make it easier for people to run webmin on stripped-down >versions of perl. I understand. Performance is very important. My preference is always for code that is readable and self-documenting. That said, the difference between $inode[9] and $inode->mtime isn't that big. B'sides, he who knows what an hell an inode and an mtime is, probably already learned the numbered elements in stat(). ;) >> However &tmpname() still needed some serious help, so I rewrote >it. Some of >> it is shamelessly swiped from the FAQ. ;) Attached is the patch. > >Your patch basically does the same thing as the existing >tempname() function, >just using File::stat right (apart from removing all my hard-coded >uses of /tmp :-) It achieves the same purpose. And the patch is cumulative. Addtional changes are: - will get TMP from the environment if not /tmp (cross-platform futures?) - system call now explicit, doesn't use PATH (security?) - bail out counter in until() instead of while(1) loop (safety?) - enhancement to make_date() I sent you awhile back - further extension to our module versioning idea - extra security on diffs we talked about previously I think that's the jist. But I assuume you already caught those from the source and my comments therein. ../C |