I think the reason the check for userid == 0 was originally in the code was that setrlimit will fail completely, failing even to set the soft limit, if you call it with a structure which will attempt to set the hard limit upward.
So whoever put the check in was trying to be nice and at least allow some limit to be set. That is why I left the check in, and simply made the algorithm consistent with the comment and error message. By the way, I've got another bug fix, not yet read, to RLimitMEM and RLimitCPU. The bug is that these are only in effect for cgi scripts and server side include exec's. But I've been using the Perl Module stuff, with people who had buggy perl code. So I've made a modification that allows you to configure RLimit's inside of child_main. It is really essential for general use of Perl Module when debugging Perl code that behaves differently in the slightly different environment. Anyway, I've got to clean that stuff up first.
