/* Stephen C. Losen [scl@sasha.acc.virginia.edu] writes: */
main(int argc, char **argv) { setuid(0); argv[0] = "/usr/sbin/quota"; execv(argv[0], argv); }
Compile the above, chown it to root and make it set user with chmod u+s. It runs the standard quota command as root, passing through the command line args. Now you have a command that any user can run to report any quota. No need for suexec or cgiwrap.
Just a few comments...
. Quota is already suid on the platforms I am most familiar with. SunOS 4.x, Solaris 2.x, FreeBSD, ...
. It is typically a bad idea to simply wrap a program and make it suid. It is a *significant* security risk.
. Letting users see quotas for anyone but themselves is inappropriate in many environments. Certainly can be construed as a privacy issue if nothing else.